[Top][All Lists]

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

master a21b8c5 12/13: Fix minor clock skew issues

From: Paul Eggert
Subject: master a21b8c5 12/13: Fix minor clock skew issues
Date: Mon, 6 Dec 2021 02:24:23 -0500 (EST)

branch: master
commit a21b8c5d7dfb3808cf18a5ac118e25940c9b5518
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    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.
 lisp/midnight.el            | 2 +-
 lisp/net/rcirc.el           | 2 +-
 lisp/progmodes/vhdl-mode.el | 5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/midnight.el b/lisp/midnight.el
index b3adbf0..51173e7 100644
--- a/lisp/midnight.el
+++ b/lisp/midnight.el
@@ -159,7 +159,7 @@ the current date/time, buffer name, how many seconds ago it 
 displayed (can be nil if the buffer was never displayed) and its
 lifetime, i.e., its \"age\" when it will be purged."
-  (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 b4e9031..2375b14 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 3a9185b..f3a7d96 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)
        (goto-char beg)
-       (while (search-forward "<year>" end t)
-        (replace-match (format-time-string "%Y" nil) t t))
+       (let ((year (format-time-string "%Y")))
+        (while (search-forward "<year>" end t)
+          (replace-match year t t)))
        (goto-char beg)
        (when file-title
         (while (search-forward "<title string>" end t)

reply via email to

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