emacs-diffs
[Top][All Lists]
Advanced

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

feature/pgtk 9eba6b9: Merge remote-tracking branch 'origin/master' into


From: Po Lu
Subject: feature/pgtk 9eba6b9: Merge remote-tracking branch 'origin/master' into feature/pgtk
Date: Mon, 6 Dec 2021 04:24:50 -0500 (EST)

branch: feature/pgtk
commit 9eba6b966e330a38bdc3fef5e36b8a2904e72785
Merge: 7314c12 c1145c3
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Merge remote-tracking branch 'origin/master' into feature/pgtk
---
 doc/lispref/text.texi                 | 41 ++++++++++++---------
 doc/misc/erc.texi                     | 25 ++++++-------
 doc/misc/gnus.texi                    |  2 +-
 lisp/calendar/time-date.el            |  2 +-
 lisp/dired-aux.el                     | 42 ++++++++++++++++++++--
 lisp/emacs-lisp/eieio-opt.el          |  1 +
 lisp/emacs-lisp/eieio.el              |  5 ---
 lisp/emacs-lisp/timer.el              |  4 +--
 lisp/emacs-lisp/warnings.el           |  4 ++-
 lisp/gnus/gnus-score.el               |  4 +--
 lisp/gnus/gnus-search.el              |  7 ++--
 lisp/gnus/gnus-sum.el                 |  6 ++--
 lisp/gnus/gnus.el                     |  6 ++--
 lisp/gnus/message.el                  | 31 ++++++++--------
 lisp/image-dired.el                   |  9 ++---
 lisp/image.el                         |  6 ++--
 lisp/image/gravatar.el                |  4 +--
 lisp/mail/feedmail.el                 | 18 ++++------
 lisp/mail/mail-utils.el               | 15 +++-----
 lisp/mail/sendmail.el                 | 14 +++-----
 lisp/mh-e/mh-alias.el                 |  3 +-
 lisp/midnight.el                      |  2 +-
 lisp/net/dbus.el                      |  2 +-
 lisp/net/rcirc.el                     |  2 +-
 lisp/net/sasl.el                      | 23 ++++++------
 lisp/net/tramp-gvfs.el                |  2 +-
 lisp/net/tramp-sh.el                  |  2 +-
 lisp/net/tramp-sudoedit.el            |  2 +-
 lisp/net/tramp.el                     |  4 +--
 lisp/org/org-compat.el                |  3 +-
 lisp/pixel-scroll.el                  | 17 +++++----
 lisp/progmodes/vhdl-mode.el           |  5 +--
 lisp/timezone.el                      |  5 +--
 lisp/vc/vc-dir.el                     |  7 +++-
 lisp/vc/vc-git.el                     | 24 +++++++++----
 test/Makefile.in                      |  2 +-
 test/lisp/autorevert-tests.el         |  6 ++--
 test/lisp/calendar/time-date-tests.el | 17 ++++-----
 test/lisp/net/tramp-tests.el          |  2 +-
 test/lisp/vc/vc-git-tests.el          | 67 +++++++++++++++++++++++++++++++++++
 test/manual/cedet/cedet-utests.el     |  4 +--
 test/src/timefns-tests.el             | 12 +++++++
 42 files changed, 284 insertions(+), 175 deletions(-)

diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index b49a998..03adb54 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3722,14 +3722,14 @@ Consecutive characters with the same @code{field} 
property constitute a
 @kindex cursor @r{(text property)}
 Normally, the cursor is displayed at the beginning or the end of any
 overlay and text property strings present at the current buffer
-position.  You can place the cursor on any desired character of these
-strings by giving that character a non-@code{nil} @code{cursor} text
-property.  In addition, if the value of the @code{cursor} property is
-an integer, it specifies the number of buffer's character
-positions, starting with the position where the overlay or the
-@code{display} property begins, for which the cursor should be
-displayed on that character.  Specifically, if the value of the
-@code{cursor} property of a character is the number @var{n}, the
+position.  You can instead tell Emacs to place the cursor on any
+desired character of these strings by giving that character a
+non-@code{nil} @code{cursor} text property.  In addition, if the value
+of the @code{cursor} property is an integer, it specifies the number
+of buffer's character positions, starting with the position where the
+overlay or the @code{display} property begins, for which the cursor
+should be displayed on that character.  Specifically, if the value of
+the @code{cursor} property of a character is the number @var{n}, the
 cursor will be displayed on this character for any buffer position in
 the range @code{[@var{ovpos}..@var{ovpos}+@var{n})}, where @var{ovpos}
 is the overlay's starting position given by @code{overlay-start}
@@ -3738,14 +3738,23 @@ text property begins in the buffer.
 
 In other words, the string character with the @code{cursor} property
 of any non-@code{nil} value is the character where to display the
