]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer nil to (current-time) when either works
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 21 Oct 2017 02:40:09 +0000 (19:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 21 Oct 2017 02:42:23 +0000 (19:42 -0700)
* doc/misc/gnus.texi (Category Syntax):
* lisp/allout-widgets.el (allout-widgets-post-command-business):
* lisp/cedet/ede/detect.el (ede-detect-qtest):
* lisp/cedet/pulse.el (pulse-momentary-highlight-overlay)
(pulse-tick):
* lisp/cedet/semantic.el (bovinate):
* lisp/cedet/semantic/analyze.el:
(semantic-analyze-current-symbol-default, semantic-adebug-analyze):
* lisp/cedet/semantic/analyze/refs.el (semantic-analyze-current-tag):
* lisp/cedet/semantic/lex.el (semantic-lex-test):
* lisp/cedet/semantic/symref/filter.el:
(semantic-symref-test-count-hits-in-tag):
* lisp/cedet/srecode/dictionary.el (srecode-adebug-dictionary):
* lisp/cedet/srecode/map.el (srecode-adebug-maps):
* lisp/desktop.el (desktop-create-buffer):
* lisp/emacs-lisp/benchmark.el (benchmark-elapse):
* lisp/emacs-lisp/elp.el (elp--make-wrapper):
* lisp/epa.el (epa--show-key):
* lisp/erc/erc.el (erc-lurker-cleanup, erc-lurker-p):
* lisp/gnus/gnus-agent.el (gnus-agent-fetch-articles)
(gnus-agent-expire-group-1, gnus-agent-store-article):
* lisp/gnus/gnus-art.el (article-lapsed-string):
* lisp/gnus/gnus-cloud.el (gnus-cloud-update-newsrc-data)
(gnus-cloud-collect-full-newsrc):
* lisp/gnus/gnus-group.el (gnus-group-timestamp-delta):
* lisp/gnus/gnus-html.el (gnus-html-cache-expired):
* lisp/gnus/gnus-score.el (gnus-score-load-file)
(gnus-decay-scores):
* lisp/gnus/nndiary.el (nndiary-expired-article-p):
* lisp/gnus/nnmail.el (nnmail-expired-article-p):
* lisp/gnus/nnmaildir.el (nnmaildir--scan):
* lisp/gnus/score-mode.el (gnus-score-edit-insert-date):
* lisp/image/gravatar.el (gravatar-cache-expired):
* lisp/net/newst-backend.el (newsticker--image-get)
(newsticker--cache-mark-expired):
* lisp/nxml/rng-maint.el (rng-time-function):
* lisp/org/org-agenda.el (org-agenda-to-appt):
* lisp/org/org-clock.el (org-clock-resolve-clock)
(org-clock-resolve, org-resolve-clocks-if-idle):
* lisp/org/org-colview.el (org-columns-edit-value, org-columns)
(org-columns-compute-all, org-agenda-columns):
* lisp/org/org-element.el (org-element--cache-interrupt-p)
(org-element--cache-sync):
* lisp/org/org-habit.el (org-habit-get-faces)
(org-habit-insert-consistency-graphs):
* lisp/org/org-indent.el (org-indent-add-properties):
* lisp/org/org-timer.el (org-timer-start)
(org-timer-pause-or-continue, org-timer-seconds)
(org-timer-show-remaining-time, org-timer-set-timer):
* lisp/org/org.el (org-babel-load-file, org-current-time)
(org-today, org-auto-repeat-maybe, org-read-date-analyze)
(org-small-year-to-year, org-goto-calendar):
* lisp/org/ox.el (org-export-insert-default-template):
* lisp/time.el (emacs-uptime):
* lisp/type-break.el (type-break-mode, type-break)
(type-break-time-warning-schedule, type-break-check):
* lisp/url/url-cache.el (url-cache-expired):
* lisp/url/url.el (url-retrieve-synchronously):
* test/lisp/char-fold-tests.el (char-fold--speed-test):
* test/manual/cedet/semantic-ia-utest.el:
(semantic-symref-test-count-hits-in-tag):
* test/manual/cedet/semantic-tests.el (semantic-idle-pnf-test)
(semantic-lex-test-full-depth):
Use nil instead of (current-time) where either will do, as nil is
a bit more efficient and should have less timing error.

45 files changed:
doc/misc/gnus.texi
lisp/allout-widgets.el
lisp/cedet/ede/detect.el
lisp/cedet/pulse.el
lisp/cedet/semantic.el
lisp/cedet/semantic/analyze.el
lisp/cedet/semantic/analyze/refs.el
lisp/cedet/semantic/lex.el
lisp/cedet/semantic/symref/filter.el
lisp/cedet/srecode/dictionary.el
lisp/cedet/srecode/map.el
lisp/desktop.el
lisp/emacs-lisp/benchmark.el
lisp/emacs-lisp/elp.el
lisp/epa.el
lisp/erc/erc.el
lisp/gnus/gnus-agent.el
lisp/gnus/gnus-art.el
lisp/gnus/gnus-cloud.el
lisp/gnus/gnus-group.el
lisp/gnus/gnus-html.el
lisp/gnus/gnus-score.el
lisp/gnus/nndiary.el
lisp/gnus/nnmail.el
lisp/gnus/nnmaildir.el
lisp/gnus/score-mode.el
lisp/image/gravatar.el
lisp/net/newst-backend.el
lisp/nxml/rng-maint.el
lisp/org/org-agenda.el
lisp/org/org-clock.el
lisp/org/org-colview.el
lisp/org/org-element.el
lisp/org/org-habit.el
lisp/org/org-indent.el
lisp/org/org-timer.el
lisp/org/org.el
lisp/org/ox.el
lisp/time.el
lisp/type-break.el
lisp/url/url-cache.el
lisp/url/url.el
test/lisp/char-fold-tests.el
test/manual/cedet/semantic-ia-utest.el
test/manual/cedet/semantic-tests.el

index 15c6230ad0bb2bd30441010c22988da7bcdab2fb..33078d711a27ac3f4dbc803d380c52a5f9942966 100644 (file)
@@ -18492,7 +18492,7 @@ something along the lines of the following:
 (defun my-article-old-p ()
   "Say whether an article is old."
   (< (time-to-days (date-to-time (mail-header-date gnus-headers)))
-     (- (time-to-days (current-time)) gnus-agent-expire-days)))
+     (- (time-to-days nil) gnus-agent-expire-days)))
 @end lisp
 
 with the predicate then defined as:
