emacs-diffs
[Top][All Lists]
Advanced

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

master 0bfc1d4e7ee 3/3: Merge remote-tracking branch 'savannah/master' i


From: Po Lu
Subject: master 0bfc1d4e7ee 3/3: Merge remote-tracking branch 'savannah/master' into master-android-1
Date: Wed, 10 Apr 2024 10:37:10 -0400 (EDT)

branch: master
commit 0bfc1d4e7eedb8496a293cf51c2b731a43c2010e
Merge: 049bdfdaec4 33516970808
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Merge remote-tracking branch 'savannah/master' into master-android-1
---
 lisp/calendar/time-date.el            | 7 +++++--
 lisp/emacs-lisp/cl-macs.el            | 1 +
 test/lisp/calendar/time-date-tests.el | 5 ++++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index e96e2e7e2db..eca80f1e8b6 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -344,8 +344,11 @@ right of \"%x\", trailing zero units are not output."
              string)
         (cond
          ((string-equal spec "z")
-          (setq chop-leading (and leading-zeropos
-                                  (min leading-zeropos (match-beginning 0)))))
+          (setq chop-leading
+                (if leading-zeropos
+                    (min leading-zeropos (match-beginning 0))
+                  ;; The entire spec is zero, get past "%z" to last 0.
+                  (+ 2 (match-beginning 0)))))
          ((string-equal spec "x")
           (setq chop-trailing t))
          (t
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index a84ef4a34b2..1350e474d6a 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -3479,6 +3479,7 @@ Of course, we really can't know that for sure, so it's 
just a heuristic."
 
 ;;;###autoload
 (define-inline cl-typep (val type)
+  "Return t if VAL is of type TYPE, nil otherwise."
   (inline-letevals (val)
     (pcase (inline-const-val type)
       ((and `(,name . ,args) (guard (get name 'cl-deftype-handler)))
diff --git a/test/lisp/calendar/time-date-tests.el 
b/test/lisp/calendar/time-date-tests.el
index 01f9f8a5108..6512dd0bd07 100644
--- a/test/lisp/calendar/time-date-tests.el
+++ b/test/lisp/calendar/time-date-tests.el
@@ -100,7 +100,10 @@
   (should (equal (format-seconds "%hh %z%x%mm %ss" (* 60 2)) "2m"))
   (should (equal (format-seconds "%hh %z%mm %ss" (* 60 2)) "2m 0s"))
   (should (equal (format-seconds "%hh %x%mm %ss" (* 60 2)) "0h 2m"))
-  (should (equal (format-seconds "%hh %x%mm %ss" 0) "0h 0m 0s")))
+  (should (equal (format-seconds "%hh %x%mm %ss" 0) "0h 0m 0s"))
+  ;; Bug#70322
+  (should (equal (format-seconds "%y %z%d %h %m %s %%" 9999999) "115 17 46 39 
%"))
+  (should (equal (format-seconds "%Y, %D, %H, %M, %z%S" 0) "0 seconds")))
 
 (ert-deftest test-ordinal ()
   (should (equal (date-ordinal-to-time 2008 271)



reply via email to

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