]> git.eshelyaron.com Git - emacs.git/commitdiff
Use list-form timestamps in .nnmh-articles
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Aug 2022 07:38:34 +0000 (00:38 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Aug 2022 08:17:18 +0000 (01:17 -0700)
* lisp/gnus/nnmh.el (nnmh-update-gnus-unreads): Store list form
timestamps into .nnmh-articles, even if current-time-list is nil.
That way, older Emacs versions can read them.

lisp/gnus/nnmh.el

index 312a4a2a828f6a808715cfa863d84a7a7ebb2a39..3902af7d2f6ffee0257fcfca091522bf6006a8b5 100644 (file)
@@ -547,14 +547,17 @@ as unread by Gnus.")
          (push (car art) new))))
     ;; Go through all the new articles and add them, and their
     ;; time-stamps, to the list.
+    ;; Use list format for timestamps, so Emacs <27 can read .nnmh-articles.
     (setq articles
          (nconc articles
                 (mapcar
                  (lambda (art)
                    (cons art
-                         (file-attribute-modification-time
-                          (file-attributes
-                           (concat dir (int-to-string art))))))
+                         (when-let ((modtime
+                                     (file-attribute-modification-time
+                                      (file-attributes
+                                       (concat dir (int-to-string art))))))
+                           (time-convert modtime 'list))))
                  new)))
     ;; Make Gnus mark all new articles as unread.
     (when new