index 4338181c3401e8e2ef2e199685da7f3df400de6c..9fa927ddcb30c0b5f680e8d5a5bbf147028306df 100644 (file)
@@ -768,8 +768,7 @@ Optional RECURSING is for internal use, to limit recursion."
 
             (if allout-widgets-time-decoration-activity
                 (setq allout-widgets-last-decoration-timing
-                      (list (allout-elapsed-time-seconds (current-time)
-                                                         start-time)
+                      (list (allout-elapsed-time-seconds nil start-time)
                             allout-widgets-changes-record)))
 
             (setq allout-widgets-changes-record nil)
index 6240d4659825c121d7d94c8420165f01caa517f3..25426dfeba656f828572dd866bfb61b221373bc1 100644 (file)
@@ -195,11 +195,10 @@ Return a cons cell:
   "Run a quick test for autodetecting on BUFFER."
   (interactive)
   (let ((start (current-time))
-       (ans (ede-detect-directory-for-project default-directory))
-       (end (current-time)))
+       (ans (ede-detect-directory-for-project default-directory)))
     (if ans
        (message "Project found in %d sec @ %s of type %s"
-                (float-time (time-subtract end start))
+                (float-time (time-subtract nil start))
                 (car ans)
                 (eieio-object-name-string (cdr ans)))
       (message "No Project found.") )))
index 51df5e9ffe4fcbcac3d496d001476f509fdd464b..3554ee242b869f2e4e16295cefe486675756364e 100644 (file)
@@ -196,11 +196,11 @@ Optional argument FACE specifies the face to do the highlighting."
       (pulse-reset-face face)
       (setq pulse-momentary-timer
             (run-with-timer 0 pulse-delay #'pulse-tick
-                            (time-add (current-time)
+                            (time-add nil
                                       (* pulse-delay pulse-iterations)))))))
 
 (defun pulse-tick (stop-time)
-  (if (time-less-p (current-time) stop-time)
+  (if (time-less-p nil stop-time)
       (pulse-lighten-highlight)
     (pulse-momentary-unhighlight)))
 
index 682ac89978f95212f4d9a67c824fee8aaee4aed9..cae6e049f442e2f79e969b48de62050aff953391 100644 (file)
@@ -389,10 +389,9 @@ the output buffer."
   (if clear (semantic-clear-toplevel-cache))
   (if (eq clear '-) (setq clear -1))
   (let* ((start (current-time))
-        (out (semantic-fetch-tags))
-        (end (current-time)))
+        (out (semantic-fetch-tags)))
     (message "Retrieving tags took %.2f seconds."
-            (semantic-elapsed-time start end))
+            (semantic-elapsed-time start nil))
     (when (or (null clear) (not (listp clear))
              (and (numberp clear) (< 0 clear)))
       (pop-to-buffer "*Parser Output*")
index 517e1be8ecabd8527e5b373fb6030872880138c4..b528487887aae1a1e06ad04c0505a91ff3594125 100644 (file)
@@ -440,12 +440,11 @@ to provide a large number of non-cached analysis for filtering symbols."
 (defun semantic-analyze-current-symbol-default (analyzehookfcn position)
   "Call ANALYZEHOOKFCN on the analyzed symbol at POSITION."
   (let* ((semantic-analyze-error-stack nil)
-        (LLstart (current-time))
+        ;; (LLstart (current-time))
         (prefixandbounds (semantic-ctxt-current-symbol-and-bounds (or position (point))))
         (prefix (car prefixandbounds))
         (bounds (nth 2 prefixandbounds))
         (scope (semantic-calculate-scope position))
-        (end nil)
         )
         ;; Only do work if we have bounds (meaning a prefix to complete)
     (when bounds
@@ -464,15 +463,13 @@ to provide a large number of non-cached analysis for filtering symbols."
                          prefix scope 'prefixtypes))
          (error (semantic-analyze-push-error err))))
 
-      (setq end (current-time))
-      ;;(message "Analysis took %.2f sec" (semantic-elapsed-time LLstart end))
+      ;;(message "Analysis took %.2f sec" (semantic-elapsed-time LLstart nil))
 
       )
     (when prefix
       (prog1
          (funcall analyzehookfcn (car bounds) (cdr bounds) prefix)
-       ;;(setq end (current-time))
-       ;;(message "hookfcn took %.5f sec" (semantic-elapsed-time LLstart end))
+       ;;(message "hookfcn took %.5f sec" (semantic-elapsed-time LLstart nil))
        )
 
        )))
@@ -723,12 +720,11 @@ Optional argument CTXT is the context to show."
   (interactive)
   (require 'data-debug)
   (let ((start (current-time))
-       (ctxt (or ctxt (semantic-analyze-current-context)))
-       (end (current-time)))
+       (ctxt (or ctxt (semantic-analyze-current-context))))
     (if (not ctxt)
        (message "No Analyzer Results")
       (message "Analysis  took %.2f seconds."
-              (semantic-elapsed-time start end))
+              (semantic-elapsed-time start nil))
       (semantic-analyze-pulse ctxt)
       (if ctxt
          (progn
index 55fcd8304335ded059ddbcbdbaff1e31f8956c2f..e7a4424d6ff3a6a339ea2b0cbf53f2f69118d8f0 100644 (file)
@@ -317,9 +317,8 @@ Only works for tags in the global namespace."
   (let* ((tag (semantic-current-tag))
         (start (current-time))
         (sac (semantic-analyze-tag-references tag))
-        (end (current-time))
         )
-    (message "Analysis took %.2f seconds." (semantic-elapsed-time start end))
+    (message "Analysis took %.2f seconds." (semantic-elapsed-time start nil))
     (if sac
        (progn
          (require 'eieio-datadebug)
index eec6e6762f304c3c1c667b464452e59b6dee6d5d..835888db2ad03a41aa5f59b38e62cd203ecf165f 100644 (file)
@@ -657,10 +657,9 @@ If universal argument ARG, then try the whole buffer."
   (let* ((start (current-time))
         (result (semantic-lex
                  (if arg (point-min) (point))
-                 (point-max)))
-        (end (current-time)))
+                 (point-max))))
     (message "Elapsed Time: %.2f seconds."
-            (semantic-elapsed-time start end))
+            (semantic-elapsed-time start nil))
     (pop-to-buffer "*Lexer Output*")
     (require 'pp)
     (erase-buffer)
@@ -810,7 +809,7 @@ analyzer which might mistake a number for as a symbol."
                     tmp-start (car semantic-lex-token-stream)))
           (setq tmp-start semantic-lex-end-point)
            (goto-char semantic-lex-end-point)
-          ;;(when (> (semantic-elapsed-time starttime (current-time))
+          ;;(when (> (semantic-elapsed-time starttime nil)
           ;;       semantic-lex-timeout)
           ;;  (error "Timeout during lex at char %d" (point)))
           (semantic-throw-on-input 'lex)
index 53be5e0defbf344ae80e67239c24e086ab815c58..d5766af9b6e1db520106db214d23facc1e7e64fc 100644 (file)
@@ -103,7 +103,7 @@ tag that contains point, and return that."
       (when (called-interactively-p 'interactive)
        (message "Found %d occurrences of %s in %.2f seconds"
                 Lcount (semantic-tag-name target)
-                (semantic-elapsed-time start (current-time))))
+                (semantic-elapsed-time start nil)))
       Lcount)))
 
 (defun semantic-symref-rename-local-variable ()
index 4507581621d17daaefe78b90ededa659787a76a9..6c8fd655d7b9ef77eb851bbe56972525ee4ef5c7 100644 (file)
@@ -612,10 +612,9 @@ STATE is the current compiler state."
                          (srecode-get-mode-table modesym))
                   (error "No table found for mode %S" modesym)))
         (dict (srecode-create-dictionary (current-buffer)))
-        (end (current-time))
         )
     (message "Creating a dictionary took %.2f seconds."
-            (semantic-elapsed-time start end))
+            (semantic-elapsed-time start nil))
     (data-debug-new-buffer "*SRECODE ADEBUG*")
     (data-debug-insert-object-slots dict "*")))
 