-cursor.  The value of the property says for which buffer positions to
-display the cursor there.  If the value is an integer @var{n},
-the cursor is displayed there when point is anywhere between the
-beginning of the overlay or @code{display} property and @var{n}
-positions after that.  If the value is anything else and
-non-@code{nil}, the cursor is displayed there only when point is at
-the beginning of the @code{display} property or at
-@code{overlay-start}.
+cursor when the overlay or display string make point not visible on
+display.  The value of the property says for which buffer positions to
+display the cursor there.  If the value is an integer @var{n}, the
+cursor is displayed there when point is anywhere between the beginning
+of the overlay or @code{display} property and @var{n} positions after
+that.  If the value is anything else and non-@code{nil}, the cursor is
+displayed there only when point is at the buffer position that is the
+beginning of the @code{display} property, or at @code{overlay-start}
+if that position is not visible on display.  Note that an integer
+value of the @code{cursor} property could mean that the cursor is
+displayed on that character even when point is visible on display.
+
+One subtlety of this property is that it doesn't work to put this
+property on a newline character that is part of a display or overlay
+string.  That's because the newline doesn't have a graphic
+representation on the screen for Emacs to find when it looks for a
+character on display with that @code{cursor} property.
 
 @cindex cursor position for @code{display} properties and overlays
 When the buffer has many overlay strings (e.g., @pxref{Overlay
diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi
index 7dbb5f0..e7286d2 100644
--- a/doc/misc/erc.texi
+++ b/doc/misc/erc.texi
@@ -72,7 +72,7 @@ and modified without restriction.
 
 Getting Started
 
-* Sample Session::              Example of connecting to the #emacs channel
+* Sample Session::              Example of connecting to the @samp{#emacs} 
channel
 * Special Features::            Differences from standalone IRC clients
 
 Advanced Usage
@@ -159,14 +159,15 @@ customize-variable @key{RET} erc-modules @key{RET}}.
 @section Sample Session
 
 This is an example ERC session which shows how to connect to the
-#emacs channel on Libera.Chat.  Another IRC channel on Libera.Chat
-that may be of interest is #erc, which is a channel where ERC users
-and developers hang out.  These channels used to live on the Freenode
-IRC network until June 2021, when they---along with the official IRC
-channels of the GNU Project, the Free Software Foundation, and many
-other free software communities---relocated to the Libera.Chat network
-in the aftermath of changes in governance and policies of Freenode in
-May and June 2021.  GNU and FSF's announcements about this are at
+@samp{#emacs} channel on Libera.Chat.  Another IRC channel on
+Libera.Chat that may be of interest is @samp{#erc}, which is a channel
+where ERC users and developers hang out.  These channels used to live
+on the Freenode IRC network until June 2021, when they---along with
+the official IRC channels of the GNU Project, the Free Software
+Foundation, and many other free software communities---relocated to
+the Libera.Chat network in the aftermath of changes in governance and
+policies of Freenode in May and June 2021.  GNU and FSF's
+announcements about this are at
 @uref{https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00005.html},
 @uref{https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00007.html},
 and
@@ -176,7 +177,7 @@ and
 
 @item Connect to Libera.Chat
 
-Run @kbd{M-x erc}.  Use ``irc.libera.chat as the IRC server, ``6667''
+Run @kbd{M-x erc}.  Use ``irc.libera.chat'' as the IRC server, ``6667''
 as the port, and choose a nickname.
 
 @item Get used to the interface
@@ -291,7 +292,7 @@ new command in capital letters.
 If the connection goes away at some point, ERC will try to reconnect
 automatically.  If it fails to reconnect, and you want to try to
 manually reestablish the connection at some later point, switch to an
-ERC  buffer and run the @code{/RECONNECT} command.
+ERC buffer and run the @code{/RECONNECT} command.
 
 @end itemize
 
@@ -958,7 +959,7 @@ over the project entirely.''
 So we happily hacked away on ERC, and soon after (September 2001)
 released the next "stable" version, 2.1.
 
-Most of the development of the new ERC happened on #emacs on
+Most of the development of the new ERC happened on @samp{#emacs} on
 irc.openprojects.net.  Over time, many people contributed code, ideas,
 bugfixes, and a lot of alpha/beta/gamma testing.
 
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 6ffc057..74b5fb4 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -18048,7 +18048,7 @@ find all messages that have been received recently from 
certain groups:
          (list
           (cons 'query
                 (format-time-string "SENTSINCE %d-%b-%Y"
-                                    (time-subtract (current-time)
+                                    (time-subtract nil
                                                    (days-to-time (car args)))))
           (cons 'criteria "")))
         (group-spec (cadr args)))
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index 37a16d3..b361712 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -69,7 +69,7 @@ list (HIGH LOW MICRO PICO)."
                     (pop elt)))
             (time-value (car elt))
             (gensym (make-symbol "time")))
-       `(let* ,(append `((,gensym (or ,time-value (current-time)))
+       `(let* ,(append `((,gensym (or ,time-value (time-convert nil 'list)))
                          (,gensym
                           (cond
                            ((integerp ,gensym)
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 588551a..af7b160 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1787,13 +1787,46 @@ Special value `always' suppresses confirmation."
   "Whether Dired should create destination dirs when copying/removing files.
 If nil, don't create them.
 If `always', create them without asking.
-If `ask', ask for user confirmation."
+If `ask', ask for user confirmation.
+
+Also see `dired-create-destination-dirs-on-trailing-dirsep'."
   :type '(choice (const :tag "Never create non-existent dirs" nil)
                 (const :tag "Always create non-existent dirs" always)
                 (const :tag "Ask for user confirmation" ask))
   :group 'dired
   :version "27.1")
 
+(defcustom dired-create-destination-dirs-on-trailing-dirsep nil
+  "If non-nil, treat a trailing slash at queried destination dir specially.
+
+If this variable is non-nil and a single destination filename is
+queried which ends in a directory separator (/), it will be
+treated as a non-existent directory and acted on according to
+`dired-create-destination-dirs'.
+
+This option is only relevant if `dired-create-destination-dirs'
+is non-nil, too.
+
+For example, if both `dired-create-destination-dirs' and this
+option are non-nil, renaming a directory named `old_name' to
+`new_name/' (note the trailing directory separator) where
+`new_name' does not exists already, it will be created and
+`old_name' be moved into it.  If only `new_name' (without the
+trailing /) is given or this option or
+`dired-create-destination-dirs' is `nil', `old_name' will be
+renamed to `new_name'."
+  :type '(choice
+          (const :tag
+                 (concat "Do not treat destination dirs with a "
+                         "trailing directory separator specially")
+                 nil)
+          (const :tag
+                 (concat "Treat destination dirs with trailing "
+                         "directory separator specially")
+                 t))
+  :group 'dired
+  :version "29.1")
+
 (defun dired-maybe-create-dirs (dir)
   "Create DIR if doesn't exist according to `dired-create-destination-dirs'."
   (when (and dired-create-destination-dirs (not (file-exists-p dir)))
@@ -2163,7 +2196,12 @@ Optional arg HOW-TO determines how to treat the target.
                     target-dir op-symbol arg rfn-list default))))
         (into-dir
           (progn
-            (unless dired-one-file (dired-maybe-create-dirs target))
+            (when
+                (or
+                 (not dired-one-file)
+                 (and dired-create-destination-dirs-on-trailing-dirsep
+                      (directory-name-p target)))
+              (dired-maybe-create-dirs target))
             (cond ((null how-to)
                   ;; Allow users to change the letter case of
                   ;; a directory on a case-insensitive
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 9c842f4..6803953 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -130,6 +130,7 @@ are not abstract."
 ;;;###autoload
 (defun eieio-help-constructor (ctr)
   "Describe CTR if it is a class constructor."
+  (declare (obsolete "use `describe-function' or `cl--describe-class'." 
"29.1"))
   (when (class-p ctr)
     (erase-buffer)
     (let ((location (find-lisp-object-file-name ctr 'define-type))
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 3fbfe01..2850c91 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -992,11 +992,6 @@ of `eq'."
   (error "EIEIO: `change-class' is unimplemented"))
 (define-obsolete-function-alias 'change-class #'eieio-change-class "26.1")
 
-;; Hook ourselves into help system for describing classes and methods.
-;; FIXME: This is not actually needed any more since we can click on the
-;; hyperlink from the constructor's docstring to see the type definition.
-(add-hook 'help-fns-describe-function-functions #'eieio-help-constructor)
-
 (provide 'eieio)
 
 ;;; eieio.el ends here
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index 2ac2c99..c7d02cc 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -314,7 +314,7 @@ This function is called, by name, directly by the C code."
                          (not (timer--idle-delay timer)))
                 (setf (timer--time timer)
                       (timer-next-integral-multiple-of-time
-                       (current-time) (timer--repeat-delay timer))))
+                      nil (timer--repeat-delay timer))))
               ;; Place it back on the timer-list before running
               ;; timer--function, so it can cancel-timer itself.
               (timer-activate timer t cell)
@@ -391,7 +391,7 @@ This function returns a timer object which you can use in
 
     ;; Special case: t means the next integral multiple of REPEAT.
     (when (and (eq time t) repeat)
-      (setq time (timer-next-integral-multiple-of-time (current-time) repeat))
+      (setq time (timer-next-integral-multiple-of-time nil repeat))
       (setf (timer--integral-multiple timer) t))
 
     ;; Handle numbers as relative times in seconds.
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 36b275e..1d06136 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -307,7 +307,9 @@ entirely by setting `warning-suppress-types' or
                                'type 'warning-suppress-log-warning
                                'warning-type type))
               (funcall newline)
-             (when (and warning-fill-prefix (not (string-search "\n" message)))
+             (when (and warning-fill-prefix
+                         (not (string-search "\n" message))
+                         (not noninteractive))
                (let ((fill-prefix warning-fill-prefix)
                      (fill-column warning-fill-column))
                  (fill-region start (point))))
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index d031047..a25673a 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -1749,7 +1749,7 @@ score in `gnus-newsgroup-scored' by SCORE."
            (setq type 'after
                  match-func 'string<
                  match (gnus-time-iso8601
-                        (time-subtract (current-time)
+                        (time-subtract nil
                                        (* 86400 (nth 0 kill))))))
           ((eq type 'before)
            (setq match-func 'gnus-string>
@@ -1758,7 +1758,7 @@ score in `gnus-newsgroup-scored' by SCORE."
            (setq type 'before
                  match-func 'gnus-string>
                  match (gnus-time-iso8601
-                        (time-subtract (current-time)
+                        (time-subtract nil
                                        (* 86400 (nth 0 kill))))))
           ((eq type 'at)
            (setq match-func 'string=
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index c77de68..a79c106 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -572,9 +572,7 @@ REL-DATE, or (current-time) if REL-DATE is nil."
   ;; Time parsing doesn't seem to work with slashes.
   (let ((value (string-replace "/" "-" value))
        (now (append '(0 0 0)
-                    (seq-subseq (decode-time (or rel-date
-                                                 (current-time)))
-                                3))))
+                    (seq-subseq (decode-time rel-date) 3))))
     ;; Check for relative time parsing.
     (if (string-match "\\([[:digit:]]+\\)\\([dwmy]\\)" value)
        (seq-subseq
@@ -1239,8 +1237,7 @@ nil (except that (dd nil yyyy) is not allowed).  Massage 
those
 numbers into the most recent past occurrence of whichever date
 elements are present."
   (pcase-let ((`(,nday ,nmonth ,nyear)
-              (seq-subseq (decode-time (current-time))
-                          3 6))
+              (seq-subseq (decode-time) 3 6))
              (`(,dday ,dmonth ,dyear) date))
     (unless (and dday dmonth dyear)
       (unless dday (setq dday 1))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index dcdf3d9..ba61658 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3968,10 +3968,9 @@ Returns \"  ?  \" if there's bad input or if another 
error occurs.
 Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
   (condition-case ()
       (let* ((messy-date (gnus-date-get-time messy-date))
-            (now (current-time))
             ;;If we don't find something suitable we'll use this one
             (my-format "%b %d '%y"))
-       (let* ((difference (time-subtract now messy-date))
+       (let* ((difference (time-subtract nil messy-date))
               (templist gnus-user-date-format-alist)
               (top (eval (caar templist) t)))
          (while (if (numberp top) (time-less-p top difference) (not top))
@@ -10496,7 +10495,6 @@ latter case, they will be copied into the relevant 
groups."
   "Create an article in a mail newsgroup."
   (interactive nil gnus-summary-mode)
   (let ((group gnus-newsgroup-name)
-       (now (current-time))
        group-art)
     (unless (gnus-check-backend-function 'request-accept-article group)
       (error "%s does not support article importing" group))
@@ -10506,7 +10504,7 @@ latter case, they will be copied into the relevant 
groups."
       ;; This doesn't look like an article, so we fudge some headers.
       (insert "From: " (read-string "From: ") "\n"
              "Subject: " (read-string "Subject: ") "\n"
-             "Date: " (message-make-date now) "\n"
+             "Date: " (message-make-date) "\n"
              "Message-ID: " (message-make-message-id) "\n")
       (setq group-art (gnus-request-accept-article group nil t))
       (kill-buffer (current-buffer)))
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 56934df..afe07ee 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -3150,9 +3150,9 @@ g -- Group name."
   "Check whether GROUP supports function FUNC.
 GROUP can either be a string (a group name) or a select method."
   (ignore-errors
-    (let ((method (if (stringp group)
-                     (car (gnus-find-method-for-group group))
-                   group)))
+    (when-let ((method (if (stringp group)
+                          (car (gnus-find-method-for-group group))
+                        group)))
       (unless (featurep method)
        (require method))
       (fboundp (intern (format "%s-%s" method func))))))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 562bc64..c2d1429 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -5828,15 +5828,15 @@ In posting styles use `(\"Expires\" (make-expires-date 
30))'."
 ;; You might for example insert a "." somewhere (not next to another dot
 ;; or string boundary), or modify the "fsf" string.
 (defun message-unique-id ()
-  ;; Don't use microseconds from (current-time), they may be unsupported.
+  ;; Don't use fractional seconds from timestamp; they may be unsupported.
   ;; Instead we use this randomly inited counter.
   (setq message-unique-id-char
-       (% (1+ (or message-unique-id-char
-                  (random (ash 1 20))))
-          ;; (current-time) returns 16-bit ints,
-          ;; and 2^16*25 just fits into 4 digits i base 36.
-          (* 25 25)))
-  (let ((tm (current-time)))
+       ;; 2^16 * 25 just fits into 4 digits i base 36.
+       (let ((base (* 25 25)))
+         (if message-unique-id-char
+             (% (1+ message-unique-id-char) base)
+           (random base))))
+  (let ((tm (time-convert nil 'integer)))
     (concat
      (if (or (eq system-type 'ms-dos)
             ;; message-number-base36 doesn't handle bigints.
@@ -5846,10 +5846,12 @@ In posting styles use `(\"Expires\" (make-expires-date 
30))'."
             (aset user (match-beginning 0) ?_))
           user)
        (message-number-base36 (user-uid) -1))
-     (message-number-base36 (+ (car tm)
-                              (ash (% message-unique-id-char 25) 16)) 4)
-     (message-number-base36 (+ (nth 1 tm)
-                              (ash (/ message-unique-id-char 25) 16)) 4)
+     (message-number-base36 (+ (ash tm -16)
+                              (ash (% message-unique-id-char 25) 16))
+                           4)
+     (message-number-base36 (+ (logand tm #xffff)
+                              (ash (/ message-unique-id-char 25) 16))
+                           4)
      ;; Append a given name, because while the generated ID is unique
      ;; to this newsreader, other newsreaders might otherwise generate
      ;; the same ID via another algorithm.
@@ -5946,12 +5948,9 @@ In posting styles use `(\"Expires\" (make-expires-date 
30))'."
 
 (defun message-make-expires ()
   "Return an Expires header based on `message-expires'."
-  (let ((current (current-time))
-       (future (* 1.0 message-expires 60 60 24)))
+  (let ((future (* 60 60 24 message-expires)))
     ;; Add the future to current.
-    (setcar current (+ (car current) (round (/ future (expt 2 16)))))
-    (setcar (cdr current) (+ (nth 1 current) (% (round future) (expt 2 16))))
-    (message-make-date current)))
+    (message-make-date (time-add nil future))))
 
 (defun message-make-path ()
   "Return uucp path."
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 47a44a4..fe0c3b7 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -540,7 +540,7 @@ Create the thumbnail directory if it does not exist."
 
 (defun image-dired-get-thumbnail-image (file)
   "Return the image descriptor for a thumbnail of image file FILE."
-  (unless (string-match (image-file-name-regexp) file)
+  (unless (string-match-p (image-file-name-regexp) file)
     (error "%s is not a valid image file" file))
   (let* ((thumb-file (image-dired-thumb-name file))
         (thumb-attr (file-attributes thumb-file)))
@@ -768,7 +768,7 @@ and remove the cached thumbnail files between each trial 
run.")
               (image-dired-debug-message
                (format-time-string
                 "Generated thumbnails in %s.%3N seconds"
-                (time-subtract (current-time)
+               (time-subtract nil
                                image-dired--generate-thumbs-start))))
             (if (not (and (eq (process-status process) 'exit)
                           (zerop (process-exit-status process))))
@@ -1593,11 +1593,6 @@ You probably want to use this together with
     (define-key map [down-mouse-1] #'image-dired-mouse-select-thumbnail)
     (define-key map [down-mouse-2] #'image-dired-mouse-select-thumbnail)
     (define-key map [down-mouse-3] #'image-dired-mouse-select-thumbnail)
-    ;; Let's disable mouse dragging, as it currently doesn't do
-    ;; anything useful.
-    (define-key map [drag-mouse-1] #'ignore)
-    (define-key map [drag-mouse-2] #'ignore)
-    (define-key map [drag-mouse-3] #'ignore)
     ;; Seems I must first set C-down-mouse-1 to undefined, or else it
     ;; will trigger the buffer menu. If I try to instead bind
     ;; C-down-mouse-1 to `image-dired-mouse-toggle-mark', I get a message
diff --git a/lisp/image.el b/lisp/image.el
index 87fab80..cedefc0 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -953,9 +953,9 @@ for the animation speed.  A negative value means to animate 
in reverse."
                   (progn
                     (message "Stopping animation; animation possibly too big")
                     nil)))
-      (image-show-frame image n t)
-      (let* ((speed (image-animate-get-speed image))
-            (time (current-time))
+      (let* ((time (prog1 (current-time)
+                    (image-show-frame image n t)))
+            (speed (image-animate-get-speed image))
             (time-to-load-image (time-since time))
             (stated-delay-time
               (/ (or (cdr (plist-get (cdr image) :animate-multi-frame-data))
diff --git a/lisp/image/gravatar.el b/lisp/image/gravatar.el
index f6f056a..87726a9 100644
--- a/lisp/image/gravatar.el
+++ b/lisp/image/gravatar.el
@@ -277,7 +277,7 @@ where GRAVATAR is either an image descriptor, or the symbol
               ;; Store the image in the cache.
               (when image
                 (setf (gethash mail-address gravatar--cache)
-                      (cons (time-convert (current-time) 'integer)
+                     (cons (time-convert nil 'integer)
                             image)))
               (prog1
                   (apply callback (if data image 'error) cbargs)
@@ -286,7 +286,7 @@ where GRAVATAR is either an image descriptor, or the symbol
 
 (defun gravatar--prune-cache ()
   (let ((expired nil)
-        (time (- (time-convert (current-time) 'integer)
+       (time (- (time-convert nil 'integer)
                  ;; Twelve hours.
                  (* 12 60 60))))
     (maphash (lambda (key val)
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index fe686cb..32edc29 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -2336,19 +2336,14 @@ mapped to mostly alphanumerics for safety."
 
 ;; from a similar function in mail-utils.el
 (defun feedmail-rfc822-time-zone (time)
+  (declare (obsolete format-time-string "29.1"))
   (feedmail-say-debug ">in-> feedmail-rfc822-time-zone %s" time)
-  (let* ((sec (or (car (current-time-zone time)) 0))
-        (absmin (/ (abs sec) 60)))
-    (format "%c%02d%02d" (if (< sec 0) ?- ?+) (/ absmin 60) (% absmin 60))))
+  (format-time-string "%z" time))
 
 (defun feedmail-rfc822-date (arg-time)
   (feedmail-say-debug ">in-> feedmail-rfc822-date %s" arg-time)
-  (let ((time (or arg-time (current-time)))
-       (system-time-locale "C"))
-    (concat
-     (format-time-string "%a, %e %b %Y %T " time)
-     (feedmail-rfc822-time-zone time)
-     )))
+  (let ((system-time-locale "C"))
+    (format-time-string "%a, %e %b %Y %T %z" arg-time)))
 
 (defun feedmail-send-it-immediately-wrapper ()
   "Wrapper to catch skip-me-i."
@@ -2847,10 +2842,9 @@ probably not appropriate for you."
     (if (and (not feedmail-queue-use-send-time-for-message-id) maybe-file)
        (setq date-time (file-attribute-modification-time
                         (file-attributes maybe-file))))
-    (format "<%d-%s%s%s>"
+    (format "<%d-%s%s>"
            (mod (random) 10000)
-           (format-time-string "%a%d%b%Y%H%M%S" date-time)
-           (feedmail-rfc822-time-zone date-time)
+           (format-time-string "%a%d%b%Y%H%M%S%z" date-time)
            end-stuff))
   )
 
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index 3eb3ccb..f1b0590 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -368,19 +368,12 @@ matches may be returned from the message body."
   labels)
 
 (defun mail-rfc822-time-zone (time)
-  (let* ((sec (or (car (current-time-zone time)) 0))
-        (absmin (/ (abs sec) 60)))
-    (format "%c%02d%02d" (if (< sec 0) ?- ?+) (/ absmin 60) (% absmin 60))))
+  (declare (obsolete format-time-string "29.1"))
+  (format-time-string "%z" time))
 
 (defun mail-rfc822-date ()
-  (let* ((time (current-time))
-        (s (current-time-string time)))
-    (string-match "[^ ]+ +\\([^ ]+\\) +\\([^ ]+\\) \\([^ ]+\\) \\([^ ]+\\)" s)
-    (concat (substring s (match-beginning 2) (match-end 2)) " "
-           (substring s (match-beginning 1) (match-end 1)) " "
-           (substring s (match-beginning 4) (match-end 4)) " "
-           (substring s (match-beginning 3) (match-end 3)) " "
-           (mail-rfc822-time-zone time))))
+  (let ((system-time-locale "C"))
+    (format-time-string "%-d %b %Y %T %z")))
 
 (defun mail-mbox-from ()
   "Return an mbox \"From \" line for the current message.
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index d0aff09..d1e8a2f 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1391,8 +1391,7 @@ just append to the file, in Babyl format if necessary."
   (unless (markerp header-end)
     (error "Value of `header-end' must be a marker"))
   (let (fcc-list
-       (mailbuf (current-buffer))
-       (time (current-time)))
+       (mailbuf (current-buffer)))
     (save-excursion
       (goto-char (point-min))
       (let ((case-fold-search t))
@@ -1408,14 +1407,11 @@ just append to the file, in Babyl format if necessary."
       (with-temp-buffer
        ;; This initial newline is not written out if we create a new
        ;; file (see below).
-       (insert "\nFrom " (user-login-name) " " (current-time-string time) "\n")
-       ;; Insert the time zone before the year.
-       (forward-char -1)
-       (forward-word-strictly -1)
        (require 'mail-utils)
-       (insert (mail-rfc822-time-zone time) " ")
-       (goto-char (point-max))
-       (insert "Date: " (message-make-date) "\n")
+       (insert "\nFrom " (user-login-name) " "
+               (let ((system-time-locale "C"))
+                 (format-time-string "%a %b %e %T %z %Y"))
+               "\nDate: " (message-make-date) "\n")
        (insert-buffer-substring mailbuf)
        ;; Make sure messages are separated.
        (goto-char (point-max))
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index 8087df9..d266621 100644
--- a/lisp/mh-e/mh-alias.el
+++ b/lisp/mh-e/mh-alias.el
@@ -67,8 +67,7 @@ Return t if any file listed in the Aliasfile MH profile 
component has
 been modified since the timestamp.
 If ARG is non-nil, set timestamp with the current time."
   (if arg
-      (let ((time (current-time)))
-        (setq mh-alias-tstamp (list (nth 0 time) (nth 1 time))))
+      (setq mh-alias-tstamp (current-time))
     (let ((stamp))
       (car (memq t (mapcar
                     (lambda (file)
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 
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/dbus.el b/lisp/net/dbus.el
index 3fff539..4112497 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -2102,7 +2102,7 @@ has been handled by this function."
           (interface (dbus-event-interface-name event))
           (member (dbus-event-member-name event))
            (arguments (dbus-event-arguments event))
-           (time (time-to-seconds (current-time))))
+          (time (float-time)))
       (save-excursion
         ;; Check for matching method-call.
         (goto-char (point-max))
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/net/sasl.el b/lisp/net/sasl.el
index b7f814f..0a3ecf9 100644
--- a/lisp/net/sasl.el
+++ b/lisp/net/sasl.el
@@ -174,21 +174,24 @@ It contain at least 64 bits of entropy."
 
 ;; stolen (and renamed) from message.el
 (defun sasl-unique-id-function ()
-  ;; Don't use microseconds from (current-time), they may be unsupported.
+  ;; Don't use fractional seconds from timestamp; they may be unsupported.
   ;; Instead we use this randomly inited counter.
   (setq sasl-unique-id-char
-       (% (1+ (or sasl-unique-id-char (logand (random) (1- (ash 1 20)))))
-          ;; (current-time) returns 16-bit ints,
-          ;; and 2^16*25 just fits into 4 digits i base 36.
-          (* 25 25)))
-  (let ((tm (current-time)))
+       ;; 2^16 * 25 just fits into 4 digits i base 36.
+       (let ((base (* 25 25)))
+         (if sasl-unique-id-char
+             (% (1+ sasl-unique-id-char) base)
+           (random base))))
+  (let ((tm (time-convert nil 'integer)))
     (concat
      (sasl-unique-id-number-base36
-      (+ (car   tm)
-        (ash (% sasl-unique-id-char 25) 16)) 4)
+      (+ (ash tm -16)
+        (ash (% sasl-unique-id-char 25) 16))
+      4)
      (sasl-unique-id-number-base36
-      (+ (nth 1 tm)
-        (ash (/ sasl-unique-id-char 25) 16)) 4))))
+      (+ (logand tm #xffff)
+        (ash (/ sasl-unique-id-char 25) 16))
+      4))))
 
 (defun sasl-unique-id-number-base36 (num len)
   (if (if (< len 0)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 22e3142..6d83ae5 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1595,7 +1595,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
       "%s" (if (or (null time)
                   (tramp-compat-time-equal-p time tramp-time-doesnt-exist)
                   (tramp-compat-time-equal-p time tramp-time-dont-know))
-              (current-time)
+              nil
             time)))))
 
 (defun tramp-gvfs-handle-get-remote-uid (vec id-format)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 8d10659..8e66363 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1429,7 +1429,7 @@ of."
             (if (or (null time)
                     (tramp-compat-time-equal-p time tramp-time-doesnt-exist)
                     (tramp-compat-time-equal-p time tramp-time-dont-know))
-                (current-time)
+                nil
               time)))
        (tramp-send-command-and-check
         v (format
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index c91bced..6da00f8 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -534,7 +534,7 @@ the result will be a local, non-Tramp, file name."
           (if (or (null time)
                   (tramp-compat-time-equal-p time tramp-time-doesnt-exist)
                   (tramp-compat-time-equal-p time tramp-time-dont-know))
-              (current-time)
+              nil
             time)))
       (tramp-sudoedit-send-command
        v "env" "TZ=UTC" "touch" "-t"
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index f43c1d8..552788b 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2014,9 +2014,7 @@ ARGUMENTS to actually emit the message (if applicable)."
        (unless (bolp)
          (insert "\n"))
        ;; Timestamp.
-       (let ((now (current-time)))
-         (insert (format-time-string "%T." now))
-         (insert (format "%06d " (nth 2 now))))
+       (insert (format-time-string "%T.%6N "))
        ;; Calling Tramp function.  We suppress compat and trace
        ;; functions from being displayed.
        (let ((btn 1) btf fn)
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index d230ee2..b140df7 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -170,8 +170,7 @@ extension beyond end of line was not controllable."
   (defsubst file-attribute-modification-time (attributes)
     "The modification time in ATTRIBUTES returned by `file-attributes'.
 This is the time of the last change to the file's contents, and
-is a list of integers (HIGH LOW USEC PSEC) in the same style
-as (current-time)."
+is a Lisp timestamp in the same style as `current-time'."
     (nth 5 attributes)))
 
 (unless (fboundp 'file-attribute-size)
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 7722984..2e09f9a 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -133,7 +133,7 @@ This is only effective if supported by your mouse or 
touchpad."
   :type 'float
   :version "29.1")
 
-(defcustom pixel-scroll-precision-large-scroll-height 70
+(defcustom pixel-scroll-precision-large-scroll-height nil
   "Pixels that must be scrolled before an animation is performed.
 Nil means to not interpolate such scrolls."
   :group 'mouse
@@ -441,14 +441,13 @@ the height of the current window."
         (set-window-vscroll nil (+ (window-vscroll nil t)
                                    delta)
                             t)
-      (unless (eq (window-start) desired-start)
-        (set-window-start nil (if (zerop (window-hscroll))
-                                  desired-start
-                                (save-excursion
-                                  (goto-char desired-start)
-                                  (beginning-of-visual-line)
-                                  (point)))
-                          t))
+      (set-window-start nil (if (zerop (window-hscroll))
+                                desired-start
+                              (save-excursion
+                                (goto-char desired-start)
+                                (beginning-of-visual-line)
+                                (point)))
+                        t)
       (set-window-vscroll nil desired-vscroll t))
     (if (and (or (< (point) next-pos))
              (let ((pos-visibility (pos-visible-in-window-p next-pos nil t)))
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)
         (vhdl-template-insert-date))
        (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)
diff --git a/lisp/timezone.el b/lisp/timezone.el
index 2c96343..0fcdbdb 100644
--- a/lisp/timezone.el
+++ b/lisp/timezone.el
@@ -95,10 +95,7 @@ if nil, the local time zone is assumed."
 Optional argument TIMEZONE specifies a time zone."
   (let ((zone
         (if (listp timezone)
-            (let* ((m (timezone-zone-to-minute timezone))
-                   (absm (if (< m 0) (- m) m)))
-              (format "%c%02d%02d"
-                      (if (< m 0) ?- ?+) (/ absm 60) (% absm 60)))
+            (format-time-string "%z" 0 (or timezone 0))
           timezone)))
     (format "%02d %s %04d %s %s"
            day
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 8165d5e..32e4921 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1427,7 +1427,12 @@ These are the commands available for use in the file 
status buffer:
       (vc-dir-refresh)
     ;; FIXME: find a better way to pass the backend to `vc-dir-mode'.
     (let ((use-vc-backend backend))
-      (vc-dir-mode))))
+      (vc-dir-mode)
+      ;; Activate the backend-specific minor mode, if any.
+      (when-let ((minor-mode
+                  (intern-soft (format "vc-dir-%s-mode"
+                                       (downcase (symbol-name backend))))))
+        (funcall minor-mode 1)))))
 
 (defun vc-default-dir-extra-headers (_backend _dir)
   ;; Be loud by default to remind people to add code to display
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 4b6cd93..3ceed36 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -298,12 +298,14 @@ included in the completions."
              (vc-git--run-command-string nil "version")))
         (setq vc-git--program-version
               (if (and version-string
-                       ;; Git for Windows appends ".windows.N" to the
-                       ;; numerical version reported by Git.
-                       (string-match
-                        "git version \\([0-9.]+\\)\\(\\.windows\\.[0-9]+\\)?$"
-                        version-string))
-                  (match-string 1 version-string)
+                       ;; Some Git versions append additional strings
+                       ;; to the numerical version string. E.g., Git
+                       ;; for Windows appends ".windows.N", while Git
+                       ;; for Mac appends " (Apple Git-N)". Capture
+                       ;; numerical version and ignore the rest.
+                       (string-match "git version \\([0-9][0-9.]+\\)"
+                                     version-string))
+                  (string-trim-right (match-string 1 version-string) "\\.")
                 "0")))))
 
 (defun vc-git--git-status-to-vc-state (code-list)
@@ -1870,6 +1872,16 @@ Returns nil if not possible."
                                                       (1- (point-max)))))))
          (and name (not (string= name "undefined")) name))))
 
+(defvar-keymap vc-dir-git-mode-map
+  "z c" #'vc-git-stash
+  "z s" #'vc-git-stash-snapshot)
+
+(define-minor-mode vc-dir-git-mode
+  "A minor mode for git-specific commands in `vc-dir-mode' buffers.
+Also note that there are git stash commands available in the
+\"Stash\" section at the head of the buffer."
+  :lighter " Git")
+
 (provide 'vc-git)
 
 ;;; vc-git.el ends here
diff --git a/test/Makefile.in b/test/Makefile.in
index 51696d7..f2c4958 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -368,7 +368,7 @@ maintainer-clean: distclean bootstrap-clean
 .PHONY: check-declare
 
 check-declare:
-       $(emacs) -l check-declare \
+       $(emacs) --batch -l check-declare \
          --eval '(check-declare-directory "$(srcdir)")'
 
 .PHONY: subdirs subdir-targets generate-test-jobs
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el
index b9d4532..b31f0a9 100644
--- a/test/lisp/autorevert-tests.el
+++ b/test/lisp/autorevert-tests.el
@@ -127,7 +127,7 @@ This expects `auto-revert--messages' to be bound by
 `ert-with-message-capture' before calling."
   ;; Remote files do not cooperate well with timers.  So we count ourselves.
   (let ((ct (current-time)))
-    (while (and (< (float-time (time-subtract (current-time) ct))
+    (while (and (< (float-time (time-subtract nil ct))
                    (auto-revert--timeout))
                 (null (string-match
                        (format-message
@@ -167,7 +167,7 @@ This expects `auto-revert--messages' to be bound by
 
 (defun auto-revert-tests--write-file (text file time-delta &optional append)
   (write-region text nil file append 'no-message)
-  (set-file-times file (time-subtract (current-time) time-delta)))
+  (set-file-times file (time-subtract nil time-delta)))
 
 (ert-deftest auto-revert-test00-auto-revert-mode ()
   "Check autorevert for a file."
@@ -453,7 +453,7 @@ This expects `auto-revert--messages' to be bound by
 (defun auto-revert-test--wait-for (pred max-wait)
   "Wait until PRED is true, or MAX-WAIT seconds elapsed."
   (let ((ct (current-time)))
-    (while (and (< (float-time (time-subtract (current-time) ct)) max-wait)
+    (while (and (< (float-time (time-subtract nil ct)) max-wait)
                 (not (funcall pred)))
       (read-event nil nil 0.1))))
 
diff --git a/test/lisp/calendar/time-date-tests.el 
b/test/lisp/calendar/time-date-tests.el
index d526980..ed842e3 100644
--- a/test/lisp/calendar/time-date-tests.el
+++ b/test/lisp/calendar/time-date-tests.el
@@ -55,13 +55,13 @@
   (should (date-leap-year-p 2004)))
 
 (ert-deftest test-days-to-time ()
-  (should (equal (days-to-time 0) '(0 0)))
-  (should (equal (days-to-time 1) '(1 20864)))
-  (should (equal (days-to-time 999) '(1317 2688)))
-  (should (equal (days-to-time 0.0) '(0 0 0 0)))
-  (should (equal (days-to-time 0.5) '(0 43200 0 0)))
-  (should (equal (days-to-time 1.0) '(1 20864 0 0)))
-  (should (equal (days-to-time 999.0) '(1317 2688 0 0))))
+  (should (time-equal-p (days-to-time 0) '(0 0)))
+  (should (time-equal-p (days-to-time 1) '(1 20864)))
+  (should (time-equal-p (days-to-time 999) '(1317 2688)))
+  (should (time-equal-p (days-to-time 0.0) '(0 0 0 0)))
+  (should (time-equal-p (days-to-time 0.5) '(0 43200 0 0)))
+  (should (time-equal-p (days-to-time 1.0) '(1 20864 0 0)))
+  (should (time-equal-p (days-to-time 999.0) '(1317 2688 0 0))))
 
 (ert-deftest test-seconds-to-string ()
   (should (equal (seconds-to-string 0) "0s"))
@@ -170,7 +170,8 @@
 
 (ert-deftest test-time-since ()
   (should (time-equal-p 0 (time-since nil)))
-  (should (= (cadr (time-since (time-subtract (current-time) 1))) 1)))
+  (should (time-equal-p 1 (time-convert (time-since (time-subtract nil 1))
+                                        'integer))))
 
 (ert-deftest test-time-decoded-period ()
   (should (equal (decoded-time-period '(nil nil 1 nil nil nil nil nil nil))
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 47fa18e..c047f66 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -241,7 +241,7 @@ is greater than 10.
         (progn ,@body)
        (tramp--test-message
        "%s %f sec"
-       ,message (float-time (time-subtract (current-time) start))))))
+       ,message (float-time (time-subtract nil start))))))
 
 ;; `always' is introduced with Emacs 28.1.
 (defalias 'tramp--test-always
diff --git a/test/lisp/vc/vc-git-tests.el b/test/lisp/vc/vc-git-tests.el
new file mode 100644
index 0000000..997ab3c
--- /dev/null
+++ b/test/lisp/vc/vc-git-tests.el
@@ -0,0 +1,67 @@
+;;; vc-git-tests.el --- tests for vc/vc-git.el  -*- lexical-binding:t -*-
+
+;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
+
+;; Author: Justin Schell <justinmschell@gmail.com>
+;; Maintainer: emacs-devel@gnu.org
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'vc-git)
+
+(ert-deftest vc-git-test-program-version-general ()
+  (vc-git-test--run-program-version-test
+   "git version 2.30.1.0"
+   "2.30.1.0"))
+
+(ert-deftest vc-git-test-program-version-windows ()
+  (vc-git-test--run-program-version-test
+   "git version 2.30.1.1.windows.1"
+   "2.30.1.1"))
+
+(ert-deftest vc-git-test-program-version-apple ()
+  (vc-git-test--run-program-version-test
+   "git version 2.30.1.2 (Apple Git-130)"
+   "2.30.1.2"))
+
+(ert-deftest vc-git-test-program-version-other ()
+  (vc-git-test--run-program-version-test
+   "git version 2.30.1.3.foo.bar"
+   "2.30.1.3"))
+
+(ert-deftest vc-git-test-program-version-invalid-leading-string ()
+  (vc-git-test--run-program-version-test
+   "git version foo.bar.2.30.1.4"
+   "0"))
+
+(ert-deftest vc-git-test-program-version-invalid-leading-dot ()
+  (vc-git-test--run-program-version-test
+   "git version .2.30.1.5"
+   "0"))
+
+(defun vc-git-test--run-program-version-test
+    (mock-version-string expected-output)
+  (cl-letf* (((symbol-function 'vc-git--run-command-string)
+              (lambda (_file _args) mock-version-string))
+             (vc-git--program-version nil)
+             (actual-output (vc-git--program-version)))
+    (should (equal actual-output expected-output))))
+
+;;; vc-git-tests.el ends here
diff --git a/test/manual/cedet/cedet-utests.el 
b/test/manual/cedet/cedet-utests.el
index d68b5b8..af6b4de 100644
--- a/test/manual/cedet/cedet-utests.el
+++ b/test/manual/cedet/cedet-utests.el
@@ -252,9 +252,7 @@ Optional argument TITLE is the title of this testing 
session."
 (defun cedet-utest-elapsed-time (start end)
   "Copied from elp.el.  Was elp-elapsed-time.
 Argument START and END bound the time being calculated."
-  (+ (* (- (car end) (car start)) 65536.0)
-     (- (car (cdr end)) (car (cdr start)))
-     (/ (- (car (cdr (cdr end))) (car (cdr (cdr start)))) 1000000.0)))
+  (float-time (time-subtract start end)))
 
 (defun cedet-utest-log-shutdown (title &optional _errorcondition)
   "Shut-down a larger test suite.
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el
index bba9b3f..f801478 100644
--- a/test/src/timefns-tests.el
+++ b/test/src/timefns-tests.el
@@ -242,4 +242,16 @@ a fixed place on the right and are padded on the left."
           (should (= xdiv (float-time (time-convert xdiv t))))))
       (setq x (* x 2)))))
 
+(ert-deftest time-convert-forms ()
+  ;; These computations involve numbers that should have exact
+  ;; representations on any Emacs platform.
+  (dolist (time '(-86400 -1 0 1 86400))
+    (dolist (delta '(0 0.0 0.25 3.25 1000 1000.25))
+      (let ((time+ (+ time delta))
+           (time- (- time delta)))
+       (dolist (form '(nil t list 4 1000 1000000 1000000000))
+         (should (time-equal-p time (time-convert time form)))
+         (should (time-equal-p time- (time-convert time- form)))
+         (should (time-equal-p time+ (time-convert time+ form))))))))
+
 ;;; timefns-tests.el ends here



reply via email to

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