[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/svg-tag-mode 07640c97a1 2/2: Merge pull request #24 fro
From: |
ELPA Syncer |
Subject: |
[elpa] externals/svg-tag-mode 07640c97a1 2/2: Merge pull request #24 from xav-ie/better-example |
Date: |
Fri, 8 Apr 2022 14:57:50 -0400 (EDT) |
branch: externals/svg-tag-mode
commit 07640c97a1dcc305010a384fffdaa7788c342da7
Merge: fee61c6a0b 7a71b4c83a
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: GitHub <noreply@github.com>
Merge pull request #24 from xav-ie/better-example
Add day name matching to example
---
examples/example-2.el | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/examples/example-2.el b/examples/example-2.el
index 223d1aa3d0..d1bff80bb2 100644
--- a/examples/example-2.el
+++ b/examples/example-2.el
@@ -19,6 +19,7 @@
(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\\}")
+(defconst day-time-re (format "\\(%s\\)? ?\\(%s\\)?" day-re time-re))
(defun svg-progress-percent (value)
(svg-image (svg-lib-concat
@@ -71,25 +72,25 @@
:crop-left t))))
- ;; Active date (without day name, with or without time)
+ ;; Active date (with or without day name, with or without time)
(,(format "\\(<%s>\\)" date-re) .
((lambda (tag)
(svg-tag-make tag :beg 1 :end -1 :margin 0))))
- (,(format "\\(<%s *\\)%s>" date-re time-re) .
+ (,(format "\\(<%s \\)%s>" date-re day-time-re) .
((lambda (tag)
(svg-tag-make tag :beg 1 :inverse nil :crop-right t :margin 0))))
- (,(format "<%s *\\(%s>\\)" date-re time-re) .
+ (,(format "<%s \\(%s>\\)" date-re day-time-re) .
((lambda (tag)
(svg-tag-make tag :end -1 :inverse t :crop-left t :margin 0))))
- ;; Inactive date (without day name, with or without time)
+ ;; Inactive date (with or without day name, with or without time)
(,(format "\\(\\[%s\\]\\)" date-re) .
((lambda (tag)
(svg-tag-make tag :beg 1 :end -1 :margin 0 :face 'org-date))))
- (,(format "\\(\\[%s *\\)%s\\]" date-re time-re) .
+ (,(format "\\(\\[%s \\)%s\\]" date-re day-time-re) .
((lambda (tag)
(svg-tag-make tag :beg 1 :inverse nil :crop-right t :margin 0
:face 'org-date))))
- (,(format "\\[%s *\\(%s\\]\\)" date-re time-re) .
+ (,(format "\\[%s \\(%s\\]\\)" date-re day-time-re) .
((lambda (tag)
(svg-tag-make tag :end -1 :inverse t :crop-left t :margin 0 :face
'org-date))))))
@@ -101,7 +102,11 @@
;; Progress: [1/3]
;; [42%]
;; Active date: <2021-12-24>
+;; <2021-12-24 Fri>
;; <2021-12-24 14:00>
+;; <2021-12-24 Fri 14:00>
;; Inactive date: [2021-12-24]
+;; [2021-12-24 Fri]
;; [2021-12-24 14:00]
+;; [2021-12-24 Fri 14:00]
;; Citation: [cite:@Knuth:1984]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/svg-tag-mode 07640c97a1 2/2: Merge pull request #24 from xav-ie/better-example,
ELPA Syncer <=