index 10541f61a9ecad03acdb86956438281c75165738..5b5d1fdd47d6e4ae926f8d8ffdd357b01449f42f 100644 (file)
@@ -224,10 +224,9 @@ Optional argument RESET forces a reset of the current map."
   (require 'data-debug)
   (let ((start (current-time))
        (p (srecode-get-maps t)) ;; Time the reset.
-       (end (current-time))
        )
     (message "Updating the map took %.2f seconds."
-            (semantic-elapsed-time start end))
+            (semantic-elapsed-time start nil))
     (data-debug-new-buffer "*SRECODE ADEBUG*")
     (data-debug-insert-stuff-list p "*")))
 
index 73228ce040b809f622348faae332b283fd4d0421..66e2aef9798b1f4e42b98919c559fb4a9009d888 100644 (file)
@@ -1554,8 +1554,7 @@ and try to load that."
           (setq buffer-display-time
                 (if buffer-display-time
                     (time-add buffer-display-time
-                              (time-subtract (current-time)
-                                             desktop-file-modtime))
+                              (time-subtract nil desktop-file-modtime))
                   (current-time)))
          (unless (< desktop-file-version 208) ; Don't misinterpret any old custom args
            (dolist (record compacted-vars)
index 445e78b427c62802e7300a72e287573569b42bff..02db21a7e533a46a5456622cd7cf6ffbf3e6fcbb 100644 (file)
 (defmacro benchmark-elapse (&rest forms)
   "Return the time in seconds elapsed for execution of FORMS."
   (declare (indent 0) (debug t))
-  (let ((t1 (make-symbol "t1"))
-       (t2 (make-symbol "t2")))
-    `(let (,t1 ,t2)
+  (let ((t1 (make-symbol "t1")))
+    `(let (,t1)
        (setq ,t1 (current-time))
        ,@forms
-       (setq ,t2 (current-time))
-       (float-time (time-subtract ,t2 ,t1)))))
+       (float-time (time-subtract nil ,t1)))))
 
 ;;;###autoload
 (defmacro benchmark-run (&optional repetitions &rest forms)
index 2be9c9da865ff78ec68663e3c3429a1bbab30a2c..905718dad68ffa3b695d37683c598375784b920e 100644 (file)
@@ -382,14 +382,13 @@ original definition, use \\[elp-restore-function] or \\[elp-restore-all]."
           ;; and return the results.
           (setq result (apply func args))
         ;; we are recording times
-        (let (enter-time exit-time)
+        (let (enter-time)
           ;; increment the call-counter
           (cl-incf (aref info 0))
          (setq enter-time (current-time)
-               result (apply func args)
-                exit-time (current-time))
+               result (apply func args))
           ;; calculate total time in function
-          (cl-incf (aref info 1) (elp-elapsed-time enter-time exit-time))
+          (cl-incf (aref info 1) (elp-elapsed-time enter-time nil))
           ))
       ;; turn off recording if this is the master function
       (if (and elp-master
index 6e908e1aa3b29e92a4aa5d5447edfeb6c24a6bee..aca9aaa7d22350a20b911ab59743a4acbfe589f8 100644 (file)
@@ -561,7 +561,7 @@ If SECRET is non-nil, list secret keys instead of public keys."
                                      (epg-sub-key-creation-time (car pointer)))
                (error "????-??-??"))
              (if (epg-sub-key-expiration-time (car pointer))
-                 (format (if (time-less-p (current-time)
+                 (format (if (time-less-p nil
                                           (epg-sub-key-expiration-time
                                            (car pointer)))
                              "\n\tExpires: %s"
index 0e56b732d81f4a818a4acbf5da26fe690c8d4a35..fdc4a647777607fbde5b2ec7dba3ac805429720d 100644 (file)
@@ -2548,9 +2548,7 @@ consumption for long-lived IRC or Emacs sessions."
      (maphash
       (lambda (nick last-PRIVMSG-time)
         (when
-            (> (float-time (time-subtract
-                            (current-time)
-                            last-PRIVMSG-time))
+            (> (float-time (time-subtract nil last-PRIVMSG-time))
                erc-lurker-threshold-time)
           (remhash nick hash)))
       hash)
@@ -2617,7 +2615,7 @@ server within `erc-lurker-threshold-time'.  See also
                    (gethash server erc-lurker-state (make-hash-table)))))
     (or (null last-PRIVMSG-time)
         (> (float-time
-            (time-subtract (current-time) last-PRIVMSG-time))
+            (time-subtract nil last-PRIVMSG-time))
            erc-lurker-threshold-time))))
 
 (defcustom erc-common-server-suffixes
index daf578180f26f0b5d1505b2dba3ee3f62fc6514b..6e7cc57a4cc7eca7ce036a27b370498de9f15118 100644 (file)
@@ -1513,7 +1513,7 @@ downloaded into the agent."
         (let* ((fetched-articles (list nil))
                (tail-fetched-articles fetched-articles)
                (dir (gnus-agent-group-pathname group))
-               (date (time-to-days (current-time)))
+               (date (time-to-days nil))
                (case-fold-search t)
                pos crosses
               (file-name-coding-system nnmail-pathname-coding-system))
@@ -3089,7 +3089,7 @@ FORCE is equivalent to setting the expiration predicates to true."
              (nov-entries-deleted 0)
              (info (gnus-get-info group))
              (alist gnus-agent-article-alist)
-             (day (- (time-to-days (current-time))
+             (day (- (time-to-days nil)
                      (gnus-agent-find-parameter group 'agent-days-until-old)))
              (specials (if (and alist
                                 (not force))
@@ -3824,7 +3824,7 @@ has been fetched."
       ;; be expired later.
       (gnus-agent-load-alist group)
       (gnus-agent-save-alist group (list article)
-                            (time-to-days (current-time))))))
+                            (time-to-days nil)))))
 
 (defun gnus-agent-regenerate-group (group &optional reread)
   "Regenerate GROUP.
index c130dc1b6c615dc949ca0a93befc2cc0a90ede46..97aa878ab63aacc6c060d962acaced797c950a01 100644 (file)
@@ -3628,8 +3628,7 @@ possible values."
 (defun article-lapsed-string (time &optional max-segments)
   ;; If the date is seriously mangled, the timezone functions are
   ;; liable to bug out, so we ignore all errors.
-  (let* ((now (current-time))
-        (real-time (time-subtract now time))
+  (let* ((real-time (time-subtract nil time))
         (real-sec (and real-time
                        (+ (* (float (car real-time)) 65536)
                           (cadr real-time))))
index 5ea2d691f1588c2969ff4759926f137e058e45cc..c57576cf3c721d36a022b7213b829df8cbb9ee3e 100644 (file)
@@ -219,7 +219,7 @@ easy interactive way to set this from the Server buffer."
 Use old data if FORCE-OLDER is not nil."
   (let* ((contents (plist-get elem :contents))
          (date (or (plist-get elem :timestamp) "0"))
-         (now (gnus-cloud-timestamp (current-time)))
+         (now (gnus-cloud-timestamp nil))
          (newer (string-lessp date now))
          (group-info (gnus-get-info group)))
     (if (and contents
@@ -486,7 +486,7 @@ Otherwise, returns the Gnus Cloud data chunks."
              (gnus-method-to-server
               (gnus-find-method-for-group (gnus-info-group info))))
 
-        (push `(:type :newsrc-data :name ,(gnus-info-group info) :contents ,info :timestamp ,(gnus-cloud-timestamp (current-time)))
+        (push `(:type :newsrc-data :name ,(gnus-info-group info) :contents ,info :timestamp ,(gnus-cloud-timestamp nil))
               infos)))
     infos))
 
index 985efe6272f98d41a7e65b3c0408f5f9d01134c7..1174f90e1adfd7f2152f0f43d649d558024df30f 100644 (file)
@@ -4560,7 +4560,7 @@ or `gnus-group-catchup-group-hook'."
   "Return the offset in seconds from the timestamp for GROUP to the current time, as a floating point number."
   (let* ((time (or (gnus-group-timestamp group)
                   (list 0 0)))
-        (delta (time-subtract (current-time) time)))
+        (delta (time-subtract nil time)))
     (+ (* (nth 0 delta) 65536.0)
        (nth 1 delta))))
 
index 6d529558f73761d3dfea3d5541f99a980500bc02..7fa36359f679f1da9973282706d9f59f90d5142d 100644 (file)
@@ -99,11 +99,7 @@ fit these criteria."
          (not (file-exists-p (url-cache-create-filename url))))
         (t (let ((cache-time (url-is-cached url)))
              (if cache-time
-                 (time-less-p
-                  (time-add
-                   cache-time
-                   ttl)
-                  (current-time))
+                 (time-less-p (time-add cache-time ttl) nil)
                t)))))
 
 ;;;###autoload
index 976ac9f7f3534c75f8e0b5768663e6ebb03f3cb6..bc11aa528faeffbec1f548fb5a307d948b7ef3e6 100644 (file)
@@ -1238,7 +1238,7 @@ If FORMAT, also format the current score file."
                 (or (not decay)
                     (gnus-decay-scores alist decay)))
        (gnus-score-set 'touched '(t) alist)
-       (gnus-score-set 'decay (list (time-to-days (current-time))) alist))
+       (gnus-score-set 'decay (list (time-to-days nil)) alist))
       ;; We do not respect eval and files atoms from global score
       ;; files.
       (when (and files (not global))
@@ -3062,7 +3062,7 @@ If ADAPT, return the home adaptive file instead."
 
 (defun gnus-decay-scores (alist day)
   "Decay non-permanent scores in ALIST."
-  (let ((times (- (time-to-days (current-time)) day))
+  (let ((times (- (time-to-days nil) day))
        kill entry updated score n)
     (unless (zerop times)              ;Done decays today already?
       (while (setq entry (pop alist))
index 2589fa80893724bb99fe8334daa8ff55eed7c8a6..ca4dca4189d17e7b1a905dbcf935b1c30b1e2d74 100644 (file)
@@ -1532,7 +1532,7 @@ all.  This may very well take some time.")
          ;; past. A permanent schedule never expires.
          (and sched
               (setq sched (nndiary-last-occurrence sched))
-              (time-less-p sched (current-time))))
+              (time-less-p sched nil)))
       ;; else
       (nnheader-report 'nndiary "Could not read file %s" file)
       nil)
index db5415cf9f71b665b7f9a2d43bc3823a96f6e004..ad58d2920827b0a0cf32c81ff8452e5770ab40fc 100644 (file)
@@ -1883,7 +1883,7 @@ If TIME is nil, then return the cutoff time for oldness instead."
             (setq days (days-to-time days))
             ;; Compare the time with the current time.
             (if (null time)
-                (time-subtract (current-time) days)
+                (time-subtract nil days)
               (ignore-errors (time-less-p days (time-since time)))))))))
 
 (declare-function gnus-group-mark-article-read "gnus-group" (group article))
index 272240f5a9f1a919370de2232bd4cd520636705c..708a3426af1a768802826d8497856581e7e4cf91 100644 (file)
@@ -814,7 +814,7 @@ This variable is set by `nnmaildir-request-article'.")
        (when (or isnew nattr)
          (dolist (file  (funcall ls ndir nil "\\`[^.]" 'nosort))
            (setq x (concat ndir file))
-           (and (time-less-p (nth 5 (file-attributes x)) (current-time))
+           (and (time-less-p (nth 5 (file-attributes x)) nil)
                 (rename-file x (concat cdir (nnmaildir--ensure-suffix file)))))
          (setf (nnmaildir--grp-new group) nattr))
        (setq cattr (nth 5 (file-attributes cdir)))
index 098ecd5dc3d2bbd0afdc6eb43956a8dfbdf51174..3e7428493e4f2f02e75edeb4db47d2ae56640dbe 100644 (file)
@@ -85,7 +85,7 @@ This mode is an extended emacs-lisp mode.
 (defun gnus-score-edit-insert-date ()
   "Insert date in numerical format."
   (interactive)
-  (princ (time-to-days (current-time)) (current-buffer)))
+  (princ (time-to-days nil) (current-buffer)))
 
 (defun gnus-score-pretty-print ()
   "Format the current score file."
index 6628195cfa63c48d86ed0b045a91883f19c5a886..6173c8527ebbbc9fc4dcee20e3c1e3f3b0bca967 100644 (file)
          (not (file-exists-p (url-cache-create-filename url))))
         (t (let ((cache-time (url-is-cached url)))
              (if cache-time
-                 (time-less-p
-                  (time-add
-                   cache-time
-                   gravatar-cache-ttl)
-                  (current-time))
+                 (time-less-p (time-add cache-time gravatar-cache-ttl) nil)
                t)))))
 
 (defun gravatar-get-data ()
index 5f68dea1be7cac922ecf30ecf6b145fb08cb99ab..7a73d4688aa98eae6349fe2c1a160046b530eddd 100644 (file)
@@ -1807,7 +1807,7 @@ If the file does no exist or if it is older than 24 hours
 download it from URL first."
   (let ((image-name (concat directory feed-name)))
     (if (and (file-exists-p image-name)
-             (time-less-p (current-time)
+             (time-less-p nil
                           (time-add (nth 5 (file-attributes image-name))
                                     (seconds-to-time 86400))))
         (newsticker--debug-msg "%s: Getting image for %s skipped"
@@ -2004,7 +2004,7 @@ older than TIME."
             (when (eq (newsticker--age item) old-age)
               (let ((exp-time (time-add (newsticker--time item)
                                         (seconds-to-time time))))
-                (when (time-less-p exp-time (current-time))
+                (when (time-less-p exp-time nil)
                   (newsticker--debug-msg
                    "Item `%s' from %s has expired on %s"
                    (newsticker--title item)
index 85614822be8ebbb41285be8d3b70ce7d8c785344..8d85f2ea06b545cf463d8f67f76de885c2c6d2c3 100644 (file)
 
 (defun rng-time-function (function &rest args)
   (let* ((start (current-time))
-        (val (apply function args))
-        (end (current-time)))
+        (val (apply function args)))
     (message "%s ran in %g seconds"
             function
-            (float-time (time-subtract end start)))
+            (float-time (time-subtract nil start)))
     val))
 
 (defun rng-time-tokenize-buffer ()
index cf7a4dbf38ba09eedd6e6299524814d3cad945c6..49519471b380cc1edccdf691ab8079bc514c32c6 100644 (file)
@@ -10153,7 +10153,7 @@ to override `appt-message-warning-time'."
          ;; time and without date as argument, so it may pass wrong
          ;; information otherwise
          (today (org-date-to-gregorian
-                 (time-to-days (current-time))))
+                 (time-to-days nil)))
          (org-agenda-restrict nil)
          (files (org-agenda-files 'unrestricted)) entries file
          (org-agenda-buffer nil))
index 9dc501500b158d526cb2398d292f7d208de3c146..eb7080bb8beadfd65109d3fd71dd9a579840bd03 100644 (file)
@@ -950,7 +950,7 @@ If necessary, clock-out of the currently active clock."
        (unless (org-is-active-clock clock)
          (org-clock-clock-in clock t))))
 
-     ((not (time-less-p resolve-to (current-time)))
+     ((not (time-less-p resolve-to nil))
       (error "RESOLVE-TO must refer to a time in the past"))
 
      (t
@@ -1052,7 +1052,7 @@ to be CLOCKED OUT."))))
                (and (not (memq char-pressed '(?i ?q))) char-pressed)))))
         (default
           (floor (/ (float-time
-                     (time-subtract (current-time) last-valid)) 60)))
+                     (time-subtract nil last-valid)) 60)))
         (keep
          (and (memq ch '(?k ?K))
               (read-number "Keep how many minutes? " default)))
@@ -1089,8 +1089,7 @@ to be CLOCKED OUT."))))
              (keep
               (time-add last-valid (seconds-to-time (* 60 keep))))
              (gotback
-              (time-subtract (current-time)
-                             (seconds-to-time (* 60 gotback))))
+              (time-subtract nil (seconds-to-time (* 60 gotback))))
              (t
               (error "Unexpected, please report this as a bug")))
        (and gotback last-valid)
@@ -1172,7 +1171,7 @@ so long."
             org-clock-marker (marker-buffer org-clock-marker))
     (let* ((org-clock-user-idle-seconds (org-user-idle-seconds))
           (org-clock-user-idle-start
-           (time-subtract (current-time)
+           (time-subtract nil
                           (seconds-to-time org-clock-user-idle-seconds)))
           (org-clock-resolving-clocks-due-to-idleness t))
       (if (> org-clock-user-idle-seconds (* 60 org-clock-idle-time))
@@ -1182,8 +1181,7 @@ so long."
           (lambda (_)
             (format "Clocked in & idle for %.1f mins"
                     (/ (float-time
-                        (time-subtract (current-time)
-                                       org-clock-user-idle-start))
+                        (time-subtract nil org-clock-user-idle-start))
                        60.0)))
           org-clock-user-idle-start)))))
 
index eac29c50f65aaf606a730bced3472ee5fb68ff6f..80f4929b95c00275f71b668f23e3964fe8731fe2 100644 (file)
@@ -540,7 +540,7 @@ Where possible, use the standard interface for changing this line."
         (eol (line-end-position))
         (pom (or (get-text-property bol 'org-hd-marker) (point)))
         (key (or key (get-char-property (point) 'org-columns-key)))
-        (org-columns--time (float-time (current-time)))
+        (org-columns--time (float-time))
         (action
          (pcase key
            ("CLOCKSUM"
@@ -790,7 +790,7 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
   (org-columns-goto-top-level)
   ;; Initialize `org-columns-current-fmt' and
   ;; `org-columns-current-fmt-compiled'.
-  (let ((org-columns--time (float-time (current-time))))
+  (let ((org-columns--time (float-time)))
     (org-columns-get-format columns-fmt-string)
     (unless org-columns-inhibit-recalculation (org-columns-compute-all))
     (save-excursion
@@ -1182,7 +1182,7 @@ column specification."
   "Compute all columns that have operators defined."
   (org-with-silent-modifications
    (remove-text-properties (point-min) (point-max) '(org-summaries t)))
-  (let ((org-columns--time (float-time (current-time)))
+  (let ((org-columns--time (float-time))
        seen)
     (dolist (spec org-columns-current-fmt-compiled)
       (let ((property (car spec)))
@@ -1494,7 +1494,7 @@ PARAMS is a property list of parameters:
   (if (markerp org-columns-begin-marker)
       (move-marker org-columns-begin-marker (point))
     (setq org-columns-begin-marker (point-marker)))
-  (let* ((org-columns--time (float-time (current-time)))
+  (let* ((org-columns--time (float-time))
         (fmt
          (cond
           ((bound-and-true-p org-agenda-overriding-columns-format))
index f2b3002f1fd575805b23fd8054026516d0782cb2..73012cd2681096628e1375bb145912b1e8448dba 100644 (file)
@@ -5067,7 +5067,7 @@ Assume ELEMENT belongs to cache and that a cache is active."
 TIME-LIMIT is a time value or nil."
   (and time-limit
        (or (input-pending-p)
-          (time-less-p time-limit (current-time)))))
+          (time-less-p time-limit nil))))
 
 (defsubst org-element--cache-shift-positions (element offset &optional props)
   "Shift ELEMENT properties relative to buffer positions by OFFSET.
@@ -5121,7 +5121,7 @@ updated before current modification are actually submitted."
             (and next (aref next 0))
             threshold
             (and (not threshold)
-                 (time-add (current-time)
+                 (time-add nil
                            org-element-cache-sync-duration))
             future-change)
            ;; Request processed.  Merge current and next offsets and
index 89b75e6f6800d6882bb5291683f0958c780d1b71..c867c840b0e5587db4d6a881164bc31bd75f75b3 100644 (file)
@@ -288,7 +288,7 @@ Habits are assigned colors on the following basis:
         (deadline (if scheduled-days
                       (+ scheduled-days (- d-repeat s-repeat))
                     (org-habit-deadline habit)))
-        (m-days (or now-days (time-to-days (current-time)))))
+        (m-days (or now-days (time-to-days nil))))
     (cond
      ((< m-days scheduled)
       '(org-habit-clear-face . org-habit-clear-future-face))
@@ -406,7 +406,7 @@ current time."
   "Insert consistency graph for any habitual tasks."
   (let ((inhibit-read-only t)
        (buffer-invisibility-spec '(org-link))
-       (moment (time-subtract (current-time)
+       (moment (time-subtract nil
                               (list 0 (* 3600 org-extend-today-until) 0))))
     (save-excursion
       (goto-char (if line (point-at-bol) (point-min)))
index b34586e09ec8ace8bf27fef46fa6c043ae715af3..35c1f22719ede24ad30562f5d31bdb333b2da6e2 100644 (file)
@@ -325,7 +325,7 @@ stopped."
      (let* ((case-fold-search t)
            (limited-re (org-get-limited-outline-regexp))
            (level (or (org-current-level) 0))
-           (time-limit (and delay (time-add (current-time) delay))))
+           (time-limit (and delay (time-add nil delay))))
        ;; For each line, set `line-prefix' and `wrap-prefix'
        ;; properties depending on the type of line (headline, inline
        ;; task, item or other).
@@ -338,7 +338,7 @@ stopped."
           ;; In asynchronous mode, take a break of
           ;; `org-indent-agent-resume-delay' every DELAY to avoid
           ;; blocking any other idle timer or process output.
-          ((and delay (time-less-p time-limit (current-time)))
+          ((and delay (time-less-p time-limit nil))
            (setq org-indent-agent-resume-timer
                  (run-with-idle-timer
                   (time-add (current-idle-time) org-indent-agent-resume-delay)
index 5acf526f183121dd3ee470e573b6e25abae1a643..7617a3810f90049783a9ea1eb5b224ec00eeabc5 100644 (file)
@@ -144,7 +144,7 @@ the region 0:00:00."
               ;; Pass `current-time' result to `float-time' (instead
               ;; of calling without arguments) so that only
               ;; `current-time' has to be overridden in tests.
-              (- (float-time (current-time)) delta))))
+              (- (float-time) delta))))
       (setq org-timer-pause-time nil)
       (org-timer-set-mode-line 'on)
       (message "Timer start time set to %s, current value is %s"
@@ -168,12 +168,12 @@ With prefix arg STOP, stop it entirely."
                  (org-timer--run-countdown-timer
                   new-secs org-timer-countdown-timer-title))
            (setq org-timer-start-time
-                 (time-add (current-time) (seconds-to-time new-secs))))
+                 (time-add nil (seconds-to-time new-secs))))
        (setq org-timer-start-time
              ;; Pass `current-time' result to `float-time' (instead
              ;; of calling without arguments) so that only
              ;; `current-time' has to be overridden in tests.
-             (seconds-to-time (- (float-time (current-time))
+             (seconds-to-time (- (float-time)
                                  (- pause-secs start-secs)))))
       (setq org-timer-pause-time nil)
       (org-timer-set-mode-line 'on)
@@ -238,8 +238,8 @@ it in the buffer."
   ;; overridden in tests.
   (if org-timer-countdown-timer
       (- (float-time org-timer-start-time)
-        (float-time (or org-timer-pause-time (current-time))))
-    (- (float-time (or org-timer-pause-time (current-time)))
+        (float-time org-timer-pause-time))
+    (- (float-time org-timer-pause-time)
        (float-time org-timer-start-time))))
 
 ;;;###autoload
@@ -400,7 +400,7 @@ VALUE can be `on', `off', or `paused'."
       (message "No timer set")
     (let* ((rtime (decode-time
                   (time-subtract (timer--time org-timer-countdown-timer)
-                                 (current-time))))
+                                 nil)))
           (rsecs (nth 0 rtime))
           (rmins (nth 1 rtime)))
       (message "%d minute(s) %d seconds left before next time out"
@@ -464,7 +464,7 @@ using three `C-u' prefix arguments."
                 secs org-timer-countdown-timer-title))
          (run-hooks 'org-timer-set-hook)
          (setq org-timer-start-time
-               (time-add (current-time) (seconds-to-time secs)))
+               (time-add nil (seconds-to-time secs)))
          (setq org-timer-pause-time nil)
          (org-timer-set-mode-line 'on))))))
 
index 35405b4bf81a7a4425c4b210e98ec335917f2d6e..569bc9f8ec1c276e4e498a59dea9426f0c618fcc 100644 (file)
@@ -227,7 +227,7 @@ file to byte-code before it is loaded."
   (interactive "fFile to load: \nP")
   (let* ((age (lambda (file)
                (float-time
-                (time-subtract (current-time)
+                (time-subtract nil
                                (nth 5 (or (file-attributes (file-truename file))
                                           (file-attributes file)))))))
         (base-name (file-name-sans-extension file))
@@ -5597,15 +5597,14 @@ the rounding returns a past time."
            (apply 'encode-time
                   (append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) r)))))
                           (nthcdr 2 time))))
-      (if (and past (< (float-time (time-subtract (current-time) res)) 0))
+      (if (and past (< (float-time (time-subtract nil res)) 0))
          (seconds-to-time (- (float-time res) (* r 60)))
        res))))
 
 (defun org-today ()
   "Return today date, considering `org-extend-today-until'."
   (time-to-days
-   (time-subtract (current-time)
-                 (list 0 (* 3600 org-extend-today-until) 0))))
+   (time-subtract nil (list 0 (* 3600 org-extend-today-until) 0))))
 
 ;;;; Font-Lock stuff, including the activators
 
