From: Paul Eggert Date: Mon, 6 Dec 2021 07:00:10 +0000 (-0800) Subject: Fix minor clock skew issues X-Git-Tag: emacs-29.0.90~3612^2^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a21b8c5d7dfb3808cf18a5ac118e25940c9b5518;p=emacs.git Fix minor clock skew issues * lisp/midnight.el (clean-buffer-list): * lisp/progmodes/vhdl-mode.el (vhdl-template-replace-header-keywords): * lisp/net/rcirc.el (rcirc-connect): Don’t assume that getting the current time twice in rapid succession will yield the same date and time. --- diff --git a/lisp/midnight.el b/lisp/midnight.el index b3adbf00172..51173e7429f 100644 --- a/lisp/midnight.el +++ b/lisp/midnight.el @@ -159,7 +159,7 @@ the current date/time, buffer name, how many seconds ago it was displayed (can be nil if the buffer was never displayed) and its lifetime, i.e., its \"age\" when it will be purged." (interactive) - (let ((tm (current-time)) bts (ts (format-time-string "%Y-%m-%d %T")) + (let* ((tm (current-time)) bts (ts (format-time-string "%Y-%m-%d %T" tm)) delay cbld bn) (dolist (buf (buffer-list)) (when (buffer-live-p buf) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index b4e9031e0d4..2375b14cca2 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -716,8 +716,8 @@ that are joined after authentication." (setq rcirc-nick-table (make-hash-table :test 'equal)) (setq rcirc-nick nick) (setq rcirc-startup-channels startup-channels) - (setq rcirc-last-server-message-time (current-time)) (setq rcirc-last-connect-time (current-time)) + (setq rcirc-last-server-message-time rcirc-last-connect-time) ;; Check if the immediate process state (sit-for .1) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 3a9185b334f..f3a7d96c63b 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -10683,8 +10683,9 @@ Include a library specification, if not already there." (replace-match "" t t) (vhdl-template-insert-date)) (goto-char beg) - (while (search-forward "" end t) - (replace-match (format-time-string "%Y" nil) t t)) + (let ((year (format-time-string "%Y"))) + (while (search-forward "" end t) + (replace-match year t t))) (goto-char beg) (when file-title (while (search-forward "" end t)