aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2021-12-06 17:24:28 +0800
committerPo Lu2021-12-06 17:24:28 +0800
commit9eba6b966e330a38bdc3fef5e36b8a2904e72785 (patch)
tree4018079e38cd5eb22c33b497cf777784b7647b8e
parent7314c12e64ef5b185e3fd52d8dc1111eb730bdad (diff)
parentc1145c31adf143460911dd87b408d35ea88a1a92 (diff)
downloademacs-9eba6b966e330a38bdc3fef5e36b8a2904e72785.tar.gz
emacs-9eba6b966e330a38bdc3fef5e36b8a2904e72785.zip
Merge remote-tracking branch 'origin/master' into feature/pgtk
-rw-r--r--doc/lispref/text.texi41
-rw-r--r--doc/misc/erc.texi25
-rw-r--r--doc/misc/gnus.texi2
-rw-r--r--lisp/calendar/time-date.el2
-rw-r--r--lisp/dired-aux.el42
-rw-r--r--lisp/emacs-lisp/eieio-opt.el1
-rw-r--r--lisp/emacs-lisp/eieio.el5
-rw-r--r--lisp/emacs-lisp/timer.el4
-rw-r--r--lisp/emacs-lisp/warnings.el4
-rw-r--r--lisp/gnus/gnus-score.el4
-rw-r--r--lisp/gnus/gnus-search.el7
-rw-r--r--lisp/gnus/gnus-sum.el6
-rw-r--r--lisp/gnus/gnus.el6
-rw-r--r--lisp/gnus/message.el31
-rw-r--r--lisp/image-dired.el9
-rw-r--r--lisp/image.el6
-rw-r--r--lisp/image/gravatar.el4
-rw-r--r--lisp/mail/feedmail.el18
-rw-r--r--lisp/mail/mail-utils.el15
-rw-r--r--lisp/mail/sendmail.el14
-rw-r--r--lisp/mh-e/mh-alias.el3
-rw-r--r--lisp/midnight.el2
-rw-r--r--lisp/net/dbus.el2
-rw-r--r--lisp/net/rcirc.el2
-rw-r--r--lisp/net/sasl.el23
-rw-r--r--lisp/net/tramp-gvfs.el2
-rw-r--r--lisp/net/tramp-sh.el2
-rw-r--r--lisp/net/tramp-sudoedit.el2
-rw-r--r--lisp/net/tramp.el4
-rw-r--r--lisp/org/org-compat.el3
-rw-r--r--lisp/pixel-scroll.el17
-rw-r--r--lisp/progmodes/vhdl-mode.el5
-rw-r--r--lisp/timezone.el5
-rw-r--r--lisp/vc/vc-dir.el7
-rw-r--r--lisp/vc/vc-git.el24
-rw-r--r--test/Makefile.in2
-rw-r--r--test/lisp/autorevert-tests.el6
-rw-r--r--test/lisp/calendar/time-date-tests.el17
-rw-r--r--test/lisp/net/tramp-tests.el2
-rw-r--r--test/lisp/vc/vc-git-tests.el67
-rw-r--r--test/manual/cedet/cedet-utests.el4
-rw-r--r--test/src/timefns-tests.el12
42 files changed, 284 insertions, 175 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index b49a9987355..03adb541f9b 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
3722@kindex cursor @r{(text property)} 3722@kindex cursor @r{(text property)}
3723Normally, the cursor is displayed at the beginning or the end of any 3723Normally, the cursor is displayed at the beginning or the end of any
3724overlay and text property strings present at the current buffer 3724overlay and text property strings present at the current buffer
3725position. You can place the cursor on any desired character of these 3725position. You can instead tell Emacs to place the cursor on any
3726strings by giving that character a non-@code{nil} @code{cursor} text 3726desired character of these strings by giving that character a
3727property. In addition, if the value of the @code{cursor} property is 3727non-@code{nil} @code{cursor} text property. In addition, if the value
3728an integer, it specifies the number of buffer's character 3728of the @code{cursor} property is an integer, it specifies the number
3729positions, starting with the position where the overlay or the 3729of buffer's character positions, starting with the position where the
3730@code{display} property begins, for which the cursor should be 3730overlay or the @code{display} property begins, for which the cursor
3731displayed on that character. Specifically, if the value of the 3731should be displayed on that character. Specifically, if the value of
3732@code{cursor} property of a character is the number @var{n}, the 3732the @code{cursor} property of a character is the number @var{n}, the
3733cursor will be displayed on this character for any buffer position in 3733cursor will be displayed on this character for any buffer position in
3734the range @code{[@var{ovpos}..@var{ovpos}+@var{n})}, where @var{ovpos} 3734the range @code{[@var{ovpos}..@var{ovpos}+@var{n})}, where @var{ovpos}
3735is the overlay's starting position given by @code{overlay-start} 3735is the overlay's starting position given by @code{overlay-start}
@@ -3738,14 +3738,23 @@ text property begins in the buffer.
3738 3738
3739In other words, the string character with the @code{cursor} property 3739In other words, the string character with the @code{cursor} property
3740of any non-@code{nil} value is the character where to display the 3740of any non-@code{nil} value is the character where to display the
3741cursor. The value of the property says for which buffer positions to 3741cursor when the overlay or display string make point not visible on
3742display the cursor there. If the value is an integer @var{n}, 3742display. The value of the property says for which buffer positions to
3743the cursor is displayed there when point is anywhere between the 3743display the cursor there. If the value is an integer @var{n}, the
3744beginning of the overlay or @code{display} property and @var{n} 3744cursor is displayed there when point is anywhere between the beginning
3745positions after that. If the value is anything else and 3745of the overlay or @code{display} property and @var{n} positions after
3746non-@code{nil}, the cursor is displayed there only when point is at 3746that. If the value is anything else and non-@code{nil}, the cursor is
3747the beginning of the @code{display} property or at 3747displayed there only when point is at the buffer position that is the
3748@code{overlay-start}. 3748beginning of the @code{display} property, or at @code{overlay-start}
3749if that position is not visible on display. Note that an integer
3750value of the @code{cursor} property could mean that the cursor is
3751displayed on that character even when point is visible on display.
3752
3753One subtlety of this property is that it doesn't work to put this
3754property on a newline character that is part of a display or overlay
3755string. That's because the newline doesn't have a graphic
3756representation on the screen for Emacs to find when it looks for a
3757character on display with that @code{cursor} property.
3749 3758
3750@cindex cursor position for @code{display} properties and overlays 3759@cindex cursor position for @code{display} properties and overlays
3751When the buffer has many overlay strings (e.g., @pxref{Overlay 3760When the buffer has many overlay strings (e.g., @pxref{Overlay
diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi
index 7dbb5f0970d..e7286d2ebe3 100644
--- a/doc/misc/erc.texi
+++ b/doc/misc/erc.texi
@@ -72,7 +72,7 @@ and modified without restriction.
72 72
73Getting Started 73Getting Started
74 74
75* Sample Session:: Example of connecting to the #emacs channel 75* Sample Session:: Example of connecting to the @samp{#emacs} channel
76* Special Features:: Differences from standalone IRC clients 76* Special Features:: Differences from standalone IRC clients
77 77
78Advanced Usage 78Advanced Usage
@@ -159,14 +159,15 @@ customize-variable @key{RET} erc-modules @key{RET}}.
159@section Sample Session 159@section Sample Session
160 160
161This is an example ERC session which shows how to connect to the 161This is an example ERC session which shows how to connect to the
162#emacs channel on Libera.Chat. Another IRC channel on Libera.Chat 162@samp{#emacs} channel on Libera.Chat. Another IRC channel on
163that may be of interest is #erc, which is a channel where ERC users 163Libera.Chat that may be of interest is @samp{#erc}, which is a channel
164and developers hang out. These channels used to live on the Freenode 164where ERC users and developers hang out. These channels used to live
165IRC network until June 2021, when they---along with the official IRC 165on the Freenode IRC network until June 2021, when they---along with
166channels of the GNU Project, the Free Software Foundation, and many 166the official IRC channels of the GNU Project, the Free Software
167other free software communities---relocated to the Libera.Chat network 167Foundation, and many other free software communities---relocated to
168in the aftermath of changes in governance and policies of Freenode in 168the Libera.Chat network in the aftermath of changes in governance and
169May and June 2021. GNU and FSF's announcements about this are at 169policies of Freenode in May and June 2021. GNU and FSF's
170announcements about this are at
170@uref{https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00005.html}, 171@uref{https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00005.html},
171@uref{https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00007.html}, 172@uref{https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00007.html},
172and 173and
@@ -176,7 +177,7 @@ and
176 177
177@item Connect to Libera.Chat 178@item Connect to Libera.Chat
178 179
179Run @kbd{M-x erc}. Use ``irc.libera.chat as the IRC server, ``6667'' 180Run @kbd{M-x erc}. Use ``irc.libera.chat'' as the IRC server, ``6667''
180as the port, and choose a nickname. 181as the port, and choose a nickname.
181 182
182@item Get used to the interface 183@item Get used to the interface
@@ -291,7 +292,7 @@ new command in capital letters.
291If the connection goes away at some point, ERC will try to reconnect 292If the connection goes away at some point, ERC will try to reconnect
292automatically. If it fails to reconnect, and you want to try to 293automatically. If it fails to reconnect, and you want to try to
293manually reestablish the connection at some later point, switch to an 294manually reestablish the connection at some later point, switch to an
294ERC buffer and run the @code{/RECONNECT} command. 295ERC buffer and run the @code{/RECONNECT} command.
295 296
296@end itemize 297@end itemize
297 298
@@ -958,7 +959,7 @@ over the project entirely.''
958So we happily hacked away on ERC, and soon after (September 2001) 959So we happily hacked away on ERC, and soon after (September 2001)
959released the next "stable" version, 2.1. 960released the next "stable" version, 2.1.
960 961
961Most of the development of the new ERC happened on #emacs on 962Most of the development of the new ERC happened on @samp{#emacs} on
962irc.openprojects.net. Over time, many people contributed code, ideas, 963irc.openprojects.net. Over time, many people contributed code, ideas,
963bugfixes, and a lot of alpha/beta/gamma testing. 964bugfixes, and a lot of alpha/beta/gamma testing.
964 965
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 6ffc057ba15..74b5fb442e3 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:
18048 (list 18048 (list
18049 (cons 'query 18049 (cons 'query
18050 (format-time-string "SENTSINCE %d-%b-%Y" 18050 (format-time-string "SENTSINCE %d-%b-%Y"
18051 (time-subtract (current-time) 18051 (time-subtract nil
18052 (days-to-time (car args))))) 18052 (days-to-time (car args)))))
18053 (cons 'criteria ""))) 18053 (cons 'criteria "")))
18054 (group-spec (cadr args))) 18054 (group-spec (cadr args)))
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index 37a16d3b98c..b36171259c0 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -69,7 +69,7 @@ list (HIGH LOW MICRO PICO)."
69 (pop elt))) 69 (pop elt)))
70 (time-value (car elt)) 70 (time-value (car elt))
71 (gensym (make-symbol "time"))) 71 (gensym (make-symbol "time")))
72 `(let* ,(append `((,gensym (or ,time-value (current-time))) 72 `(let* ,(append `((,gensym (or ,time-value (time-convert nil 'list)))
73 (,gensym 73 (,gensym
74 (cond 74 (cond
75 ((integerp ,gensym) 75 ((integerp ,gensym)
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 588551a6417..af7b160c1a4 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1787,13 +1787,46 @@ Special value `always' suppresses confirmation."
1787 "Whether Dired should create destination dirs when copying/removing files. 1787 "Whether Dired should create destination dirs when copying/removing files.
1788If nil, don't create them. 1788If nil, don't create them.
1789If `always', create them without asking. 1789If `always', create them without asking.
1790If `ask', ask for user confirmation." 1790If `ask', ask for user confirmation.
1791
1792Also see `dired-create-destination-dirs-on-trailing-dirsep'."
1791 :type '(choice (const :tag "Never create non-existent dirs" nil) 1793 :type '(choice (const :tag "Never create non-existent dirs" nil)
1792 (const :tag "Always create non-existent dirs" always) 1794 (const :tag "Always create non-existent dirs" always)
1793 (const :tag "Ask for user confirmation" ask)) 1795 (const :tag "Ask for user confirmation" ask))
1794 :group 'dired 1796 :group 'dired
1795 :version "27.1") 1797 :version "27.1")
1796 1798
1799(defcustom dired-create-destination-dirs-on-trailing-dirsep nil
1800 "If non-nil, treat a trailing slash at queried destination dir specially.
1801
1802If this variable is non-nil and a single destination filename is
1803queried which ends in a directory separator (/), it will be
1804treated as a non-existent directory and acted on according to
1805`dired-create-destination-dirs'.
1806
1807This option is only relevant if `dired-create-destination-dirs'
1808is non-nil, too.
1809
1810For example, if both `dired-create-destination-dirs' and this
1811option are non-nil, renaming a directory named `old_name' to
1812`new_name/' (note the trailing directory separator) where
1813`new_name' does not exists already, it will be created and
1814`old_name' be moved into it. If only `new_name' (without the
1815trailing /) is given or this option or
1816`dired-create-destination-dirs' is `nil', `old_name' will be
1817renamed to `new_name'."
1818 :type '(choice
1819 (const :tag
1820 (concat "Do not treat destination dirs with a "
1821 "trailing directory separator specially")
1822 nil)
1823 (const :tag
1824 (concat "Treat destination dirs with trailing "
1825 "directory separator specially")
1826 t))
1827 :group 'dired
1828 :version "29.1")
1829
1797(defun dired-maybe-create-dirs (dir) 1830(defun dired-maybe-create-dirs (dir)
1798 "Create DIR if doesn't exist according to `dired-create-destination-dirs'." 1831 "Create DIR if doesn't exist according to `dired-create-destination-dirs'."
1799 (when (and dired-create-destination-dirs (not (file-exists-p dir))) 1832 (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.
2163 target-dir op-symbol arg rfn-list default)))) 2196 target-dir op-symbol arg rfn-list default))))
2164 (into-dir 2197 (into-dir
2165 (progn 2198 (progn
2166 (unless dired-one-file (dired-maybe-create-dirs target)) 2199 (when
2200 (or
2201 (not dired-one-file)
2202 (and dired-create-destination-dirs-on-trailing-dirsep
2203 (directory-name-p target)))
2204 (dired-maybe-create-dirs target))
2167 (cond ((null how-to) 2205 (cond ((null how-to)
2168 ;; Allow users to change the letter case of 2206 ;; Allow users to change the letter case of
2169 ;; a directory on a case-insensitive 2207 ;; a directory on a case-insensitive
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 9c842f46829..680395387c2 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -130,6 +130,7 @@ are not abstract."
130;;;###autoload 130;;;###autoload
131(defun eieio-help-constructor (ctr) 131(defun eieio-help-constructor (ctr)
132 "Describe CTR if it is a class constructor." 132 "Describe CTR if it is a class constructor."
133 (declare (obsolete "use `describe-function' or `cl--describe-class'." "29.1"))
133 (when (class-p ctr) 134 (when (class-p ctr)
134 (erase-buffer) 135 (erase-buffer)
135 (let ((location (find-lisp-object-file-name ctr 'define-type)) 136 (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 3fbfe011e29..2850c91ecdf 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -992,11 +992,6 @@ of `eq'."
992 (error "EIEIO: `change-class' is unimplemented")) 992 (error "EIEIO: `change-class' is unimplemented"))
993(define-obsolete-function-alias 'change-class #'eieio-change-class "26.1") 993(define-obsolete-function-alias 'change-class #'eieio-change-class "26.1")
994 994
995;; Hook ourselves into help system for describing classes and methods.
996;; FIXME: This is not actually needed any more since we can click on the
997;; hyperlink from the constructor's docstring to see the type definition.
998(add-hook 'help-fns-describe-function-functions #'eieio-help-constructor)
999
1000(provide 'eieio) 995(provide 'eieio)
1001 996
1002;;; eieio.el ends here 997;;; eieio.el ends here
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index 2ac2c992456..c7d02cc7487 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."
314 (not (timer--idle-delay timer))) 314 (not (timer--idle-delay timer)))
315 (setf (timer--time timer) 315 (setf (timer--time timer)
316 (timer-next-integral-multiple-of-time 316 (timer-next-integral-multiple-of-time
317 (current-time) (timer--repeat-delay timer)))) 317 nil (timer--repeat-delay timer))))
318 ;; Place it back on the timer-list before running 318 ;; Place it back on the timer-list before running
319 ;; timer--function, so it can cancel-timer itself. 319 ;; timer--function, so it can cancel-timer itself.
320 (timer-activate timer t cell) 320 (timer-activate timer t cell)
@@ -391,7 +391,7 @@ This function returns a timer object which you can use in
391 391
392 ;; Special case: t means the next integral multiple of REPEAT. 392 ;; Special case: t means the next integral multiple of REPEAT.
393 (when (and (eq time t) repeat) 393 (when (and (eq time t) repeat)
394 (setq time (timer-next-integral-multiple-of-time (current-time) repeat)) 394 (setq time (timer-next-integral-multiple-of-time nil repeat))
395 (setf (timer--integral-multiple timer) t)) 395 (setf (timer--integral-multiple timer) t))
396 396
397 ;; Handle numbers as relative times in seconds. 397 ;; Handle numbers as relative times in seconds.
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 36b275e2d3c..1d061364a03 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -307,7 +307,9 @@ entirely by setting `warning-suppress-types' or
307 'type 'warning-suppress-log-warning 307 'type 'warning-suppress-log-warning
308 'warning-type type)) 308 'warning-type type))
309 (funcall newline) 309 (funcall newline)
310 (when (and warning-fill-prefix (not (string-search "\n" message))) 310 (when (and warning-fill-prefix
311 (not (string-search "\n" message))
312 (not noninteractive))
311 (let ((fill-prefix warning-fill-prefix) 313 (let ((fill-prefix warning-fill-prefix)
312 (fill-column warning-fill-column)) 314 (fill-column warning-fill-column))
313 (fill-region start (point)))) 315 (fill-region start (point))))
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index d031047804a..a25673a0e75 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -1749,7 +1749,7 @@ score in `gnus-newsgroup-scored' by SCORE."
1749 (setq type 'after 1749 (setq type 'after
1750 match-func 'string< 1750 match-func 'string<
1751 match (gnus-time-iso8601 1751 match (gnus-time-iso8601
1752 (time-subtract (current-time) 1752 (time-subtract nil
1753 (* 86400 (nth 0 kill)))))) 1753 (* 86400 (nth 0 kill))))))
1754 ((eq type 'before) 1754 ((eq type 'before)
1755 (setq match-func 'gnus-string> 1755 (setq match-func 'gnus-string>
@@ -1758,7 +1758,7 @@ score in `gnus-newsgroup-scored' by SCORE."
1758 (setq type 'before 1758 (setq type 'before
1759 match-func 'gnus-string> 1759 match-func 'gnus-string>
1760 match (gnus-time-iso8601 1760 match (gnus-time-iso8601
1761 (time-subtract (current-time) 1761 (time-subtract nil
1762 (* 86400 (nth 0 kill)))))) 1762 (* 86400 (nth 0 kill))))))
1763 ((eq type 'at) 1763 ((eq type 'at)
1764 (setq match-func 'string= 1764 (setq match-func 'string=
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index c77de688e66..a79c106062c 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."
572 ;; Time parsing doesn't seem to work with slashes. 572 ;; Time parsing doesn't seem to work with slashes.
573 (let ((value (string-replace "/" "-" value)) 573 (let ((value (string-replace "/" "-" value))
574 (now (append '(0 0 0) 574 (now (append '(0 0 0)
575 (seq-subseq (decode-time (or rel-date 575 (seq-subseq (decode-time rel-date) 3))))
576 (current-time)))
577 3))))
578 ;; Check for relative time parsing. 576 ;; Check for relative time parsing.
579 (if (string-match "\\([[:digit:]]+\\)\\([dwmy]\\)" value) 577 (if (string-match "\\([[:digit:]]+\\)\\([dwmy]\\)" value)
580 (seq-subseq 578 (seq-subseq
@@ -1239,8 +1237,7 @@ nil (except that (dd nil yyyy) is not allowed). Massage those
1239numbers into the most recent past occurrence of whichever date 1237numbers into the most recent past occurrence of whichever date
1240elements are present." 1238elements are present."
1241 (pcase-let ((`(,nday ,nmonth ,nyear) 1239 (pcase-let ((`(,nday ,nmonth ,nyear)
1242 (seq-subseq (decode-time (current-time)) 1240 (seq-subseq (decode-time) 3 6))
1243 3 6))
1244 (`(,dday ,dmonth ,dyear) date)) 1241 (`(,dday ,dmonth ,dyear) date))
1245 (unless (and dday dmonth dyear) 1242 (unless (and dday dmonth dyear)
1246 (unless dday (setq dday 1)) 1243 (unless dday (setq dday 1))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index dcdf3d977df..ba616586002 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.
3968Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"." 3968Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
3969 (condition-case () 3969 (condition-case ()
3970 (let* ((messy-date (gnus-date-get-time messy-date)) 3970 (let* ((messy-date (gnus-date-get-time messy-date))
3971 (now (current-time))
3972 ;;If we don't find something suitable we'll use this one 3971 ;;If we don't find something suitable we'll use this one
3973 (my-format "%b %d '%y")) 3972 (my-format "%b %d '%y"))
3974 (let* ((difference (time-subtract now messy-date)) 3973 (let* ((difference (time-subtract nil messy-date))
3975 (templist gnus-user-date-format-alist) 3974 (templist gnus-user-date-format-alist)
3976 (top (eval (caar templist) t))) 3975 (top (eval (caar templist) t)))
3977 (while (if (numberp top) (time-less-p top difference) (not top)) 3976 (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."
10496 "Create an article in a mail newsgroup." 10495 "Create an article in a mail newsgroup."
10497 (interactive nil gnus-summary-mode) 10496 (interactive nil gnus-summary-mode)
10498 (let ((group gnus-newsgroup-name) 10497 (let ((group gnus-newsgroup-name)
10499 (now (current-time))
10500 group-art) 10498 group-art)
10501 (unless (gnus-check-backend-function 'request-accept-article group) 10499 (unless (gnus-check-backend-function 'request-accept-article group)
10502 (error "%s does not support article importing" group)) 10500 (error "%s does not support article importing" group))
@@ -10506,7 +10504,7 @@ latter case, they will be copied into the relevant groups."
10506 ;; This doesn't look like an article, so we fudge some headers. 10504 ;; This doesn't look like an article, so we fudge some headers.
10507 (insert "From: " (read-string "From: ") "\n" 10505 (insert "From: " (read-string "From: ") "\n"
10508 "Subject: " (read-string "Subject: ") "\n" 10506 "Subject: " (read-string "Subject: ") "\n"
10509 "Date: " (message-make-date now) "\n" 10507 "Date: " (message-make-date) "\n"
10510 "Message-ID: " (message-make-message-id) "\n") 10508 "Message-ID: " (message-make-message-id) "\n")
10511 (setq group-art (gnus-request-accept-article group nil t)) 10509 (setq group-art (gnus-request-accept-article group nil t))
10512 (kill-buffer (current-buffer))) 10510 (kill-buffer (current-buffer)))
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 56934dfa15d..afe07ee46f9 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -3150,9 +3150,9 @@ g -- Group name."
3150 "Check whether GROUP supports function FUNC. 3150 "Check whether GROUP supports function FUNC.
3151GROUP can either be a string (a group name) or a select method." 3151GROUP can either be a string (a group name) or a select method."
3152 (ignore-errors 3152 (ignore-errors
3153 (let ((method (if (stringp group) 3153 (when-let ((method (if (stringp group)
3154 (car (gnus-find-method-for-group group)) 3154 (car (gnus-find-method-for-group group))
3155 group))) 3155 group)))
3156 (unless (featurep method) 3156 (unless (featurep method)
3157 (require method)) 3157 (require method))
3158 (fboundp (intern (format "%s-%s" method func)))))) 3158 (fboundp (intern (format "%s-%s" method func))))))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 562bc64f6fb..c2d14296f94 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -5828,15 +5828,15 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
5828;; You might for example insert a "." somewhere (not next to another dot 5828;; You might for example insert a "." somewhere (not next to another dot
5829;; or string boundary), or modify the "fsf" string. 5829;; or string boundary), or modify the "fsf" string.
5830(defun message-unique-id () 5830(defun message-unique-id ()
5831 ;; Don't use microseconds from (current-time), they may be unsupported. 5831 ;; Don't use fractional seconds from timestamp; they may be unsupported.
5832 ;; Instead we use this randomly inited counter. 5832 ;; Instead we use this randomly inited counter.
5833 (setq message-unique-id-char 5833 (setq message-unique-id-char
5834 (% (1+ (or message-unique-id-char 5834 ;; 2^16 * 25 just fits into 4 digits i base 36.
5835 (random (ash 1 20)))) 5835 (let ((base (* 25 25)))
5836 ;; (current-time) returns 16-bit ints, 5836 (if message-unique-id-char
5837 ;; and 2^16*25 just fits into 4 digits i base 36. 5837 (% (1+ message-unique-id-char) base)
5838 (* 25 25))) 5838 (random base))))
5839 (let ((tm (current-time))) 5839 (let ((tm (time-convert nil 'integer)))
5840 (concat 5840 (concat
5841 (if (or (eq system-type 'ms-dos) 5841 (if (or (eq system-type 'ms-dos)
5842 ;; message-number-base36 doesn't handle bigints. 5842 ;; message-number-base36 doesn't handle bigints.
@@ -5846,10 +5846,12 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
5846 (aset user (match-beginning 0) ?_)) 5846 (aset user (match-beginning 0) ?_))
5847 user) 5847 user)
5848 (message-number-base36 (user-uid) -1)) 5848 (message-number-base36 (user-uid) -1))
5849 (message-number-base36 (+ (car tm) 5849 (message-number-base36 (+ (ash tm -16)
5850 (ash (% message-unique-id-char 25) 16)) 4) 5850 (ash (% message-unique-id-char 25) 16))
5851 (message-number-base36 (+ (nth 1 tm) 5851 4)
5852 (ash (/ message-unique-id-char 25) 16)) 4) 5852 (message-number-base36 (+ (logand tm #xffff)
5853 (ash (/ message-unique-id-char 25) 16))
5854 4)
5853 ;; Append a given name, because while the generated ID is unique 5855 ;; Append a given name, because while the generated ID is unique
5854 ;; to this newsreader, other newsreaders might otherwise generate 5856 ;; to this newsreader, other newsreaders might otherwise generate
5855 ;; the same ID via another algorithm. 5857 ;; the same ID via another algorithm.
@@ -5946,12 +5948,9 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
5946 5948
5947(defun message-make-expires () 5949(defun message-make-expires ()
5948 "Return an Expires header based on `message-expires'." 5950 "Return an Expires header based on `message-expires'."
5949 (let ((current (current-time)) 5951 (let ((future (* 60 60 24 message-expires)))
5950 (future (* 1.0 message-expires 60 60 24)))
5951 ;; Add the future to current. 5952 ;; Add the future to current.
5952 (setcar current (+ (car current) (round (/ future (expt 2 16))))) 5953 (message-make-date (time-add nil future))))
5953 (setcar (cdr current) (+ (nth 1 current) (% (round future) (expt 2 16))))
5954 (message-make-date current)))
5955 5954
5956(defun message-make-path () 5955(defun message-make-path ()
5957 "Return uucp path." 5956 "Return uucp path."
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 47a44a4a60e..fe0c3b7c226 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -540,7 +540,7 @@ Create the thumbnail directory if it does not exist."
540 540
541(defun image-dired-get-thumbnail-image (file) 541(defun image-dired-get-thumbnail-image (file)
542 "Return the image descriptor for a thumbnail of image file FILE." 542 "Return the image descriptor for a thumbnail of image file FILE."
543 (unless (string-match (image-file-name-regexp) file) 543 (unless (string-match-p (image-file-name-regexp) file)
544 (error "%s is not a valid image file" file)) 544 (error "%s is not a valid image file" file))
545 (let* ((thumb-file (image-dired-thumb-name file)) 545 (let* ((thumb-file (image-dired-thumb-name file))
546 (thumb-attr (file-attributes thumb-file))) 546 (thumb-attr (file-attributes thumb-file)))
@@ -768,7 +768,7 @@ and remove the cached thumbnail files between each trial run.")
768 (image-dired-debug-message 768 (image-dired-debug-message
769 (format-time-string 769 (format-time-string
770 "Generated thumbnails in %s.%3N seconds" 770 "Generated thumbnails in %s.%3N seconds"
771 (time-subtract (current-time) 771 (time-subtract nil
772 image-dired--generate-thumbs-start)))) 772 image-dired--generate-thumbs-start))))
773 (if (not (and (eq (process-status process) 'exit) 773 (if (not (and (eq (process-status process) 'exit)
774 (zerop (process-exit-status process)))) 774 (zerop (process-exit-status process))))
@@ -1593,11 +1593,6 @@ You probably want to use this together with
1593 (define-key map [down-mouse-1] #'image-dired-mouse-select-thumbnail) 1593 (define-key map [down-mouse-1] #'image-dired-mouse-select-thumbnail)
1594 (define-key map [down-mouse-2] #'image-dired-mouse-select-thumbnail) 1594 (define-key map [down-mouse-2] #'image-dired-mouse-select-thumbnail)
1595 (define-key map [down-mouse-3] #'image-dired-mouse-select-thumbnail) 1595 (define-key map [down-mouse-3] #'image-dired-mouse-select-thumbnail)
1596 ;; Let's disable mouse dragging, as it currently doesn't do
1597 ;; anything useful.
1598 (define-key map [drag-mouse-1] #'ignore)
1599 (define-key map [drag-mouse-2] #'ignore)
1600 (define-key map [drag-mouse-3] #'ignore)
1601 ;; Seems I must first set C-down-mouse-1 to undefined, or else it 1596 ;; Seems I must first set C-down-mouse-1 to undefined, or else it
1602 ;; will trigger the buffer menu. If I try to instead bind 1597 ;; will trigger the buffer menu. If I try to instead bind
1603 ;; C-down-mouse-1 to `image-dired-mouse-toggle-mark', I get a message 1598 ;; 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 87fab80aad8..cedefc038f0 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."
953 (progn 953 (progn
954 (message "Stopping animation; animation possibly too big") 954 (message "Stopping animation; animation possibly too big")
955 nil))) 955 nil)))
956 (image-show-frame image n t) 956 (let* ((time (prog1 (current-time)
957 (let* ((speed (image-animate-get-speed image)) 957 (image-show-frame image n t)))
958 (time (current-time)) 958 (speed (image-animate-get-speed image))
959 (time-to-load-image (time-since time)) 959 (time-to-load-image (time-since time))
960 (stated-delay-time 960 (stated-delay-time
961 (/ (or (cdr (plist-get (cdr image) :animate-multi-frame-data)) 961 (/ (or (cdr (plist-get (cdr image) :animate-multi-frame-data))
diff --git a/lisp/image/gravatar.el b/lisp/image/gravatar.el
index f6f056a2baf..87726a9b8c8 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
277 ;; Store the image in the cache. 277 ;; Store the image in the cache.
278 (when image 278 (when image
279 (setf (gethash mail-address gravatar--cache) 279 (setf (gethash mail-address gravatar--cache)
280 (cons (time-convert (current-time) 'integer) 280 (cons (time-convert nil 'integer)
281 image))) 281 image)))
282 (prog1 282 (prog1
283 (apply callback (if data image 'error) cbargs) 283 (apply callback (if data image 'error) cbargs)
@@ -286,7 +286,7 @@ where GRAVATAR is either an image descriptor, or the symbol
286 286
287(defun gravatar--prune-cache () 287(defun gravatar--prune-cache ()
288 (let ((expired nil) 288 (let ((expired nil)
289 (time (- (time-convert (current-time) 'integer) 289 (time (- (time-convert nil 'integer)
290 ;; Twelve hours. 290 ;; Twelve hours.
291 (* 12 60 60)))) 291 (* 12 60 60))))
292 (maphash (lambda (key val) 292 (maphash (lambda (key val)
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index fe686cb6f86..32edc292619 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -2336,19 +2336,14 @@ mapped to mostly alphanumerics for safety."
2336 2336
2337;; from a similar function in mail-utils.el 2337;; from a similar function in mail-utils.el
2338(defun feedmail-rfc822-time-zone (time) 2338(defun feedmail-rfc822-time-zone (time)
2339 (declare (obsolete format-time-string "29.1"))
2339 (feedmail-say-debug ">in-> feedmail-rfc822-time-zone %s" time) 2340 (feedmail-say-debug ">in-> feedmail-rfc822-time-zone %s" time)
2340 (let* ((sec (or (car (current-time-zone time)) 0)) 2341 (format-time-string "%z" time))
2341 (absmin (/ (abs sec) 60)))
2342 (format "%c%02d%02d" (if (< sec 0) ?- ?+) (/ absmin 60) (% absmin 60))))
2343 2342
2344(defun feedmail-rfc822-date (arg-time) 2343(defun feedmail-rfc822-date (arg-time)
2345 (feedmail-say-debug ">in-> feedmail-rfc822-date %s" arg-time) 2344 (feedmail-say-debug ">in-> feedmail-rfc822-date %s" arg-time)
2346 (let ((time (or arg-time (current-time))) 2345 (let ((system-time-locale "C"))
2347 (system-time-locale "C")) 2346 (format-time-string "%a, %e %b %Y %T %z" arg-time)))
2348 (concat
2349 (format-time-string "%a, %e %b %Y %T " time)
2350 (feedmail-rfc822-time-zone time)
2351 )))
2352 2347
2353(defun feedmail-send-it-immediately-wrapper () 2348(defun feedmail-send-it-immediately-wrapper ()
2354 "Wrapper to catch skip-me-i." 2349 "Wrapper to catch skip-me-i."
@@ -2847,10 +2842,9 @@ probably not appropriate for you."
2847 (if (and (not feedmail-queue-use-send-time-for-message-id) maybe-file) 2842 (if (and (not feedmail-queue-use-send-time-for-message-id) maybe-file)
2848 (setq date-time (file-attribute-modification-time 2843 (setq date-time (file-attribute-modification-time
2849 (file-attributes maybe-file)))) 2844 (file-attributes maybe-file))))
2850 (format "<%d-%s%s%s>" 2845 (format "<%d-%s%s>"
2851 (mod (random) 10000) 2846 (mod (random) 10000)
2852 (format-time-string "%a%d%b%Y%H%M%S" date-time) 2847 (format-time-string "%a%d%b%Y%H%M%S%z" date-time)
2853 (feedmail-rfc822-time-zone date-time)
2854 end-stuff)) 2848 end-stuff))
2855 ) 2849 )
2856 2850
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index 3eb3ccb93de..f1b0590bec7 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."
368 labels) 368 labels)
369 369
370(defun mail-rfc822-time-zone (time) 370(defun mail-rfc822-time-zone (time)
371 (let* ((sec (or (car (current-time-zone time)) 0)) 371 (declare (obsolete format-time-string "29.1"))
372 (absmin (/ (abs sec) 60))) 372 (format-time-string "%z" time))
373 (format "%c%02d%02d" (if (< sec 0) ?- ?+) (/ absmin 60) (% absmin 60))))
374 373
375(defun mail-rfc822-date () 374(defun mail-rfc822-date ()
376 (let* ((time (current-time)) 375 (let ((system-time-locale "C"))
377 (s (current-time-string time))) 376 (format-time-string "%-d %b %Y %T %z")))
378 (string-match "[^ ]+ +\\([^ ]+\\) +\\([^ ]+\\) \\([^ ]+\\) \\([^ ]+\\)" s)
379 (concat (substring s (match-beginning 2) (match-end 2)) " "
380 (substring s (match-beginning 1) (match-end 1)) " "
381 (substring s (match-beginning 4) (match-end 4)) " "
382 (substring s (match-beginning 3) (match-end 3)) " "
383 (mail-rfc822-time-zone time))))
384 377
385(defun mail-mbox-from () 378(defun mail-mbox-from ()
386 "Return an mbox \"From \" line for the current message. 379 "Return an mbox \"From \" line for the current message.
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index d0aff093dfe..d1e8a2f3c69 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."
1391 (unless (markerp header-end) 1391 (unless (markerp header-end)
1392 (error "Value of `header-end' must be a marker")) 1392 (error "Value of `header-end' must be a marker"))
1393 (let (fcc-list 1393 (let (fcc-list
1394 (mailbuf (current-buffer)) 1394 (mailbuf (current-buffer)))
1395 (time (current-time)))
1396 (save-excursion 1395 (save-excursion
1397 (goto-char (point-min)) 1396 (goto-char (point-min))
1398 (let ((case-fold-search t)) 1397 (let ((case-fold-search t))
@@ -1408,14 +1407,11 @@ just append to the file, in Babyl format if necessary."
1408 (with-temp-buffer 1407 (with-temp-buffer
1409 ;; This initial newline is not written out if we create a new 1408 ;; This initial newline is not written out if we create a new
1410 ;; file (see below). 1409 ;; file (see below).
1411 (insert "\nFrom " (user-login-name) " " (current-time-string time) "\n")
1412 ;; Insert the time zone before the year.
1413 (forward-char -1)
1414 (forward-word-strictly -1)
1415 (require 'mail-utils) 1410 (require 'mail-utils)
1416 (insert (mail-rfc822-time-zone time) " ") 1411 (insert "\nFrom " (user-login-name) " "
1417 (goto-char (point-max)) 1412 (let ((system-time-locale "C"))
1418 (insert "Date: " (message-make-date) "\n") 1413 (format-time-string "%a %b %e %T %z %Y"))
1414 "\nDate: " (message-make-date) "\n")
1419 (insert-buffer-substring mailbuf) 1415 (insert-buffer-substring mailbuf)
1420 ;; Make sure messages are separated. 1416 ;; Make sure messages are separated.
1421 (goto-char (point-max)) 1417 (goto-char (point-max))
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index 8087df97c94..d2666211002 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
67been modified since the timestamp. 67been modified since the timestamp.
68If ARG is non-nil, set timestamp with the current time." 68If ARG is non-nil, set timestamp with the current time."
69 (if arg 69 (if arg
70 (let ((time (current-time))) 70 (setq mh-alias-tstamp (current-time))
71 (setq mh-alias-tstamp (list (nth 0 time) (nth 1 time))))
72 (let ((stamp)) 71 (let ((stamp))
73 (car (memq t (mapcar 72 (car (memq t (mapcar
74 (lambda (file) 73 (lambda (file)
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
159displayed (can be nil if the buffer was never displayed) and its 159displayed (can be nil if the buffer was never displayed) and its
160lifetime, i.e., its \"age\" when it will be purged." 160lifetime, i.e., its \"age\" when it will be purged."
161 (interactive) 161 (interactive)
162 (let ((tm (current-time)) bts (ts (format-time-string "%Y-%m-%d %T")) 162 (let* ((tm (current-time)) bts (ts (format-time-string "%Y-%m-%d %T" tm))
163 delay cbld bn) 163 delay cbld bn)
164 (dolist (buf (buffer-list)) 164 (dolist (buf (buffer-list))
165 (when (buffer-live-p buf) 165 (when (buffer-live-p buf)
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index 3fff5398c06..411249767f5 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -2102,7 +2102,7 @@ has been handled by this function."
2102 (interface (dbus-event-interface-name event)) 2102 (interface (dbus-event-interface-name event))
2103 (member (dbus-event-member-name event)) 2103 (member (dbus-event-member-name event))
2104 (arguments (dbus-event-arguments event)) 2104 (arguments (dbus-event-arguments event))
2105 (time (time-to-seconds (current-time)))) 2105 (time (float-time)))
2106 (save-excursion 2106 (save-excursion
2107 ;; Check for matching method-call. 2107 ;; Check for matching method-call.
2108 (goto-char (point-max)) 2108 (goto-char (point-max))
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."
716 (setq rcirc-nick-table (make-hash-table :test 'equal)) 716 (setq rcirc-nick-table (make-hash-table :test 'equal))
717 (setq rcirc-nick nick) 717 (setq rcirc-nick nick)
718 (setq rcirc-startup-channels startup-channels) 718 (setq rcirc-startup-channels startup-channels)
719 (setq rcirc-last-server-message-time (current-time))
720 (setq rcirc-last-connect-time (current-time)) 719 (setq rcirc-last-connect-time (current-time))
720 (setq rcirc-last-server-message-time rcirc-last-connect-time)
721 721
722 ;; Check if the immediate process state 722 ;; Check if the immediate process state
723 (sit-for .1) 723 (sit-for .1)
diff --git a/lisp/net/sasl.el b/lisp/net/sasl.el
index b7f814f7237..0a3ecf9f534 100644
--- a/lisp/net/sasl.el
+++ b/lisp/net/sasl.el
@@ -174,21 +174,24 @@ It contain at least 64 bits of entropy."
174 174
175;; stolen (and renamed) from message.el 175;; stolen (and renamed) from message.el
176(defun sasl-unique-id-function () 176(defun sasl-unique-id-function ()
177 ;; Don't use microseconds from (current-time), they may be unsupported. 177 ;; Don't use fractional seconds from timestamp; they may be unsupported.
178 ;; Instead we use this randomly inited counter. 178 ;; Instead we use this randomly inited counter.
179 (setq sasl-unique-id-char 179 (setq sasl-unique-id-char
180 (% (1+ (or sasl-unique-id-char (logand (random) (1- (ash 1 20))))) 180 ;; 2^16 * 25 just fits into 4 digits i base 36.
181 ;; (current-time) returns 16-bit ints, 181 (let ((base (* 25 25)))
182 ;; and 2^16*25 just fits into 4 digits i base 36. 182 (if sasl-unique-id-char
183 (* 25 25))) 183 (% (1+ sasl-unique-id-char) base)
184 (let ((tm (current-time))) 184 (random base))))
185 (let ((tm (time-convert nil 'integer)))
185 (concat 186 (concat
186 (sasl-unique-id-number-base36 187 (sasl-unique-id-number-base36
187 (+ (car tm) 188 (+ (ash tm -16)
188 (ash (% sasl-unique-id-char 25) 16)) 4) 189 (ash (% sasl-unique-id-char 25) 16))
190 4)
189 (sasl-unique-id-number-base36 191 (sasl-unique-id-number-base36
190 (+ (nth 1 tm) 192 (+ (logand tm #xffff)
191 (ash (/ sasl-unique-id-char 25) 16)) 4)))) 193 (ash (/ sasl-unique-id-char 25) 16))
194 4))))
192 195
193(defun sasl-unique-id-number-base36 (num len) 196(defun sasl-unique-id-number-base36 (num len)
194 (if (if (< len 0) 197 (if (if (< len 0)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 22e31428a76..6d83ae59b06 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."
1595 "%s" (if (or (null time) 1595 "%s" (if (or (null time)
1596 (tramp-compat-time-equal-p time tramp-time-doesnt-exist) 1596 (tramp-compat-time-equal-p time tramp-time-doesnt-exist)
1597 (tramp-compat-time-equal-p time tramp-time-dont-know)) 1597 (tramp-compat-time-equal-p time tramp-time-dont-know))
1598 (current-time) 1598 nil
1599 time))))) 1599 time)))))
1600 1600
1601(defun tramp-gvfs-handle-get-remote-uid (vec id-format) 1601(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 8d106591af3..8e66363f03a 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1429,7 +1429,7 @@ of."
1429 (if (or (null time) 1429 (if (or (null time)
1430 (tramp-compat-time-equal-p time tramp-time-doesnt-exist) 1430 (tramp-compat-time-equal-p time tramp-time-doesnt-exist)
1431 (tramp-compat-time-equal-p time tramp-time-dont-know)) 1431 (tramp-compat-time-equal-p time tramp-time-dont-know))
1432 (current-time) 1432 nil
1433 time))) 1433 time)))
1434 (tramp-send-command-and-check 1434 (tramp-send-command-and-check
1435 v (format 1435 v (format
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index c91bced656c..6da00f812da 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."
534 (if (or (null time) 534 (if (or (null time)
535 (tramp-compat-time-equal-p time tramp-time-doesnt-exist) 535 (tramp-compat-time-equal-p time tramp-time-doesnt-exist)
536 (tramp-compat-time-equal-p time tramp-time-dont-know)) 536 (tramp-compat-time-equal-p time tramp-time-dont-know))
537 (current-time) 537 nil
538 time))) 538 time)))
539 (tramp-sudoedit-send-command 539 (tramp-sudoedit-send-command
540 v "env" "TZ=UTC" "touch" "-t" 540 v "env" "TZ=UTC" "touch" "-t"
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index f43c1d84b87..552788b4615 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2014,9 +2014,7 @@ ARGUMENTS to actually emit the message (if applicable)."
2014 (unless (bolp) 2014 (unless (bolp)
2015 (insert "\n")) 2015 (insert "\n"))
2016 ;; Timestamp. 2016 ;; Timestamp.
2017 (let ((now (current-time))) 2017 (insert (format-time-string "%T.%6N "))
2018 (insert (format-time-string "%T." now))
2019 (insert (format "%06d " (nth 2 now))))
2020 ;; Calling Tramp function. We suppress compat and trace 2018 ;; Calling Tramp function. We suppress compat and trace
2021 ;; functions from being displayed. 2019 ;; functions from being displayed.
2022 (let ((btn 1) btf fn) 2020 (let ((btn 1) btf fn)
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index d230ee2b11f..b140df76223 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."
170 (defsubst file-attribute-modification-time (attributes) 170 (defsubst file-attribute-modification-time (attributes)
171 "The modification time in ATTRIBUTES returned by `file-attributes'. 171 "The modification time in ATTRIBUTES returned by `file-attributes'.
172This is the time of the last change to the file's contents, and 172This is the time of the last change to the file's contents, and
173is a list of integers (HIGH LOW USEC PSEC) in the same style 173is a Lisp timestamp in the same style as `current-time'."
174as (current-time)."
175 (nth 5 attributes))) 174 (nth 5 attributes)))
176 175
177(unless (fboundp 'file-attribute-size) 176(unless (fboundp 'file-attribute-size)
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 77229844246..2e09f9af2d4 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."
133 :type 'float 133 :type 'float
134 :version "29.1") 134 :version "29.1")
135 135
136(defcustom pixel-scroll-precision-large-scroll-height 70 136(defcustom pixel-scroll-precision-large-scroll-height nil
137 "Pixels that must be scrolled before an animation is performed. 137 "Pixels that must be scrolled before an animation is performed.
138Nil means to not interpolate such scrolls." 138Nil means to not interpolate such scrolls."
139 :group 'mouse 139 :group 'mouse
@@ -441,14 +441,13 @@ the height of the current window."
441 (set-window-vscroll nil (+ (window-vscroll nil t) 441 (set-window-vscroll nil (+ (window-vscroll nil t)
442 delta) 442 delta)
443 t) 443 t)
444 (unless (eq (window-start) desired-start) 444 (set-window-start nil (if (zerop (window-hscroll))
445 (set-window-start nil (if (zerop (window-hscroll)) 445 desired-start
446 desired-start 446 (save-excursion
447 (save-excursion 447 (goto-char desired-start)
448 (goto-char desired-start) 448 (beginning-of-visual-line)
449 (beginning-of-visual-line) 449 (point)))
450 (point))) 450 t)
451 t))
452 (set-window-vscroll nil desired-vscroll t)) 451 (set-window-vscroll nil desired-vscroll t))
453 (if (and (or (< (point) next-pos)) 452 (if (and (or (< (point) next-pos))
454 (let ((pos-visibility (pos-visible-in-window-p next-pos nil t))) 453 (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 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."
10683 (replace-match "" t t) 10683 (replace-match "" t t)
10684 (vhdl-template-insert-date)) 10684 (vhdl-template-insert-date))
10685 (goto-char beg) 10685 (goto-char beg)
10686 (while (search-forward "<year>" end t) 10686 (let ((year (format-time-string "%Y")))
10687 (replace-match (format-time-string "%Y" nil) t t)) 10687 (while (search-forward "<year>" end t)
10688 (replace-match year t t)))
10688 (goto-char beg) 10689 (goto-char beg)
10689 (when file-title 10690 (when file-title
10690 (while (search-forward "<title string>" end t) 10691 (while (search-forward "<title string>" end t)
diff --git a/lisp/timezone.el b/lisp/timezone.el
index 2c96343a74b..0fcdbdbc16c 100644
--- a/lisp/timezone.el
+++ b/lisp/timezone.el
@@ -95,10 +95,7 @@ if nil, the local time zone is assumed."
95Optional argument TIMEZONE specifies a time zone." 95Optional argument TIMEZONE specifies a time zone."
96 (let ((zone 96 (let ((zone
97 (if (listp timezone) 97 (if (listp timezone)
98 (let* ((m (timezone-zone-to-minute timezone)) 98 (format-time-string "%z" 0 (or timezone 0))
99 (absm (if (< m 0) (- m) m)))
100 (format "%c%02d%02d"
101 (if (< m 0) ?- ?+) (/ absm 60) (% absm 60)))
102 timezone))) 99 timezone)))
103 (format "%02d %s %04d %s %s" 100 (format "%02d %s %04d %s %s"
104 day 101 day
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 8165d5e09f1..32e492171d3 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:
1427 (vc-dir-refresh) 1427 (vc-dir-refresh)
1428 ;; FIXME: find a better way to pass the backend to `vc-dir-mode'. 1428 ;; FIXME: find a better way to pass the backend to `vc-dir-mode'.
1429 (let ((use-vc-backend backend)) 1429 (let ((use-vc-backend backend))
1430 (vc-dir-mode)))) 1430 (vc-dir-mode)
1431 ;; Activate the backend-specific minor mode, if any.
1432 (when-let ((minor-mode
1433 (intern-soft (format "vc-dir-%s-mode"
1434 (downcase (symbol-name backend))))))
1435 (funcall minor-mode 1)))))
1431 1436
1432(defun vc-default-dir-extra-headers (_backend _dir) 1437(defun vc-default-dir-extra-headers (_backend _dir)
1433 ;; Be loud by default to remind people to add code to display 1438 ;; 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 4b6cd930744..3ceed365ee0 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -298,12 +298,14 @@ included in the completions."
298 (vc-git--run-command-string nil "version"))) 298 (vc-git--run-command-string nil "version")))
299 (setq vc-git--program-version 299 (setq vc-git--program-version
300 (if (and version-string 300 (if (and version-string
301 ;; Git for Windows appends ".windows.N" to the 301 ;; Some Git versions append additional strings
302 ;; numerical version reported by Git. 302 ;; to the numerical version string. E.g., Git
303 (string-match 303 ;; for Windows appends ".windows.N", while Git
304 "git version \\([0-9.]+\\)\\(\\.windows\\.[0-9]+\\)?$" 304 ;; for Mac appends " (Apple Git-N)". Capture
305 version-string)) 305 ;; numerical version and ignore the rest.
306 (match-string 1 version-string) 306 (string-match "git version \\([0-9][0-9.]+\\)"
307 version-string))
308 (string-trim-right (match-string 1 version-string) "\\.")
307 "0"))))) 309 "0")))))
308 310
309(defun vc-git--git-status-to-vc-state (code-list) 311(defun vc-git--git-status-to-vc-state (code-list)
@@ -1870,6 +1872,16 @@ Returns nil if not possible."
1870 (1- (point-max))))))) 1872 (1- (point-max)))))))
1871 (and name (not (string= name "undefined")) name)))) 1873 (and name (not (string= name "undefined")) name))))
1872 1874
1875(defvar-keymap vc-dir-git-mode-map
1876 "z c" #'vc-git-stash
1877 "z s" #'vc-git-stash-snapshot)
1878
1879(define-minor-mode vc-dir-git-mode
1880 "A minor mode for git-specific commands in `vc-dir-mode' buffers.
1881Also note that there are git stash commands available in the
1882\"Stash\" section at the head of the buffer."
1883 :lighter " Git")
1884
1873(provide 'vc-git) 1885(provide 'vc-git)
1874 1886
1875;;; vc-git.el ends here 1887;;; vc-git.el ends here
diff --git a/test/Makefile.in b/test/Makefile.in
index 51696d7faaf..f2c49584e7f 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -368,7 +368,7 @@ maintainer-clean: distclean bootstrap-clean
368.PHONY: check-declare 368.PHONY: check-declare
369 369
370check-declare: 370check-declare:
371 $(emacs) -l check-declare \ 371 $(emacs) --batch -l check-declare \
372 --eval '(check-declare-directory "$(srcdir)")' 372 --eval '(check-declare-directory "$(srcdir)")'
373 373
374.PHONY: subdirs subdir-targets generate-test-jobs 374.PHONY: subdirs subdir-targets generate-test-jobs
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el
index b9d45324cb7..b31f0a9afc4 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
127`ert-with-message-capture' before calling." 127`ert-with-message-capture' before calling."
128 ;; Remote files do not cooperate well with timers. So we count ourselves. 128 ;; Remote files do not cooperate well with timers. So we count ourselves.
129 (let ((ct (current-time))) 129 (let ((ct (current-time)))
130 (while (and (< (float-time (time-subtract (current-time) ct)) 130 (while (and (< (float-time (time-subtract nil ct))
131 (auto-revert--timeout)) 131 (auto-revert--timeout))
132 (null (string-match 132 (null (string-match
133 (format-message 133 (format-message
@@ -167,7 +167,7 @@ This expects `auto-revert--messages' to be bound by
167 167
168(defun auto-revert-tests--write-file (text file time-delta &optional append) 168(defun auto-revert-tests--write-file (text file time-delta &optional append)
169 (write-region text nil file append 'no-message) 169 (write-region text nil file append 'no-message)
170 (set-file-times file (time-subtract (current-time) time-delta))) 170 (set-file-times file (time-subtract nil time-delta)))
171 171
172(ert-deftest auto-revert-test00-auto-revert-mode () 172(ert-deftest auto-revert-test00-auto-revert-mode ()
173 "Check autorevert for a file." 173 "Check autorevert for a file."
@@ -453,7 +453,7 @@ This expects `auto-revert--messages' to be bound by
453(defun auto-revert-test--wait-for (pred max-wait) 453(defun auto-revert-test--wait-for (pred max-wait)
454 "Wait until PRED is true, or MAX-WAIT seconds elapsed." 454 "Wait until PRED is true, or MAX-WAIT seconds elapsed."
455 (let ((ct (current-time))) 455 (let ((ct (current-time)))
456 (while (and (< (float-time (time-subtract (current-time) ct)) max-wait) 456 (while (and (< (float-time (time-subtract nil ct)) max-wait)
457 (not (funcall pred))) 457 (not (funcall pred)))
458 (read-event nil nil 0.1)))) 458 (read-event nil nil 0.1))))
459 459
diff --git a/test/lisp/calendar/time-date-tests.el b/test/lisp/calendar/time-date-tests.el
index d5269804ad2..ed842e34fd6 100644
--- a/test/lisp/calendar/time-date-tests.el
+++ b/test/lisp/calendar/time-date-tests.el
@@ -55,13 +55,13 @@
55 (should (date-leap-year-p 2004))) 55 (should (date-leap-year-p 2004)))
56 56
57(ert-deftest test-days-to-time () 57(ert-deftest test-days-to-time ()
58 (should (equal (days-to-time 0) '(0 0))) 58 (should (time-equal-p (days-to-time 0) '(0 0)))
59 (should (equal (days-to-time 1) '(1 20864))) 59 (should (time-equal-p (days-to-time 1) '(1 20864)))
60 (should (equal (days-to-time 999) '(1317 2688))) 60 (should (time-equal-p (days-to-time 999) '(1317 2688)))
61 (should (equal (days-to-time 0.0) '(0 0 0 0))) 61 (should (time-equal-p (days-to-time 0.0) '(0 0 0 0)))
62 (should (equal (days-to-time 0.5) '(0 43200 0 0))) 62 (should (time-equal-p (days-to-time 0.5) '(0 43200 0 0)))
63 (should (equal (days-to-time 1.0) '(1 20864 0 0))) 63 (should (time-equal-p (days-to-time 1.0) '(1 20864 0 0)))
64 (should (equal (days-to-time 999.0) '(1317 2688 0 0)))) 64 (should (time-equal-p (days-to-time 999.0) '(1317 2688 0 0))))
65 65
66(ert-deftest test-seconds-to-string () 66(ert-deftest test-seconds-to-string ()
67 (should (equal (seconds-to-string 0) "0s")) 67 (should (equal (seconds-to-string 0) "0s"))
@@ -170,7 +170,8 @@
170 170
171(ert-deftest test-time-since () 171(ert-deftest test-time-since ()
172 (should (time-equal-p 0 (time-since nil))) 172 (should (time-equal-p 0 (time-since nil)))
173 (should (= (cadr (time-since (time-subtract (current-time) 1))) 1))) 173 (should (time-equal-p 1 (time-convert (time-since (time-subtract nil 1))
174 'integer))))
174 175
175(ert-deftest test-time-decoded-period () 176(ert-deftest test-time-decoded-period ()
176 (should (equal (decoded-time-period '(nil nil 1 nil nil nil nil nil nil)) 177 (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 47fa18eb806..c047f666dae 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -241,7 +241,7 @@ is greater than 10.
241 (progn ,@body) 241 (progn ,@body)
242 (tramp--test-message 242 (tramp--test-message
243 "%s %f sec" 243 "%s %f sec"
244 ,message (float-time (time-subtract (current-time) start)))))) 244 ,message (float-time (time-subtract nil start))))))
245 245
246;; `always' is introduced with Emacs 28.1. 246;; `always' is introduced with Emacs 28.1.
247(defalias 'tramp--test-always 247(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 00000000000..997ab3c4b5c
--- /dev/null
+++ b/test/lisp/vc/vc-git-tests.el
@@ -0,0 +1,67 @@
1;;; vc-git-tests.el --- tests for vc/vc-git.el -*- lexical-binding:t -*-
2
3;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
4
5;; Author: Justin Schell <justinmschell@gmail.com>
6;; Maintainer: emacs-devel@gnu.org
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
25;;; Code:
26
27(require 'vc-git)
28
29(ert-deftest vc-git-test-program-version-general ()
30 (vc-git-test--run-program-version-test
31 "git version 2.30.1.0"
32 "2.30.1.0"))
33
34(ert-deftest vc-git-test-program-version-windows ()
35 (vc-git-test--run-program-version-test
36 "git version 2.30.1.1.windows.1"
37 "2.30.1.1"))
38
39(ert-deftest vc-git-test-program-version-apple ()
40 (vc-git-test--run-program-version-test
41 "git version 2.30.1.2 (Apple Git-130)"
42 "2.30.1.2"))
43
44(ert-deftest vc-git-test-program-version-other ()
45 (vc-git-test--run-program-version-test
46 "git version 2.30.1.3.foo.bar"
47 "2.30.1.3"))
48
49(ert-deftest vc-git-test-program-version-invalid-leading-string ()
50 (vc-git-test--run-program-version-test
51 "git version foo.bar.2.30.1.4"
52 "0"))
53
54(ert-deftest vc-git-test-program-version-invalid-leading-dot ()
55 (vc-git-test--run-program-version-test
56 "git version .2.30.1.5"
57 "0"))
58
59(defun vc-git-test--run-program-version-test
60 (mock-version-string expected-output)
61 (cl-letf* (((symbol-function 'vc-git--run-command-string)
62 (lambda (_file _args) mock-version-string))
63 (vc-git--program-version nil)
64 (actual-output (vc-git--program-version)))
65 (should (equal actual-output expected-output))))
66
67;;; vc-git-tests.el ends here
diff --git a/test/manual/cedet/cedet-utests.el b/test/manual/cedet/cedet-utests.el
index d68b5b8c090..af6b4defb3c 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."
252(defun cedet-utest-elapsed-time (start end) 252(defun cedet-utest-elapsed-time (start end)
253 "Copied from elp.el. Was elp-elapsed-time. 253 "Copied from elp.el. Was elp-elapsed-time.
254Argument START and END bound the time being calculated." 254Argument START and END bound the time being calculated."
255 (+ (* (- (car end) (car start)) 65536.0) 255 (float-time (time-subtract start end)))
256 (- (car (cdr end)) (car (cdr start)))
257 (/ (- (car (cdr (cdr end))) (car (cdr (cdr start)))) 1000000.0)))
258 256
259(defun cedet-utest-log-shutdown (title &optional _errorcondition) 257(defun cedet-utest-log-shutdown (title &optional _errorcondition)
260 "Shut-down a larger test suite. 258 "Shut-down a larger test suite.
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el
index bba9b3fcd8c..f801478a9a1 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."
242 (should (= xdiv (float-time (time-convert xdiv t)))))) 242 (should (= xdiv (float-time (time-convert xdiv t))))))
243 (setq x (* x 2))))) 243 (setq x (* x 2)))))
244 244
245(ert-deftest time-convert-forms ()
246 ;; These computations involve numbers that should have exact
247 ;; representations on any Emacs platform.
248 (dolist (time '(-86400 -1 0 1 86400))
249 (dolist (delta '(0 0.0 0.25 3.25 1000 1000.25))
250 (let ((time+ (+ time delta))
251 (time- (- time delta)))
252 (dolist (form '(nil t list 4 1000 1000000 1000000000))
253 (should (time-equal-p time (time-convert time form)))
254 (should (time-equal-p time- (time-convert time- form)))
255 (should (time-equal-p time+ (time-convert time+ form))))))))
256
245;;; timefns-tests.el ends here 257;;; timefns-tests.el ends here