[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/svg-tag-mode a5098267c9 41/63: Updated example 2 to new
From: |
ELPA Syncer |
Subject: |
[elpa] externals/svg-tag-mode a5098267c9 41/63: Updated example 2 to new tags format. |
Date: |
Mon, 27 Dec 2021 15:57:59 -0500 (EST) |
branch: externals/svg-tag-mode
commit a5098267c9216ea06cfb665e1393450334ac93dd
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Updated example 2 to new tags format.
---
examples/example-2.el | 161 +++++++++++++-------------------------------------
1 file changed, 41 insertions(+), 120 deletions(-)
diff --git a/examples/example-2.el b/examples/example-2.el
index 40d55a3d6c..c980ccd585 100644
--- a/examples/example-2.el
+++ b/examples/example-2.el
@@ -15,128 +15,49 @@
;; see <http://www.gnu.org/licenses/>.
(require 'svg-tag-mode)
-(defface svg-tag-org-face
- '((t :foreground "#333333" :background "white"
- :box (:line-width 1 :color "black" :style nil)
- :family "Roboto Mono" :weight regular :height 120))
- "Default face for svg tag" :group nil)
-
-(defface svg-tag-note-face
- '((t :foreground "#333333" :background "#FFFFFF"
- :box (:line-width 1 :color "#333333" :style nil)
- :family "Roboto Mono" :weight regular :height 120))
- "Default face for svg tag" :group nil)
-
-(defface svg-tag-todo-face
- '((t :foreground "#ffffff" :background "#FFAB91"
- :box (:line-width 1 :color "#FFAB91" :style nil)
- :family "Roboto Mono" :weight regular :height 120))
- "Face for TODO svg tag" :group nil)
-
-(defface svg-tag-next-face
- '((t :foreground "white" :background "#673AB7"
- :box (:line-width 1 :color "#673AB7" :style nil)
- :family "Roboto Mono" :weight regular :height 120))
- "Face for NEXT svg tag" :group nil)
-
-(defface svg-tag-done-face
- '((t :foreground "white" :background "#B0BEC5"
- :box (:line-width 1 :color "#B0BEC5" :style nil)
- :family "Roboto Mono" :weight regular :height 120))
- "Face for DONE svg tag" :group nil)
-
-(defface svg-tag-org-tag-face
- '((t :foreground "#ffffff" :background "#FFAB91"
- :box (:line-width 1 :color "#FFAB91" :style nil)
- :family "Roboto Mono" :weight regular :height 120))
- "Face for TODO svg tag" :group nil)
-
-(defface svg-tag-date-active-face
- '((t :foreground "white" :background "#673AB7"
- :box (:line-width 1 :color "#673AB7" :style nil)
- :family "Roboto Mono" :weight regular :height 120))
- "Face for active date svg tag" :group nil)
-
-(defface svg-tag-time-active-face
- '((t :foreground "#673AB7" :background "#ffffff"
- :box (:line-width 1 :color "#673AB7" :style nil)
- :family "Roboto Mono" :weight light :height 120))
- "Face for active time svg tag" :group nil)
-
-(defface svg-tag-date-inactive-face
- '((t :foreground "#ffffff" :background "#B0BEC5"
- :box (:line-width 1 :color "#B0BEC5" :style nil)
- :family "Roboto Mono" :weight regular :height 120))
- "Face for inactive date svg tag" :group nil)
-
-(defface svg-tag-time-inactive-face
- '((t :foreground "#B0BEC5" :background "#ffffff"
- :box (:line-width 2 :color "#B0BEC5" :style nil)
- :family "Roboto Mono" :weight light :height 120))
- "Face for inactive time svg tag" :group nil)
-
-(setq svg-tag-org-todo (svg-tag-make "TODO" 'svg-tag-todo-face 1 1 2))
-(setq svg-tag-org-done (svg-tag-make "DONE" 'svg-tag-done-face 1 1 2))
-(setq svg-tag-org-hold (svg-tag-make "HOLD" 'svg-tag-org-face 1 1 2))
-(setq svg-tag-org-next (svg-tag-make "NEXT" 'svg-tag-next-face 1 1 2))
-(setq svg-tag-org-note-tag (svg-tag-make "NOTE" 'svg-tag-note-face 1 1 2))
-(setq svg-tag-org-canceled-tag (svg-tag-make "CANCELED" 'svg-tag-note-face 1 1
2))
-
-(defun svg-tag-make-org-tag (text)
- (svg-tag-make (substring text 1 -1) 'svg-tag-org-tag-face 1 1 2))
-(defun svg-tag-make-org-priority (text)
- (svg-tag-make (substring text 2 -1) 'svg-tag-org-face 1 0 2))
-
-(defun svg-tag-make-org-date-active (text)
- (svg-tag-make (substring text 1 -1) 'svg-tag-date-active-face 0 0 0))
-(defun svg-tag-make-org-time-active (text)
- (svg-tag-make (substring text 0 -1) 'svg-tag-time-active-face 1 0 0))
-(defun svg-tag-make-org-range-active (text)
- (svg-tag-make (substring text 0 -1) 'svg-tag-time-active-face 0 0 0))
-
-(defun svg-tag-make-org-date-inactive (text)
- (svg-tag-make (substring text 1 -1) 'svg-tag-date-inactive-face 0 0 0))
-(defun svg-tag-make-org-time-inactive (text)
- (svg-tag-make (substring text 0 -1) 'svg-tag-time-inactive-face 1 0 0))
-(defun svg-tag-make-org-range-inactive (text)
- (svg-tag-make (substring text 0 -1) 'svg-tag-time-inactive-face 0 0 0))
-
-
(defconst date-re "[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}")
(defconst time-re "[0-9]\\{2\\}:[0-9]\\{2\\}")
(defconst day-re "[A-Za-z]\\{3\\}")
(setq svg-tag-tags
- `(("@[0-9a-zA-Z]+:" . svg-tag-make-org-tag)
- ("@NOTE:" . svg-tag-org-note-tag)
- ("@CANCELED:" . svg-tag-org-canceled-tag)
- ("\\[#[ABC]\\]" . svg-tag-make-org-priority)
- (" TODO " . svg-tag-org-todo)
- (" DONE " . svg-tag-org-done)
- (" NEXT " . svg-tag-org-next)
- (" HOLD " . svg-tag-org-hold)
-
- (,(concat "<" date-re "[ >]") .
svg-tag-make-org-date-active)
- (,(concat "<" date-re " " day-re "[ >]") .
svg-tag-make-org-date-active)
- (,(concat time-re ">") .
svg-tag-make-org-time-active)
- (,(concat time-re "-" time-re ">") .
svg-tag-make-org-range-active)
-
- (,(concat "\\[" date-re "[] ]") .
svg-tag-make-org-date-inactive)
- (,(concat "\\[" date-re " " day-re "[] ]") .
svg-tag-make-org-date-inactive)
- (,(concat time-re "\\]") .
svg-tag-make-org-time-inactive)
- (,(concat time-re "-" time-re "\\]") .
svg-tag-make-org-range-inactive)))
-
-(svg-tag-mode)
-
-;; To do: TODO NEXT HOLD DONE
-;; Tags: @MEETING:@NOTE:
-;; Priorities: [#A] [#B] [#C]
-;; Active date: <2020-11-07>
-;; <2020-11-07 Sat>
-;; <2020-11-07 Sat 14:00>
-;; <2020-11-07 Sat 14:00-15:00>
-
-;; Inactive date: [2020-11-07]
-;; [2020-11-07 Sat]
-;; [2020-11-07 Sat 14:00]
-;; [2020-11-07 Sat 14:00-15:00]
+ `(
+ ;; Org tags
+ ("\\(:#[A-Za-z0-9]+\\)" . ((lambda (tag)
+ (svg-tag-make tag :face 'org-tag
+ :beg 2 :alignment 0))))
+ ("\\(:#[A-Za-z0-9]+:\\)$" . ((lambda (tag)
+ (svg-tag-make tag :face 'org-tag
+ :beg 2 :end -1
+ :alignment 0))))
+ ;; Org priority
+ ("\\[#[A-Z]\\]" . ( (lambda (tag)
+ (svg-tag-make tag :face 'org-priority
+ :beg 2 :end -1 :margin 0))))
+
+ ;; Org TODO / DONE
+ ("TODO" . ((svg-tag-make "TODO" :face 'org-todo :inverse t :margin 0)))
+ ("DONE" . ((svg-tag-make "DONE" :face 'org-done :margin 0)))
+
+ ;; Org date (without day name)
+ (,(format "\\(<%s *\\)%s>" date-re time-re) .
+ ((lambda (tag)
+ (svg-tag-make tag :beg 1 :inverse t :crop-right t :margin 0))))
+ (,(format "<%s *\\(%s>\\)" date-re time-re) .
+ ((lambda (tag)
+ (svg-tag-make tag :end -1 :crop-left t :margin 0))))
+
+ (,(format "\\(\\[%s *\\)%s\\]" date-re time-re) .
+ ((lambda (tag)
+ (svg-tag-make tag :beg 1 :inverse t :crop-right t :margin 0 :face
'org-date))))
+ (,(format "\\[%s *\\(%s\\]\\)" date-re time-re) .
+ ((lambda (tag)
+ (svg-tag-make tag :end -1 :crop-left t :margin 0 :face
'org-date))))
+ ))
+
+(svg-tag-mode t)
+
+;; To do: TODO DONE
+;; Tags: :#MEETING:#NOTE:
+;; Priorities: [#A] [#B] [#C]
+;; Active date: <2021-12-24 14:00>
+;; Inactive date: [2021-12-24 14:00]
- [elpa] externals/svg-tag-mode cec780a16f 21/63: Added version, (continued)
- [elpa] externals/svg-tag-mode cec780a16f 21/63: Added version, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 4fdc7ffbb3 23/63: Fixed font weights, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 609ed7cc32 24/63: Removed free variable, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 0125ceca29 22/63: Fix README, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode a9e8d9e705 27/63: Fixes followign review at https://github.com/melpa/melpa/pull/7217, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 40d7820143 28/63: Moved examples into a directory, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode c0492f9046 30/63: Fixed links, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 78a343f0f3 34/63: Cleanup whitespace, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 29ca63cdbb 36/63: Rewrote the mode using svg-lib, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode f6adc4b772 39/63: Make sure to remove space from tag., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode a5098267c9 41/63: Updated example 2 to new tags format.,
ELPA Syncer <=
- [elpa] externals/svg-tag-mode e9a6256dee 44/63: Added org-mode screenshot, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 525901723f 47/63: Fixed requirements., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 8d9dd283fb 45/63: Updated screenshot, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode aca351185b 52/63: Fixed documentation., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 558ac3d3bd 54/63: Added edit mode (tag is hidden) when pointer is over a tag., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 72068052ff 19/63: Fixed default height, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 9ddf0e4f13 38/63: Rename screenshot, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode b865793671 53/63: Updated copyright notices., ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 95b5404997 35/63: Merge pull request #13 from tarsiiformes/cleanup, ELPA Syncer, 2021/12/27
- [elpa] externals/svg-tag-mode 861c68af89 40/63: Updated example 1 to new tags format., ELPA Syncer, 2021/12/27