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

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

[elpa] externals/org 132a9d304e 03/12: Use unknown DST instead of standa


From: ELPA Syncer
Subject: [elpa] externals/org 132a9d304e 03/12: Use unknown DST instead of standard time in timestamps
Date: Sun, 17 Jul 2022 04:57:49 -0400 (EDT)

branch: externals/org
commit 132a9d304e587cb88981eebaa7a5e46ad402ba1d
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Ihor Radchenko <yantar92@gmail.com>

    Use unknown DST instead of standard time in timestamps
    
    * lisp/ol.el (org-store-link): Prefer plain (encode-time ...)
    to (apply 'encode-time ...), for speed.
    * lisp/org-macs.el (org-parse-time-string): Return unknown DST,
    not standard time.
    * lisp/org.el (org-read-date-analyze): Return a timestamp with a DST
    flag of -1 (unknown) rather than nil (standard time).
    
    Max Nikulin:
    A larger patch "Improve Org usage of timestamps" was suggested in
    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54764#10
    
    Changes selected for this patch normalizes timestamp format:
    if it is a list than it should contain 9 elements to be compatible
    with Emacs-27 and Emacs-28 `encode-time' single argument, nil should not
    be used for DST field since it means standard time while actual value
    is unknown and should be guessed.
    
    Ignacio Casso reported a problem with agenda
    
https://list.orgmode.org/PAXPR06MB7760238F410CBE3203F78EE0C61E9@PAXPR06MB7760.eurprd06.prod.outlook.com
    due to Emacs commit dd0727e1ec1 changing Org code.  It was mostly reverted
    by 8ef37913d3 (bug#54731).  Code in the Org repository did not have
    the bug, but it safer to add protection against similar refactoring.
---
 lisp/ol.el       | 4 +---
 lisp/org-macs.el | 2 +-
 lisp/org.el      | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lisp/ol.el b/lisp/ol.el
index 3c7a6e8c42..5c3504f48f 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -1618,9 +1618,7 @@ non-nil."
          (setq link
                (format-time-string
                 (car org-time-stamp-formats)
-                (apply 'encode-time
-                       (list 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd)
-                             nil nil nil))))
+                (encode-time 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd))))
          (org-link-store-props :type "calendar" :date cd)))
 
        ((eq major-mode 'w3-mode)
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index e46e025d21..b6f1a7fdfc 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -1415,7 +1415,7 @@ This should be a lot faster than the `parse-time-string'."
        (string-to-number (match-string 4 s))
        (string-to-number (match-string 3 s))
        (string-to-number (match-string 2 s))
-       nil nil nil))
+       nil -1 nil))
 
 (defun org-matcher-time (s)
   "Interpret a time comparison value S as a floating point time.
diff --git a/lisp/org.el b/lisp/org.el
index dd33028c66..2ee2a136b1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13833,7 +13833,7 @@ user."
         (setq year (nth 5 org-defdecode))
         (setq org-read-date-analyze-forced-year t))))
     (setq org-read-date-analyze-futurep futurep)
-    (list second minute hour day month year)))
+    (list second minute hour day month year nil -1 nil)))
 
 (defvar parse-time-weekdays)
 (defun org-read-date-get-relative (s today default)



reply via email to

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