Prefer nil to (current-time) when either works

* 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.
This commit is contained in:
Paul Eggert 2017-10-20 19:40:09 -07:00
parent c73769255c
commit c75f505dea
45 changed files with 98 additions and 134 deletions

View 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:

View 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)

View 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.") )))

View 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)))

View 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*")

View 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

View 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)

View 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)

View 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 ()

View 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 "*")))

View 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 "*")))

View 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)

View file

@ -34,13 +34,11 @@
(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)

View 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

View 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"

View 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

View 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.

View 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))))

View 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))

View 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))))

View 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

View 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))

View 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)

View 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))

View 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)))

View 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."

View file

@ -77,11 +77,7 @@
(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 ()

View 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)

View file

@ -226,11 +226,10 @@
(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 ()

View 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))

View 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)))))

View 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))

View 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

View 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)))

View 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)

View 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))))))

View 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)

View 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))))

View 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)))

View 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)

View 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.

View 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)"

View file

@ -117,16 +117,14 @@
(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

View 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 ()

View 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: