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

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

[elpa] externals/org 57d64cf78c: Date/time prompt: Allow input of relati


From: ELPA Syncer
Subject: [elpa] externals/org 57d64cf78c: Date/time prompt: Allow input of relative time in hours (e.g. +1h)
Date: Thu, 9 Jun 2022 09:57:54 -0400 (EDT)

branch: externals/org
commit 57d64cf78c84d7910ce7e54c1a0ae242ce75e0ed
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    Date/time prompt: Allow input of relative time in hours (e.g. +1h)
    
    * lisp/org.el (org-read-date-analyze): Match relative hour specifier.
    
    Fixes 
https://orgmode.org/list/C9A76EFA-1D76-4C5D-941D-AFA288A64CD0@icloud.com
---
 lisp/org.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1d9246e4ec..ac94fb6142 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13684,10 +13684,14 @@ user."
       (unless deltadef
        (let ((now (decode-time)))
          (setq day (nth 3 now) month (nth 4 now) year (nth 5 now))))
-      (cond ((member deltaw '("d" "")) (setq day (+ day deltan)))
-           ((equal deltaw "w") (setq day (+ day (* 7 deltan))))
-           ((equal deltaw "m") (setq month (+ month deltan)))
-           ((equal deltaw "y") (setq year (+ year deltan)))))
+      (cond ((member deltaw '("h" ""))
+             (when (boundp 'org-time-was-given)
+               (setq org-time-was-given t))
+             (setq hour (+ hour deltan)))
+            ((member deltaw '("d" "")) (setq day (+ day deltan)))
+            ((equal deltaw "w") (setq day (+ day (* 7 deltan))))
+            ((equal deltaw "m") (setq month (+ month deltan)))
+            ((equal deltaw "y") (setq year (+ year deltan)))))
      ((and wday (not (nth 3 tl)))
       ;; Weekday was given, but no day, so pick that day in the week
       ;; on or after the derived date.



reply via email to

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