emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 743cc86: Have time-add etc. respect CURRENT_TIME_LI


From: Paul Eggert
Subject: [Emacs-diffs] master 743cc86: Have time-add etc. respect CURRENT_TIME_LIST too
Date: Sat, 17 Aug 2019 05:21:58 -0400 (EDT)

branch: master
commit 743cc86a053d536a4bfe8d519840c0b4cc2ce02e
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Have time-add etc. respect CURRENT_TIME_LIST too
    
    * src/timefns.c (time_arith) [!CURRENT_TIME_LIST]:
    Don’t generate a list, since CURRENT_TIME_LIST is false.
---
 src/timefns.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/timefns.c b/src/timefns.c
index 16c39c8..bf49843 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -1090,11 +1090,14 @@ time_arith (Lisp_Object a, Lisp_Object b, bool subtract)
     }
 
   /* Return an integer if the timestamp resolution is 1,
-     otherwise the (TICKS . HZ) form if either argument is that way,
-     otherwise the (HI LO US PS) form for backward compatibility.  */
+     otherwise the (TICKS . HZ) form if !CURRENT_TIME_LIST or if
+     either input form supports timestamps that cannot be expressed
+     exactly in (HI LO US PS) form, otherwise the (HI LO US PS) form
+     for backward compatibility.  */
   return (EQ (hz, make_fixnum (1))
          ? ticks
-         : timeform_sub_ps_p (aform) || timeform_sub_ps_p (bform)
+         : (!CURRENT_TIME_LIST
+            || timeform_sub_ps_p (aform) || timeform_sub_ps_p (bform))
          ? Fcons (ticks, hz)
          : ticks_hz_list4 (ticks, hz));
 }



reply via email to

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