emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/org-contrib b6712e688b: lisp/org-expiry.el: Account for or


From: ELPA Syncer
Subject: [nongnu] elpa/org-contrib b6712e688b: lisp/org-expiry.el: Account for org-time-stamp-formats refactor
Date: Tue, 13 Dec 2022 04:00:25 -0500 (EST)

branch: elpa/org-contrib
commit b6712e688b3a54c54b80ab34525d4672ff2a8d7a
Author: Tom Gillespie <tgbugs@gmail.com>
Commit: Ihor Radchenko <yantar92@posteo.net>

    lisp/org-expiry.el: Account for org-time-stamp-formats refactor
    
    * lisp/org-expiry.el (org-expiry-insert-created)
    (org-expiry-insert-expiry): timestamp formats dropped delimiters so a
    slight modification is required following org commit
    e3a7c01874c9bb80e04ffa58c578619faf09e7f0, the change is made backward
    compatible by removing < and > from the old timestamp format
---
 lisp/org-expiry.el | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/lisp/org-expiry.el b/lisp/org-expiry.el
index b3596101fd..c3dad28a1e 100644
--- a/lisp/org-expiry.el
+++ b/lisp/org-expiry.el
@@ -301,12 +301,17 @@ update the date."
                     (current-time)))
       (setq d-hour (format-time-string "%H:%M" d-time))
       (setq timestr
-            (org-expiry-format-timestamp
-             ;; two C-u prefixes will call org-read-date
-            (if (equal arg '(16))
-                (org-read-date nil nil nil nil d-time d-hour)
-              (format-time-string (cdr org-time-stamp-formats)))
-             org-expiry-inactive-timestamps))
+           ;; two C-u prefixes will call org-read-date
+            (concat "<"
+                    (if (equal arg '(16))
+                        (org-read-date nil nil nil nil d-time d-hour)
+                      (format-time-string
+                       (replace-regexp-in-string "\\(^<\\|>$\\)" ""
+                       (cdr org-time-stamp-formats))))
+                    ">"))
+      ;; maybe transform to inactive timestamp
+      (if org-expiry-inactive-timestamps
+         (setq timestr (concat "[" (substring timestr 1 -1) "]")))
       (save-excursion
        (org-entry-put
         (point) org-expiry-created-property-name timestr)))))
@@ -321,11 +326,16 @@ and insert today's date."
     (setq d-time (if d (org-time-string-to-time d)
                   (current-time)))
     (setq d-hour (format-time-string "%H:%M" d-time))
-    (setq timestr (org-expiry-format-timestamp
-                   (if today
-                      (format-time-string (cdr org-time-stamp-formats))
-                    (org-read-date nil nil nil nil d-time d-hour))
-                   org-expiry-inactive-timestamps))
+    (setq timestr (concat "<"
+                          (if today
+                              (format-time-string
+                               (replace-regexp-in-string "\\(^<\\|>$\\)" ""
+                               (cdr org-time-stamp-formats)))
+                            (org-read-date nil nil nil nil d-time d-hour))
+                          ">"))
+    ;; maybe transform to inactive timestamp
+    (if org-expiry-inactive-timestamps
+       (setq timestr (concat "[" (substring timestr 1 -1) "]")))
 
     (save-excursion
       (org-entry-put



reply via email to

[Prev in Thread] Current Thread [Next in Thread]