@@ -13057,8 +13056,7 @@ This function is run automatically after each state change to a DONE state."
                        (while (re-search-forward org-clock-line-re end t)
                          (when (org-at-clock-log-p) (throw :clock t))))))
            (org-entry-put nil "LAST_REPEAT" (format-time-string
-                                             (org-time-stamp-format t t)
-                                             (current-time))))
+                                             (org-time-stamp-format t t))))
          (when org-log-repeat
            (if (or (memq 'org-add-log-note (default-value 'post-command-hook))
                    (memq 'org-add-log-note post-command-hook))
@@ -13117,7 +13115,7 @@ has been set"
                          (let ((nshiftmax 10)
                                (nshift 0))
                            (while (or (= nshift 0)
-                                      (not (time-less-p (current-time) time)))
+                                      (not (time-less-p nil time)))
                              (when (= (cl-incf nshift) nshiftmax)
                                (or (y-or-n-p
                                     (format "%d repeater intervals were not \
@@ -16904,7 +16902,7 @@ user."
   ;; overridden in tests.
   (let ((org-def def)
        (org-defdecode defdecode)
-       (nowdecode (decode-time (current-time)))
+       (nowdecode (decode-time))
        delta deltan deltaw deltadef year month day
        hour minute second wday pm h2 m2 tl wday1
        iso-year iso-weekday iso-week iso-date futurep kill-year)
@@ -17070,7 +17068,7 @@ user."
                                        ;      (when (and org-read-date-prefer-future
                                        ;                (not iso-year)
                                        ;                (< (calendar-absolute-from-gregorian iso-date)
-                                       ;                   (time-to-days (current-time))))
+                                       ;                   (time-to-days nil)))
                                        ;       (setq year (1+ year)
                                        ;             iso-date (calendar-gregorian-from-absolute
                                        ;                       (calendar-iso-to-absolute
@@ -17084,7 +17082,7 @@ user."
        ;; Pass `current-time' result to `decode-time' (instead of
        ;; calling without arguments) so that only `current-time' has
        ;; to be overridden in tests.
-       (let ((now (decode-time (current-time))))
+       (let ((now (decode-time)))
          (setq day (nth 3 now) month (nth 4 now) year (nth 5 now))))
       (cond ((member deltaw '("d" "")) (setq day (+ day deltan)))
            ((equal deltaw "w") (setq day (+ day (* 7 deltan))))
@@ -17564,7 +17562,7 @@ signaled."
 YEAR is expanded into one of the 30 next years, if possible, or
 into a past one.  Any year larger than 99 is returned unchanged."
   (if (>= year 100) year
-    (let* ((current (string-to-number (format-time-string "%Y" (current-time))))
+    (let* ((current (string-to-number (format-time-string "%Y")))
           (century (/ current 100))
           (offset (- year (% current 100))))
       (cond ((> offset 30) (+ (* (1- century) 100) year))
@@ -18088,7 +18086,7 @@ A prefix ARG can be used to force the current date."
        diff)
     (when (or (org-at-timestamp-p 'lax)
              (org-match-line (concat ".*" org-ts-regexp)))
-      (let ((d1 (time-to-days (current-time)))
+      (let ((d1 (time-to-days nil))
            (d2 (time-to-days (org-time-string-to-time (match-string 1)))))
        (setq diff (- d2 d1))))
     (calendar)
index 1c43577cddf7606907b024118044225d200f7cd2..820b1755624613fbfb6bd79e753723b662cf80c1 100644 (file)
@@ -3243,7 +3243,7 @@ locally for the subtree through node properties."
       (let ((val (cond ((equal (car key) "DATE")
                        (or (cdr key)
                            (with-temp-buffer
-                             (org-insert-time-stamp (current-time)))))
+                             (org-insert-time-stamp nil))))
                       ((equal (car key) "TITLE")
                        (or (let ((visited-file
                                   (buffer-file-name (buffer-base-buffer))))
index c8726a9a1b01264f2d41068ab88b1ad8536b73b7..6cd7320e72f5a8284c1c3a6fcbb109aca28dfe50 100644 (file)
@@ -583,7 +583,7 @@ For example, the Unix uptime command format is \"%D, %z%2h:%.2m\"."
   (let ((str
          (format-seconds (or format "%Y, %D, %H, %M, %z%S")
                          (float-time
-                          (time-subtract (current-time) before-init-time)))))
+                          (time-subtract nil before-init-time)))))
     (if (called-interactively-p 'interactive)
         (message "%s" str)
       str)))
index faf44b3b8754de14b6efb6bc62078661ba81f5cc..35b0efe65b1eef1848e33f74814119ee054849a8 100644 (file)
@@ -376,7 +376,7 @@ problems."
        (if (and type-break-time-last-break
                 (< (setq diff (type-break-time-difference
                                type-break-time-last-break
-                               (current-time)))
+                               nil))
                    type-break-interval))
            ;; Use the file's value.
            (progn
@@ -563,7 +563,7 @@ as per the function `type-break-schedule'."
         (cond
          (good-interval
           (let ((break-secs (type-break-time-difference
-                             start-time (current-time))))
+                             start-time nil)))
             (cond
              ((>= break-secs good-interval)
               (setq continue nil))
@@ -624,7 +624,7 @@ INTERVAL is the full length of an interval (defaults to TIME)."
                type-break-time-warning-intervals))
 
     (or time
-        (setq time (type-break-time-difference (current-time)
+        (setq time (type-break-time-difference nil
                                                type-break-time-next-break)))
 
     (while (and type-break-current-time-warning-interval
@@ -685,7 +685,7 @@ keystroke threshold has been exceeded."
     (and type-break-good-rest-interval
          (progn
            (and (> (type-break-time-difference
-                    type-break-time-last-command (current-time))
+                    type-break-time-last-command nil)
                    type-break-good-rest-interval)
                 (progn
                   (type-break-keystroke-reset)
index 1cffc06d7c3e19449490c672b432651bb4236a4f..963dfd531e254fee15f33b475bf8b7de30ea8c6b 100644 (file)
@@ -206,7 +206,7 @@ If `url-standalone-mode' is non-nil, cached items never expire."
           (time-add
            cache-time
            (seconds-to-time (or expire-time url-cache-expire-time)))
-          (current-time))))))
+          nil)))))
 
 (defun url-cache-prune-cache (&optional directory)
   "Remove all expired files from the cache.
index 9a6b732ca9c462a6ef0da54da2f6a538d9e9dcfc..36cd81bd70b4cdbf075e0ebcee34a8de93731da8 100644 (file)
@@ -259,8 +259,7 @@ how long to wait for a response before giving up."
        ;; process output.
        (while (and (not retrieval-done)
                     (or (not timeout)
-                        (< (float-time (time-subtract
-                                        (current-time) start-time))
+                        (< (float-time (time-subtract nil start-time))
                            timeout)))
          (url-debug 'retrieval
                     "Spinning in url-retrieve-synchronously: %S (%S)"
index 83d6fa79b1e6b2310c86315feae5666c1925596f..a16f28798097e9e8d4adb54c8026421fc16f3fa3 100644 (file)
                          (char-fold-to-regexp string)))
     (with-temp-buffer
       (save-excursion (insert string))
-      (let ((time (time-to-seconds (current-time))))
+      (let ((time (time-to-seconds)))
         ;; Our initial implementation of case-folding in char-folding
         ;; created a lot of redundant paths in the regexp. Because of
         ;; that, if a really long string "almost" matches, the regexp
         ;; engine took a long time to realize that it doesn't match.
         (should-not (char-fold-search-forward (concat string "c") nil 'noerror))
         ;; Ensure it took less than a second.
-        (should (< (- (time-to-seconds (current-time))
-                      time)
-                   1))))))
+        (should (< (- (time-to-seconds) time) 1))))))
 
 (provide 'char-fold-tests)
 ;;; char-fold-tests.el ends here
index 7861fd739490c3f43bbd78ee25cec481ade9c488..53cff05adc494678b588ed7a35884e01e2b76fcf 100644 (file)
@@ -434,7 +434,7 @@ tag that contains point, and return that."
       (when (interactive-p)
        (message "Found %d occurrences of %s in %.2f seconds"
                 Lcount (semantic-tag-name target)
-                (semantic-elapsed-time start (current-time))))
+                (semantic-elapsed-time start nil)))
       Lcount)))
 
 (defun semantic-src-utest-buffer-refs ()
index 3a19328ac7943210699ba20b5c253415207d1992..0495170058a61af82e0964e7d1756b27d9857c10 100644 (file)
@@ -178,9 +178,8 @@ Optional argument ARG specifies not to use color."
   "Test `semantic-idle-scheduler-work-parse-neighboring-files' and time it."
   (interactive)
   (let ((start (current-time))
-       (junk (semantic-idle-scheduler-work-parse-neighboring-files))
-       (end (current-time)))
-    (message "Work took %.2f seconds." (semantic-elapsed-time start end))))
+       (junk (semantic-idle-scheduler-work-parse-neighboring-files)))
+    (message "Work took %.2f seconds." (semantic-elapsed-time start nil))))
 
 ;;; From semantic-lex:
 
@@ -195,10 +194,9 @@ If universal argument ARG, then try the whole buffer."
         (result (semantic-lex
                  (if arg (point-min) (point))
                  (point-max)
-                 100))
-        (end (current-time)))
+                 100)))
     (message "Elapsed Time: %.2f seconds."
-            (semantic-elapsed-time start end))
+            (semantic-elapsed-time start nil))
     (pop-to-buffer "*Lexer Output*")
     (require 'pp)
     (erase-buffer)
@@ -278,7 +276,7 @@ tag that contains point, and return that."
       (when (interactive-p)
        (message "Found %d occurrences of %s in %.2f seconds"
                 Lcount (semantic-tag-name target)
-                (semantic-elapsed-time start (current-time))))
+                (semantic-elapsed-time start nil)))
       Lcount)))
 
 ;;; From bovine-gcc: