emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 5764640: Don’t assume CURRENT_TIME_LIST


From: Paul Eggert
Subject: [Emacs-diffs] master 5764640: Don’t assume CURRENT_TIME_LIST
Date: Sat, 9 Feb 2019 22:23:59 -0500 (EST)

branch: master
commit 57646401f1cb3e09169da5e768e74d4de9d19aed
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Don’t assume CURRENT_TIME_LIST
    
    * lisp/gnus/gnus-delay.el (gnus-delay-send-queue):
    * lisp/gnus/nnmail.el (nnmail-activate):
    * lisp/mh-e/mh-alias.el (mh-alias-tstamp):
    * lisp/net/newst-backend.el (newsticker--cache-item-compare-by-time):
    Use time-less-p instead of assuming timestamp format.
---
 lisp/gnus/gnus-delay.el   |  4 +---
 lisp/gnus/nnmail.el       |  7 ++-----
 lisp/mh-e/mh-alias.el     |  4 +---
 lisp/net/newst-backend.el | 18 ++----------------
 4 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/lisp/gnus/gnus-delay.el b/lisp/gnus/gnus-delay.el
index b15187b..d1ff7e6 100644
--- a/lisp/gnus/gnus-delay.el
+++ b/lisp/gnus/gnus-delay.el
@@ -166,9 +166,7 @@ DELAY is a string, giving the length of the time.  Possible 
values are:
                (setq deadline (nnheader-header-value))
                (setq deadline (apply 'encode-time
                                      (parse-time-string deadline)))
-               (setq deadline (time-since deadline))
-               (when (and (>= (nth 0 deadline) 0)
-                          (>= (nth 1 deadline) 0))
+               (unless (time-less-p nil deadline)
                  (message "Sending delayed article %d" article)
                  (gnus-draft-send article group)
                  (message "Sending delayed article %d...done" article)))
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index 2173e84..c2e84c4 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1543,11 +1543,8 @@ See the documentation for the variable 
`nnmail-split-fancy' for details."
                                               (format "%s-active-timestamp"
                                                       backend)))
                              (error 'none))))
-                    (not (consp timestamp))
-                    (equal timestamp '(0 0))
-                    (> (nth 0 file-time) (nth 0 timestamp))
-                    (and (= (nth 0 file-time) (nth 0 timestamp))
-                         (> (nth 1 file-time) (nth 1 timestamp))))))
+                    (eq timestamp 'none)
+                    (time-less-p timestamp file-time))))
        (save-excursion
          (or (eq timestamp 'none)
              (set (intern (format "%s-active-timestamp" backend))
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index 3f895f4..49f5547 100644
--- a/lisp/mh-e/mh-alias.el
+++ b/lisp/mh-e/mh-alias.el
@@ -80,9 +80,7 @@ If ARG is non-nil, set timestamp with the current time."
                        (when (and file (file-exists-p file))
                          (setq stamp (file-attribute-modification-time
                                      (file-attributes file)))
-                         (or (> (car stamp) (car mh-alias-tstamp))
-                             (and (= (car stamp) (car mh-alias-tstamp))
-                                  (> (cadr stamp) (cadr mh-alias-tstamp)))))))
+                        (time-less-p mh-alias-tstamp stamp))))
                     (mh-alias-filenames t)))))))
 
 (defun mh-alias-filenames (arg)
diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el
index bb7b7bc..61c7437 100644
--- a/lisp/net/newst-backend.el
+++ b/lisp/net/newst-backend.el
@@ -2171,22 +2171,8 @@ well."
                  (throw 'result nil))
                 ((eq age2 'obsolete)
                  (throw 'result t)))))
-    (let* ((time1 (newsticker--time item1))
-           (time2 (newsticker--time item2)))
-      (cond ((< (nth 0 time1) (nth 0 time2))
-             nil)
-            ((> (nth 0 time1) (nth 0 time2))
-             t)
-            ((< (nth 1 time1) (nth 1 time2))
-             nil)
-            ((> (nth 1 time1) (nth 1 time2))
-             t)
-            ((< (or (nth 2 time1) 0) (or (nth 2 time2) 0))
-             nil)
-            ((> (or (nth 2 time1) 0) (or (nth 2 time2) 0))
-             t)
-            (t
-             nil)))))
+    (time-less-p (newsticker--time item2)
+                (newsticker--time item1))))
 
 (defun newsticker--cache-item-compare-by-title (item1 item2)
   "Compare ITEM1 and ITEM2 by comparing their titles."



reply via email to

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