aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2021-12-05 08:36:40 +0800
committerPo Lu2021-12-05 08:36:40 +0800
commit360d2d3a3328799ed8fea27bc7c13873f84b65fa (patch)
tree579a7c080390d29b1aa6f772559c0f1946228779
parentf851e725b35d2ebd51b829059761a232d2ca1fbb (diff)
parentb3505e31d6ce4ea7c2cf1b01b8b7357b1f527bf1 (diff)
downloademacs-360d2d3a3328799ed8fea27bc7c13873f84b65fa.tar.gz
emacs-360d2d3a3328799ed8fea27bc7c13873f84b65fa.zip
Merge remote-tracking branch 'origin/master' into feature/pgtk
-rw-r--r--doc/lispref/os.texi3
-rw-r--r--doc/misc/eieio.texi3
-rw-r--r--doc/misc/tramp.texi9
-rw-r--r--etc/NEWS6
-rw-r--r--lisp/bookmark.el5
-rw-r--r--lisp/calendar/time-date.el38
-rw-r--r--lisp/emacs-lisp/eieio-core.el19
-rw-r--r--lisp/gnus/gnus-msg.el2
-rw-r--r--lisp/gnus/gnus-search.el10
-rw-r--r--lisp/gnus/nnselect.el4
-rw-r--r--lisp/isearch.el12
-rw-r--r--lisp/net/tramp-archive.el2
-rw-r--r--lisp/net/tramp-gvfs.el10
-rw-r--r--lisp/net/tramp-sh.el23
-rw-r--r--lisp/net/tramp-smb.el14
-rw-r--r--lisp/progmodes/gdb-mi.el2
-rw-r--r--lisp/progmodes/gud.el8
-rw-r--r--lisp/textmodes/pixel-fill.el19
-rw-r--r--test/lisp/calendar/time-date-tests.el7
-rw-r--r--test/lisp/dired-tests.el49
-rw-r--r--test/lisp/emacs-lisp/cl-macs-tests.el4
-rw-r--r--test/lisp/emacs-lisp/derived-tests.el4
-rw-r--r--test/lisp/emacs-lisp/eieio-tests/eieio-tests.el47
-rw-r--r--test/lisp/emacs-lisp/generator-tests.el3
-rw-r--r--test/lisp/emacs-lisp/lisp-tests.el1
-rw-r--r--test/lisp/emacs-lisp/seq-tests.el20
-rw-r--r--test/lisp/emacs-lisp/subr-x-tests.el26
-rw-r--r--test/lisp/emacs-lisp/timer-tests.el3
-rw-r--r--test/lisp/format-spec-tests.el4
-rw-r--r--test/lisp/ls-lisp-tests.el3
-rw-r--r--test/lisp/obsolete/cl-tests.el11
-rw-r--r--test/lisp/progmodes/elisp-mode-tests.el18
-rw-r--r--test/lisp/replace-tests.el11
-rw-r--r--test/lisp/ses-tests.el4
-rw-r--r--test/lisp/subr-tests.el1
-rw-r--r--test/lisp/tar-mode-tests.el8
-rw-r--r--test/src/data-tests.el41
-rw-r--r--test/src/search-tests.el2
38 files changed, 270 insertions, 186 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index e420644cd81..b4efc44b039 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1724,7 +1724,8 @@ This function parses the time-string @var{string} and returns the
1724corresponding Lisp timestamp. The argument @var{string} should represent 1724corresponding Lisp timestamp. The argument @var{string} should represent
1725a date-time, and should be in one of the forms recognized by 1725a date-time, and should be in one of the forms recognized by
1726@code{parse-time-string} (see below). This function assumes Universal 1726@code{parse-time-string} (see below). This function assumes Universal
1727Time if @var{string} lacks explicit time zone information. 1727Time if @var{string} lacks explicit time zone information,
1728and assumes earliest values if @var{string} lacks month, day, or time.
1728The operating system limits the range of time and zone values. 1729The operating system limits the range of time and zone values.
1729@end defun 1730@end defun
1730 1731
diff --git a/doc/misc/eieio.texi b/doc/misc/eieio.texi
index 2b0b1f7fd67..8a4b914687c 100644
--- a/doc/misc/eieio.texi
+++ b/doc/misc/eieio.texi
@@ -703,8 +703,7 @@ This function retrieves the value of @var{slot} from @var{object}.
703It can also be used on objects defined by @code{cl-defstruct}. 703It can also be used on objects defined by @code{cl-defstruct}.
704 704
705This is a generalized variable that can be used with @code{setf} to 705This is a generalized variable that can be used with @code{setf} to
706modify the value stored in @var{slot}, tho not for objects defined by 706modify the value stored in @var{slot}.
707@code{cl-defstruct}.
708@xref{Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}. 707@xref{Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}.
709@end defun 708@end defun
710 709
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 1f6d4ad6269..2a8a0382807 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -3389,8 +3389,8 @@ indication that the process has been interrupted, and returns a
3389corresponding string. 3389corresponding string.
3390 3390
3391This remote process handling does not apply to @acronym{GVFS} 3391This remote process handling does not apply to @acronym{GVFS}
3392(@pxref{GVFS-based methods}) because the remote file system is mounted on 3392(@pxref{GVFS-based methods}) because the remote file system is mounted
3393the local host and @value{tramp} accesses it by changing the 3393on the local host and @value{tramp} accesses it by changing the
3394@code{default-directory}. 3394@code{default-directory}.
3395 3395
3396@value{tramp} starts a remote process when a command is executed in a 3396@value{tramp} starts a remote process when a command is executed in a
@@ -4059,6 +4059,11 @@ CPIO archives
4059@cindex @file{cpio} file archive suffix 4059@cindex @file{cpio} file archive suffix
4060@cindex file archive suffix @file{cpio} 4060@cindex file archive suffix @file{cpio}
4061 4061
4062@item @samp{.crate} ---
4063Cargo (Rust) packages
4064@cindex @file{crate} file archive suffix
4065@cindex file archive suffix @file{crate}
4066
4062@item @samp{.deb} --- 4067@item @samp{.deb} ---
4063Debian packages 4068Debian packages
4064@cindex @file{deb} file archive suffix 4069@cindex @file{deb} file archive suffix
diff --git a/etc/NEWS b/etc/NEWS
index ac1787d7f80..df5e6ef7904 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -423,7 +423,7 @@ representation as emojis.
423** EIEIO 423** EIEIO
424 424
425+++ 425+++
426*** 'slot-value' can now be used to read slots of 'cl-defstruct' objects. 426*** 'slot-value' can now be used to access slots of 'cl-defstruct' objects.
427 427
428** align 428** align
429 429
@@ -1084,6 +1084,10 @@ cookies set by web pages on disk.
1084** New variable 'help-buffer-under-preparation'. 1084** New variable 'help-buffer-under-preparation'.
1085This variable is bound to t during the preparation of a "*Help*" buffer. 1085This variable is bound to t during the preparation of a "*Help*" buffer.
1086 1086
1087+++
1088** 'date-to-time' now assumes earliest values if its argument lacks
1089month, day, or time. For example, (date-to-time "2021-12-04") now
1090assumes a time of 00:00 instead of signaling an error.
1087 1091
1088* Changes in Emacs 29.1 on Non-Free Operating Systems 1092* Changes in Emacs 29.1 on Non-Free Operating Systems
1089 1093
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index a8fa9ae7749..f35cbc1a5ec 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -510,8 +510,9 @@ If DEFAULT is nil then return empty string for empty input."
510 510
511(defmacro bookmark-maybe-historicize-string (string) 511(defmacro bookmark-maybe-historicize-string (string)
512 "Put STRING into the bookmark prompt history, if caller non-interactive. 512 "Put STRING into the bookmark prompt history, if caller non-interactive.
513We need this because sometimes bookmark functions are invoked from 513We need this because sometimes bookmark functions are invoked
514menus, so `completing-read' never gets a chance to set `bookmark-history'." 514from other commands that pass in the bookmark name, so
515`completing-read' never gets a chance to set `bookmark-history'."
515 `(or 516 `(or
516 (called-interactively-p 'interactive) 517 (called-interactively-p 'interactive)
517 (setq bookmark-history (cons ,string bookmark-history)))) 518 (setq bookmark-history (cons ,string bookmark-history))))
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index 8a6ee0f2702..37a16d3b98c 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -153,28 +153,22 @@ it is assumed that PICO was omitted and should be treated as zero."
153 "Parse a string DATE that represents a date-time and return a time value. 153 "Parse a string DATE that represents a date-time and return a time value.
154DATE should be in one of the forms recognized by `parse-time-string'. 154DATE should be in one of the forms recognized by `parse-time-string'.
155If DATE lacks timezone information, GMT is assumed." 155If DATE lacks timezone information, GMT is assumed."
156 ;; Pass the result of parsing through decoded-time-set-defaults 156 (condition-case err
157 ;; because encode-time signals if HH:MM:SS are not filled in. 157 (let ((parsed (parse-time-string date)))
158 (encode-time 158 (when (decoded-time-year parsed)
159 (decoded-time-set-defaults 159 (decoded-time-set-defaults parsed))
160 (condition-case err 160 (encode-time parsed))
161 (let ((time (parse-time-string date))) 161 (error
162 (prog1 time 162 (let ((overflow-error '(error "Specified time is not representable")))
163 ;; Cause an error if data `parse-time-string' returns is invalid. 163 (if (equal err overflow-error)
164 (setq time (encode-time time)))) 164 (signal (car err) (cdr err))
165 (error 165 (condition-case err
166 (let ((overflow-error '(error "Specified time is not representable"))) 166 (encode-time (parse-time-string
167 (if (or (equal err overflow-error) 167 (timezone-make-date-arpa-standard date)))
168 ;; timezone-make-date-arpa-standard misbehaves if 168 (error
169 ;; not given at least HH:MM as part of the date. 169 (if (equal err overflow-error)
170 (not (string-match ":" date))) 170 (signal (car err) (cdr err))
171 (signal (car err) (cdr err)) 171 (error "Invalid date: %s" date)))))))))
172 (condition-case err
173 (parse-time-string (timezone-make-date-arpa-standard date))
174 (error
175 (if (equal err overflow-error)
176 (signal (car err) (cdr err))
177 (error "Invalid date: %s" date)))))))))))
178 172
179;;;###autoload 173;;;###autoload
180(defalias 'time-to-seconds 'float-time) 174(defalias 'time-to-seconds 'float-time)
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
index 7c5babcf54c..ca47ec77f76 100644
--- a/lisp/emacs-lisp/eieio-core.el
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -450,7 +450,7 @@ See `defclass' for more information."
450 )) 450 ))
451 451
452 ;; Now that everything has been loaded up, all our lists are backwards! 452 ;; Now that everything has been loaded up, all our lists are backwards!
453 ;; Fix that up now and then them into vectors. 453 ;; Fix that up now and turn them into vectors.
454 (cl-callf (lambda (slots) (apply #'vector (nreverse slots))) 454 (cl-callf (lambda (slots) (apply #'vector (nreverse slots)))
455 (eieio--class-slots newc)) 455 (eieio--class-slots newc))
456 (cl-callf nreverse (eieio--class-initarg-tuples newc)) 456 (cl-callf nreverse (eieio--class-initarg-tuples newc))
@@ -704,11 +704,15 @@ an error."
704 nil 704 nil
705 ;; Trim off object IDX junk added in for the object index. 705 ;; Trim off object IDX junk added in for the object index.
706 (setq slot-idx (- slot-idx (eval-when-compile eieio--object-num-slots))) 706 (setq slot-idx (- slot-idx (eval-when-compile eieio--object-num-slots)))
707 (let ((st (cl--slot-descriptor-type (aref (eieio--class-slots class) 707 (let* ((sd (aref (eieio--class-slots class)
708 slot-idx)))) 708 slot-idx))
709 (if (not (eieio--perform-slot-validation st value)) 709 (st (cl--slot-descriptor-type sd)))
710 (signal 'invalid-slot-type 710 (cond
711 (list (eieio--class-name class) slot st value)))))) 711 ((not (eieio--perform-slot-validation st value))
712 (signal 'invalid-slot-type
713 (list (eieio--class-name class) slot st value)))
714 ((alist-get :read-only (cl--slot-descriptor-props sd))
715 (signal 'eieio-read-only (list (eieio--class-name class) slot)))))))
712 716
713(defun eieio--validate-class-slot-value (class slot-idx value slot) 717(defun eieio--validate-class-slot-value (class slot-idx value slot)
714 "Make sure that for CLASS referencing SLOT-IDX, VALUE is valid. 718 "Make sure that for CLASS referencing SLOT-IDX, VALUE is valid.
@@ -813,7 +817,7 @@ Fills in CLASS's SLOT with its default value."
813(defun eieio-oset (obj slot value) 817(defun eieio-oset (obj slot value)
814 "Do the work for the macro `oset'. 818 "Do the work for the macro `oset'.
815Fills in OBJ's SLOT with VALUE." 819Fills in OBJ's SLOT with VALUE."
816 (cl-check-type obj eieio-object) 820 (cl-check-type obj (or eieio-object cl-structure-object))
817 (cl-check-type slot symbol) 821 (cl-check-type slot symbol)
818 (let* ((class (eieio--object-class obj)) 822 (let* ((class (eieio--object-class obj))
819 (c (eieio--slot-name-index class slot))) 823 (c (eieio--slot-name-index class slot)))
@@ -1063,6 +1067,7 @@ method invocation orders of the involved classes."
1063;; 1067;;
1064(define-error 'invalid-slot-name "Invalid slot name") 1068(define-error 'invalid-slot-name "Invalid slot name")
1065(define-error 'invalid-slot-type "Invalid slot type") 1069(define-error 'invalid-slot-type "Invalid slot type")
1070(define-error 'eieio-read-only "Read-only slot")
1066(define-error 'unbound-slot "Unbound slot") 1071(define-error 'unbound-slot "Unbound slot")
1067(define-error 'inconsistent-class-hierarchy "Inconsistent class hierarchy") 1072(define-error 'inconsistent-class-hierarchy "Inconsistent class hierarchy")
1068 1073
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index bb265642bc6..c60faa13263 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1748,7 +1748,7 @@ this is a reply."
1748 (concat "\"" str "\"") 1748 (concat "\"" str "\"")
1749 str))) 1749 str)))
1750 (when groups 1750 (when groups
1751 (insert " "))) 1751 (insert ",")))
1752 (insert "\n"))))))) 1752 (insert "\n")))))))
1753 1753
1754(defun gnus-mailing-list-followup-to () 1754(defun gnus-mailing-list-followup-to ()
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index bce5d57c521..c77de688e66 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -105,9 +105,13 @@
105 105
106(gnus-add-shutdown #'gnus-search-shutdown 'gnus) 106(gnus-add-shutdown #'gnus-search-shutdown 'gnus)
107 107
108(define-error 'gnus-search-parse-error "Gnus search parsing error") 108(define-error 'gnus-search-error "Gnus search error")
109 109
110(define-error 'gnus-search-config-error "Gnus search configuration error") 110(define-error 'gnus-search-parse-error "Gnus search parsing error"
111 'gnus-search-error)
112
113(define-error 'gnus-search-config-error "Gnus search configuration error"
114 'gnus-search-error)
111 115
112;;; User Customizable Variables: 116;;; User Customizable Variables:
113 117
@@ -1927,7 +1931,7 @@ Assume \"size\" key is equal to \"larger\"."
1927 (apply #'nnheader-message 4 1931 (apply #'nnheader-message 4
1928 "Search engine for %s improperly configured: %s" 1932 "Search engine for %s improperly configured: %s"
1929 server (cdr err)) 1933 server (cdr err))
1930 (signal 'gnus-search-config-error err))))) 1934 (signal (car err) (cdr err))))))
1931 (alist-get 'search-group-spec specs)) 1935 (alist-get 'search-group-spec specs))
1932 ;; Some search engines do their own limiting, but some don't, so 1936 ;; Some search engines do their own limiting, but some don't, so
1933 ;; do it again here. This is bad because, if the user is 1937 ;; do it again here. This is bad because, if the user is
diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el
index ecec705b326..252e9f66838 100644
--- a/lisp/gnus/nnselect.el
+++ b/lisp/gnus/nnselect.el
@@ -779,6 +779,10 @@ Return an article list."
779 (args (alist-get 'nnselect-args specs))) 779 (args (alist-get 'nnselect-args specs)))
780 (condition-case-unless-debug err 780 (condition-case-unless-debug err
781 (funcall func args) 781 (funcall func args)
782 ;; Don't swallow gnus-search errors; the user should be made
783 ;; aware of them.
784 (gnus-search-error
785 (signal (car err) (cdr err)))
782 (error (gnus-error 3 "nnselect-run: %s on %s gave error %s" func args err) 786 (error (gnus-error 3 "nnselect-run: %s on %s gave error %s" func args err)
783 [])))) 787 []))))
784 788
diff --git a/lisp/isearch.el b/lisp/isearch.el
index fcb7d646c66..8815cb4f2d6 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2504,6 +2504,11 @@ If no input items have been entered yet, just beep."
2504 (if (null (cdr isearch-cmds)) 2504 (if (null (cdr isearch-cmds))
2505 (ding) 2505 (ding)
2506 (isearch-pop-state)) 2506 (isearch-pop-state))
2507 ;; When going back to the hidden match, reopen it.
2508 (when (and (eq search-invisible 'open) isearch-hide-immediately
2509 isearch-other-end)
2510 (isearch-range-invisible (min (point) isearch-other-end)
2511 (max (point) isearch-other-end)))
2507 (isearch-update)) 2512 (isearch-update))
2508 2513
2509(defun isearch-del-char (&optional arg) 2514(defun isearch-del-char (&optional arg)
@@ -3787,10 +3792,9 @@ Isearch, at least partially, as determined by `isearch-range-invisible'.
3787If `search-invisible' is t, which allows Isearch matches inside 3792If `search-invisible' is t, which allows Isearch matches inside
3788invisible text, this function will always return non-nil, regardless 3793invisible text, this function will always return non-nil, regardless
3789of what `isearch-range-invisible' says." 3794of what `isearch-range-invisible' says."
3790 (and (or (eq search-invisible t) 3795 (and (not (text-property-not-all beg end 'inhibit-isearch nil))
3791 (not (isearch-range-invisible beg end))) 3796 (or (eq search-invisible t)
3792 (not (text-property-not-all (min beg end) (max beg end) 3797 (not (isearch-range-invisible beg end)))))
3793 'inhibit-isearch nil))))
3794 3798
3795 3799
3796;; General utilities 3800;; General utilities
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index efd38e6b4b7..b0f447a3aee 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -54,6 +54,7 @@
54;; * ".ar" - UNIX archiver formats 54;; * ".ar" - UNIX archiver formats
55;; * ".cab", ".CAB" - Microsoft Windows cabinets 55;; * ".cab", ".CAB" - Microsoft Windows cabinets
56;; * ".cpio" - CPIO archives 56;; * ".cpio" - CPIO archives
57;; * ".crate" - Cargo (Rust) packages
57;; * ".deb" - Debian packages 58;; * ".deb" - Debian packages
58;; * ".depot" - HP-UX SD depots 59;; * ".depot" - HP-UX SD depots
59;; * ".exe" - Self extracting Microsoft Windows EXE files 60;; * ".exe" - Self extracting Microsoft Windows EXE files
@@ -141,6 +142,7 @@
141 "ar" ;; UNIX archiver formats. 142 "ar" ;; UNIX archiver formats.
142 "cab" "CAB" ;; Microsoft Windows cabinets. 143 "cab" "CAB" ;; Microsoft Windows cabinets.
143 "cpio" ;; CPIO archives. 144 "cpio" ;; CPIO archives.
145 "crate" ;; Cargo (Rust) packages. Not in libarchive testsuite.
144 "deb" ;; Debian packages. Not in libarchive testsuite. 146 "deb" ;; Debian packages. Not in libarchive testsuite.
145 "depot" ;; HP-UX SD depot. Not in libarchive testsuite. 147 "depot" ;; HP-UX SD depot. Not in libarchive testsuite.
146 "exe" ;; Self extracting Microsoft Windows EXE files. 148 "exe" ;; Self extracting Microsoft Windows EXE files.
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index ab71c9cd13f..22e31428a76 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1521,11 +1521,11 @@ If FILE-SYSTEM is non-nil, return file system attributes."
1521 (size (cdr (assoc "filesystem::size" attr))) 1521 (size (cdr (assoc "filesystem::size" attr)))
1522 (used (cdr (assoc "filesystem::used" attr))) 1522 (used (cdr (assoc "filesystem::used" attr)))
1523 (free (cdr (assoc "filesystem::free" attr)))) 1523 (free (cdr (assoc "filesystem::free" attr))))
1524 (when (or size used free) 1524 (when (or size free)
1525 (list (string-to-number (or size "0")) 1525 (list (and size (string-to-number size))
1526 (string-to-number (or free "0")) 1526 (and free (string-to-number free))
1527 (- (string-to-number (or size "0")) 1527 (and size used
1528 (string-to-number (or used "0")))))))) 1528 (- (string-to-number size) (string-to-number used))))))))
1529 1529
1530(defun tramp-gvfs-handle-make-directory (dir &optional parents) 1530(defun tramp-gvfs-handle-make-directory (dir &optional parents)
1531 "Like `make-directory' for Tramp files." 1531 "Like `make-directory' for Tramp files."
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 780c3b39413..8d106591af3 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2678,17 +2678,15 @@ The method used must be an out-of-band method."
2678 (point-min) 'noerror) 2678 (point-min) 'noerror)
2679 (replace-match (file-relative-name filename) t)) 2679 (replace-match (file-relative-name filename) t))
2680 2680
2681 ;; Try to insert the amount of free space. This is moved to 2681 ;; Try to insert the amount of free space.
2682 ;; `dired-insert-directory' in Emacs 29.1. 2682 (goto-char (point-min))
2683 (unless (boundp 'dired-free-space) 2683 ;; First find the line to put it on.
2684 (goto-char (point-min)) 2684 (when (re-search-forward "^\\([[:space:]]*total\\)" nil t)
2685 ;; First find the line to put it on. 2685 (when-let ((available (get-free-disk-space ".")))
2686 (when (re-search-forward "^\\([[:space:]]*total\\)" nil t) 2686 ;; Replace "total" with "total used", to avoid confusion.
2687 (when-let ((available (get-free-disk-space "."))) 2687 (replace-match "\\1 used in directory")
2688 ;; Replace "total" with "total used", to avoid confusion. 2688 (end-of-line)
2689 (replace-match "\\1 used in directory") 2689 (insert " available " available))))
2690 (end-of-line)
2691 (insert " available " available)))))
2692 2690
2693 (prog1 (goto-char end-marker) 2691 (prog1 (goto-char end-marker)
2694 (set-marker beg-marker nil) 2692 (set-marker beg-marker nil)
@@ -6024,5 +6022,8 @@ function cell is returned to be applied on a buffer."
6024;; be to stipulate, as a directory or connection-local variable, an 6022;; be to stipulate, as a directory or connection-local variable, an
6025;; additional rc file on the remote machine that is sourced every 6023;; additional rc file on the remote machine that is sourced every
6026;; time Tramp connects. <https://emacs.stackexchange.com/questions/62306> 6024;; time Tramp connects. <https://emacs.stackexchange.com/questions/62306>
6025;;
6026;; * Support hostname canonicalization in ~/.ssh/config.
6027;; <https://stackoverflow.com/questions/70205232/>
6027 6028
6028;;; tramp-sh.el ends here 6029;;; tramp-sh.el ends here
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 0a7d1efc8b8..24119539db0 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1120,14 +1120,12 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
1120 (setcar x (concat (car x) "*")))))) 1120 (setcar x (concat (car x) "*"))))))
1121 entries)) 1121 entries))
1122 1122
1123 ;; Insert size information. This is moved to 1123 ;; Insert size information.
1124 ;; `dired-insert-directory' in Emacs 29.1. 1124 (when full-directory-p
1125 (unless (boundp 'dired-free-space) 1125 (insert
1126 (when full-directory-p 1126 (if avail
1127 (insert 1127 (format "total used in directory %s available %s\n" used avail)
1128 (if avail 1128 (format "total %s\n" used))))
1129 (format "total used in directory %s available %s\n" used avail)
1130 (format "total %s\n" used)))))
1131 1129
1132 ;; Print entries. 1130 ;; Print entries.
1133 (mapc 1131 (mapc
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index cf1d62d3695..409ff940d96 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1266,7 +1266,7 @@ Used by Speedbar."
1266 :version "22.1") 1266 :version "22.1")
1267 1267
1268(define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch) 1268(define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch)
1269(define-key global-map (vconcat gud-key-prefix "\C-w") 'gud-watch) 1269(keymap-set gud-global-map "C-w" 'gud-watch)
1270 1270
1271(declare-function tooltip-identifier-from-point "tooltip" (point)) 1271(declare-function tooltip-identifier-from-point "tooltip" (point))
1272 1272
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 9b884c4ff80..d5bd2655174 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -90,8 +90,10 @@ pdb (Python), and jdb."
90 "Prefix of all GUD commands valid in C buffers." 90 "Prefix of all GUD commands valid in C buffers."
91 :type 'key-sequence) 91 :type 'key-sequence)
92 92
93(global-set-key (vconcat gud-key-prefix "\C-l") #'gud-refresh) 93(defvar-keymap gud-global-map
94;; (define-key ctl-x-map " " 'gud-break); backward compatibility hack 94 "C-l" #'gud-refresh)
95
96(global-set-key gud-key-prefix gud-global-map)
95 97
96(defvar gud-marker-filter nil) 98(defvar gud-marker-filter nil)
97(put 'gud-marker-filter 'permanent-local t) 99(put 'gud-marker-filter 'permanent-local t)
@@ -433,7 +435,7 @@ we're in the GUD buffer)."
433 ;; Unused lexical warning if cmd does not use "arg". 435 ;; Unused lexical warning if cmd does not use "arg".
434 cmd)))) 436 cmd))))
435 ,(if key `(local-set-key ,(concat "\C-c" key) #',func)) 437 ,(if key `(local-set-key ,(concat "\C-c" key) #',func))
436 ,(if key `(global-set-key (vconcat gud-key-prefix ,key) #',func)))) 438 ,(if key `(define-key gud-global-map ,key #',func))))
437 439
438;; Where gud-display-frame should put the debugging arrow; a cons of 440;; Where gud-display-frame should put the debugging arrow; a cons of
439;; (filename . line-number). This is set by the marker-filter, which scans 441;; (filename . line-number). This is set by the marker-filter, which scans
diff --git a/lisp/textmodes/pixel-fill.el b/lisp/textmodes/pixel-fill.el
index f69696e1f56..0a0f0eb8b66 100644
--- a/lisp/textmodes/pixel-fill.el
+++ b/lisp/textmodes/pixel-fill.el
@@ -116,15 +116,13 @@ prefix on subsequent lines."
116 (while (not (eolp)) 116 (while (not (eolp))
117 ;; We have to do some folding. First find the first previous 117 ;; We have to do some folding. First find the first previous
118 ;; point suitable for folding. 118 ;; point suitable for folding.
119 (if (or (not (pixel-fill-find-fill-point (line-beginning-position))) 119 (when (or (not (pixel-fill-find-fill-point (line-beginning-position)))
120 (= (point) start)) 120 (= (point) start))
121 ;; We had unbreakable text (for this width), so just go to 121 ;; We had unbreakable text (for this width), so just go to
122 ;; the first space and carry on. 122 ;; the first space and carry on.
123 (progn 123 (beginning-of-line)
124 (beginning-of-line) 124 (skip-chars-forward " ")
125 (skip-chars-forward " ") 125 (search-forward " " (line-end-position) 'move))
126 (search-forward " " (line-end-position) 'move)))
127 ;; Success; continue.
128 (when (= (preceding-char) ?\s) 126 (when (= (preceding-char) ?\s)
129 (delete-char -1)) 127 (delete-char -1))
130 (unless (eobp) 128 (unless (eobp)
@@ -133,7 +131,8 @@ prefix on subsequent lines."
133 (insert (propertize " " 'display 131 (insert (propertize " " 'display
134 (list 'space :align-to (list indentation)))))) 132 (list 'space :align-to (list indentation))))))
135 (setq start (point)) 133 (setq start (point))
136 (pixel-fill--goto-pixel width)))) 134 (unless (eobp)
135 (pixel-fill--goto-pixel width)))))
137 136
138(define-inline pixel-fill--char-breakable-p (char) 137(define-inline pixel-fill--char-breakable-p (char)
139 "Return non-nil if a line can be broken before and after CHAR." 138 "Return non-nil if a line can be broken before and after CHAR."
diff --git a/test/lisp/calendar/time-date-tests.el b/test/lisp/calendar/time-date-tests.el
index 4568947c0b3..d5269804ad2 100644
--- a/test/lisp/calendar/time-date-tests.el
+++ b/test/lisp/calendar/time-date-tests.el
@@ -41,6 +41,13 @@
41 (encode-time-value 1 2 3 4 3)) 41 (encode-time-value 1 2 3 4 3))
42 '(1 2 3 4)))) 42 '(1 2 3 4))))
43 43
44(ert-deftest test-date-to-time ()
45 (should (equal (format-time-string "%F %T" (date-to-time "2021-12-04"))
46 "2021-12-04 00:00:00")))
47
48(ert-deftest test-days-between ()
49 (should (equal (days-between "2021-10-22" "2020-09-29") 388)))
50
44(ert-deftest test-leap-year () 51(ert-deftest test-leap-year ()
45 (should-not (date-leap-year-p 1999)) 52 (should-not (date-leap-year-p 1999))
46 (should-not (date-leap-year-p 1900)) 53 (should-not (date-leap-year-p 1900))
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index 43791118f14..1c4f37bd327 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -543,10 +543,12 @@ path's data to use."
543 ((equal "." path) default-directory) 543 ((equal "." path) default-directory)
544 (path))) 544 (path)))
545 (return-size 545 (return-size
546 (car (files-tests--look-up-free-data path)))) 546 ;; It is always defined but this silences the byte-compiler:
547 (when (fboundp 'files-tests--look-up-free-data)
548 (car (files-tests--look-up-free-data path)))))
547 (list return-size return-size return-size)))) 549 (list return-size return-size return-size))))
548 550
549 (defun files-tests--insert-directory-output (dir &optional verbose) 551 (defun files-tests--insert-directory-output (dir &optional _verbose)
550 "Run `insert-directory' and return its output." 552 "Run `insert-directory' and return its output."
551 (with-current-buffer-window "files-tests--insert-directory" nil nil 553 (with-current-buffer-window "files-tests--insert-directory" nil nil
552 (let ((dired-free-space 'separate)) 554 (let ((dired-free-space 'separate))
@@ -555,35 +557,46 @@ path's data to use."
555 557
556 (ert-deftest files-tests-insert-directory-shows-files () 558 (ert-deftest files-tests-insert-directory-shows-files ()
557 "Verify `insert-directory' reports the files in the directory." 559 "Verify `insert-directory' reports the files in the directory."
558 (let* ((test-dir (car test-files)) 560 ;; It is always defined but this silences the byte-compiler:
559 (files (cdr test-files)) 561 (when (fboundp 'files-tests--insert-directory-output)
560 (output (files-tests--insert-directory-output test-dir))) 562 (let* ((test-dir (car test-files))
561 (dolist (file files) 563 (files (cdr test-files))
562 (should (string-match-p file output))))) 564 (output (files-tests--insert-directory-output test-dir)))
565 (dolist (file files)
566 (should (string-match-p file output))))))
563 567
564 (defun files-tests--insert-directory-shows-given-free (dir &optional 568 (defun files-tests--insert-directory-shows-given-free (dir &optional
565 info-func) 569 info-func)
566 "Run `insert-directory' and verify it reports the correct available space. 570 "Run `insert-directory' and verify it reports the correct available space.
567Stub `file-system-info' to ensure the available space is consistent, 571Stub `file-system-info' to ensure the available space is consistent,
568either with the given stub function or a default one using test data." 572either with the given stub function or a default one using test data."
569 (cl-letf (((symbol-function 'file-system-info) 573 ;; It is always defined but this silences the byte-compiler:
570 (or info-func 574 (when (and (fboundp 'files-tests--make-file-system-info-stub)
571 (files-tests--make-file-system-info-stub)))) 575 (fboundp 'files-tests--look-up-free-data)
572 (should (string-match-p (cadr 576 (fboundp 'files-tests--insert-directory-output))
573 (files-tests--look-up-free-data dir)) 577 (cl-letf (((symbol-function 'file-system-info)
574 (files-tests--insert-directory-output dir t))))) 578 (or info-func
579 (files-tests--make-file-system-info-stub))))
580 (should (string-match-p (cadr
581 (files-tests--look-up-free-data dir))
582 (files-tests--insert-directory-output dir t))))))
575 583
576 (ert-deftest files-tests-insert-directory-shows-free () 584 (ert-deftest files-tests-insert-directory-shows-free ()
577 "Test that verbose `insert-directory' shows the correct available space." 585 "Test that verbose `insert-directory' shows the correct available space."
578 (files-tests--insert-directory-shows-given-free 586 ;; It is always defined but this silences the byte-compiler:
579 test-dir 587 (when (and (fboundp 'files-tests--insert-directory-shows-given-free)
580 (files-tests--make-file-system-info-stub test-dir))) 588 (fboundp 'files-tests--make-file-system-info-stub))
589 (files-tests--insert-directory-shows-given-free
590 test-dir
591 (files-tests--make-file-system-info-stub test-dir))))
581 592
582 (ert-deftest files-tests-bug-50630 () 593 (ert-deftest files-tests-bug-50630 ()
583 "Verify verbose `insert-directory' shows free space of the target directory. 594 "Verify verbose `insert-directory' shows free space of the target directory.
584The current directory at call time should not affect the result (Bug#50630)." 595The current directory at call time should not affect the result (Bug#50630)."
585 (let ((default-directory test-dir-other)) 596 ;; It is always defined but this silences the byte-compiler:
586 (files-tests--insert-directory-shows-given-free test-dir)))) 597 (when (fboundp 'files-tests--insert-directory-shows-given-free)
598 (let ((default-directory test-dir-other))
599 (files-tests--insert-directory-shows-given-free test-dir)))))
587 600
588(provide 'dired-tests) 601(provide 'dired-tests)
589;;; dired-tests.el ends here 602;;; dired-tests.el ends here
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el
index be2c0fa02b4..7c3afefaadd 100644
--- a/test/lisp/emacs-lisp/cl-macs-tests.el
+++ b/test/lisp/emacs-lisp/cl-macs-tests.el
@@ -668,6 +668,10 @@ collection clause."
668 #'len)) 668 #'len))
669 (`(function (lambda (,_ ,_) . ,_)) t)))) 669 (`(function (lambda (,_ ,_) . ,_)) t))))
670 670
671(with-suppressed-warnings ((lexical test) (lexical test1) (lexical test2))
672 (defvar test)
673 (defvar test1)
674 (defvar test2))
671(ert-deftest cl-macs--progv () 675(ert-deftest cl-macs--progv ()
672 (should (= (cl-progv '(test test) '(1 2) test) 2)) 676 (should (= (cl-progv '(test test) '(1 2) test) 2))
673 (should (equal (cl-progv '(test1 test2) '(1 2) (list test1 test2)) 677 (should (equal (cl-progv '(test1 test2) '(1 2) (list test1 test2))
diff --git a/test/lisp/emacs-lisp/derived-tests.el b/test/lisp/emacs-lisp/derived-tests.el
index 9c8e6c33b4c..2647b86826a 100644
--- a/test/lisp/emacs-lisp/derived-tests.el
+++ b/test/lisp/emacs-lisp/derived-tests.el
@@ -24,13 +24,13 @@
24(define-derived-mode derived-tests--parent-mode prog-mode "P" 24(define-derived-mode derived-tests--parent-mode prog-mode "P"
25 :after-hook 25 :after-hook
26 (let ((f (let ((x "S")) (lambda () x)))) 26 (let ((f (let ((x "S")) (lambda () x))))
27 (insert (format "AFP=%s " (let ((x "D")) (funcall f))))) 27 (insert (format "AFP=%s " (let ((x "D")) x (funcall f)))))
28 (insert "PB ")) 28 (insert "PB "))
29 29
30(define-derived-mode derived-tests--child-mode derived-tests--parent-mode "C" 30(define-derived-mode derived-tests--child-mode derived-tests--parent-mode "C"
31 :after-hook 31 :after-hook
32 (let ((f (let ((x "S")) (lambda () x)))) 32 (let ((f (let ((x "S")) (lambda () x))))
33 (insert (format "AFC=%s " (let ((x "D")) (funcall f))))) 33 (insert (format "AFC=%s " (let ((x "D")) x (funcall f)))))
34 (insert "CB ")) 34 (insert "CB "))
35 35
36(ert-deftest derived-tests-after-hook-lexical () 36(ert-deftest derived-tests-after-hook-lexical ()
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
index ba2e5f7be4a..6f6a1f4f19a 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
@@ -172,7 +172,7 @@
172 ;; Check that generic-p works 172 ;; Check that generic-p works
173 (should (generic-p 'generic1)) 173 (should (generic-p 'generic1))
174 174
175 (defmethod generic1 ((c class-a)) 175 (defmethod generic1 ((_c class-a))
176 "Method on generic1." 176 "Method on generic1."
177 'monkey) 177 'monkey)
178 178
@@ -240,12 +240,12 @@ Argument C is the class bound to this static method."
240 (should (make-instance 'class-a :water 'cho)) 240 (should (make-instance 'class-a :water 'cho))
241 (should (make-instance 'class-b))) 241 (should (make-instance 'class-b)))
242 242
243(defmethod class-cn ((a class-a)) 243(defmethod class-cn ((_a class-a))
244 "Try calling `call-next-method' when there isn't one. 244 "Try calling `call-next-method' when there isn't one.
245Argument A is object of type symbol `class-a'." 245Argument A is object of type symbol `class-a'."
246 (call-next-method)) 246 (call-next-method))
247 247
248(defmethod no-next-method ((a class-a) &rest args) 248(defmethod no-next-method ((_a class-a) &rest _args)
249 "Override signal throwing for variable `class-a'. 249 "Override signal throwing for variable `class-a'.
250Argument A is the object of class variable `class-a'." 250Argument A is the object of class variable `class-a'."
251 'moose) 251 'moose)
@@ -254,7 +254,7 @@ Argument A is the object of class variable `class-a'."
254 ;; Play with call-next-method 254 ;; Play with call-next-method
255 (should (eq (class-cn eitest-ab) 'moose))) 255 (should (eq (class-cn eitest-ab) 'moose)))
256 256
257(defmethod no-applicable-method ((b class-b) method &rest args) 257(defmethod no-applicable-method ((_b class-b) _method &rest _args)
258 "No need. 258 "No need.
259Argument B is for booger. 259Argument B is for booger.
260METHOD is the method that was attempting to be called." 260METHOD is the method that was attempting to be called."
@@ -264,38 +264,38 @@ METHOD is the method that was attempting to be called."
264 ;; Non-existing methods. 264 ;; Non-existing methods.
265 (should (eq (class-cn eitest-b) 'moose))) 265 (should (eq (class-cn eitest-b) 'moose)))
266 266
267(defmethod class-fun ((a class-a)) 267(defmethod class-fun ((_a class-a))
268 "Fun with class A." 268 "Fun with class A."
269 'moose) 269 'moose)
270 270
271(defmethod class-fun ((b class-b)) 271(defmethod class-fun ((_b class-b))
272 "Fun with class B." 272 "Fun with class B."
273 (error "Class B fun should not be called") 273 (error "Class B fun should not be called")
274 ) 274 )
275 275
276(defmethod class-fun-foo ((b class-b)) 276(defmethod class-fun-foo ((_b class-b))
277 "Foo Fun with class B." 277 "Foo Fun with class B."
278 'moose) 278 'moose)
279 279
280(defmethod class-fun2 ((a class-a)) 280(defmethod class-fun2 ((_a class-a))
281 "More fun with class A." 281 "More fun with class A."
282 'moose) 282 'moose)
283 283
284(defmethod class-fun2 ((b class-b)) 284(defmethod class-fun2 ((_b class-b))
285 "More fun with class B." 285 "More fun with class B."
286 (error "Class B fun2 should not be called") 286 (error "Class B fun2 should not be called")
287 ) 287 )
288 288
289(defmethod class-fun2 ((ab class-ab)) 289(defmethod class-fun2 ((_ab class-ab))
290 "More fun with class AB." 290 "More fun with class AB."
291 (call-next-method)) 291 (call-next-method))
292 292
293;; How about if B is the only slot? 293;; How about if B is the only slot?
294(defmethod class-fun3 ((b class-b)) 294(defmethod class-fun3 ((_b class-b))
295 "Even More fun with class B." 295 "Even More fun with class B."
296 'moose) 296 'moose)
297 297
298(defmethod class-fun3 ((ab class-ab)) 298(defmethod class-fun3 ((_ab class-ab))
299 "Even More fun with class AB." 299 "Even More fun with class AB."
300 (call-next-method)) 300 (call-next-method))
301 301
@@ -314,17 +314,17 @@ METHOD is the method that was attempting to be called."
314 314
315 315
316(defvar class-fun-value-seq '()) 316(defvar class-fun-value-seq '())
317(defmethod class-fun-value :BEFORE ((a class-a)) 317(defmethod class-fun-value :BEFORE ((_a class-a))
318 "Return `before', and push `before' in `class-fun-value-seq'." 318 "Return `before', and push `before' in `class-fun-value-seq'."
319 (push 'before class-fun-value-seq) 319 (push 'before class-fun-value-seq)
320 'before) 320 'before)
321 321
322(defmethod class-fun-value :PRIMARY ((a class-a)) 322(defmethod class-fun-value :PRIMARY ((_a class-a))
323 "Return `primary', and push `primary' in `class-fun-value-seq'." 323 "Return `primary', and push `primary' in `class-fun-value-seq'."
324 (push 'primary class-fun-value-seq) 324 (push 'primary class-fun-value-seq)
325 'primary) 325 'primary)
326 326
327(defmethod class-fun-value :AFTER ((a class-a)) 327(defmethod class-fun-value :AFTER ((_a class-a))
328 "Return `after', and push `after' in `class-fun-value-seq'." 328 "Return `after', and push `after' in `class-fun-value-seq'."
329 (push 'after class-fun-value-seq) 329 (push 'after class-fun-value-seq)
330 'after) 330 'after)
@@ -343,14 +343,14 @@ METHOD is the method that was attempting to be called."
343;; 343;;
344 344
345(ert-deftest eieio-test-13-init-methods () 345(ert-deftest eieio-test-13-init-methods ()
346 (defmethod initialize-instance ((a class-a) &rest slots) 346 (defmethod initialize-instance ((a class-a) &rest _slots)
347 "Initialize the slots of class-a." 347 "Initialize the slots of class-a."
348 (call-next-method) 348 (call-next-method)
349 (if (/= (oref a test-tag) 1) 349 (if (/= (oref a test-tag) 1)
350 (error "shared-initialize test failed.")) 350 (error "shared-initialize test failed."))
351 (oset a test-tag 2)) 351 (oset a test-tag 2))
352 352
353 (defmethod shared-initialize ((a class-a) &rest slots) 353 (defmethod shared-initialize ((a class-a) &rest _slots)
354 "Shared initialize method for class-a." 354 "Shared initialize method for class-a."
355 (call-next-method) 355 (call-next-method)
356 (oset a test-tag 1)) 356 (oset a test-tag 1))
@@ -369,7 +369,7 @@ METHOD is the method that was attempting to be called."
369 369
370(ert-deftest eieio-test-15-slot-missing () 370(ert-deftest eieio-test-15-slot-missing ()
371 371
372 (defmethod slot-missing ((ab class-ab) &rest foo) 372 (defmethod slot-missing ((_ab class-ab) &rest _foo)
373 "If a slot in AB is unbound, return something cool. FOO." 373 "If a slot in AB is unbound, return something cool. FOO."
374 'moose) 374 'moose)
375 375
@@ -425,7 +425,7 @@ METHOD is the method that was attempting to be called."
425 425
426(ert-deftest eieio-test-18-slot-unbound () 426(ert-deftest eieio-test-18-slot-unbound ()
427 427
428 (defmethod slot-unbound ((a class-a) &rest foo) 428 (defmethod slot-unbound ((_a class-a) &rest _foo)
429 "If a slot in A is unbound, ignore FOO." 429 "If a slot in A is unbound, ignore FOO."
430 'moose) 430 'moose)
431 431
@@ -448,7 +448,7 @@ METHOD is the method that was attempting to be called."
448 (should (eq (oref (class-a) water) 'penguin)) 448 (should (eq (oref (class-a) water) 'penguin))
449 449
450 ;; Revert the above 450 ;; Revert the above
451 (defmethod slot-unbound ((a class-a) &rest foo) 451 (defmethod slot-unbound ((_a class-a) &rest _foo)
452 "If a slot in A is unbound, ignore FOO." 452 "If a slot in A is unbound, ignore FOO."
453 ;; Disable the old slot-unbound so we can run this test 453 ;; Disable the old slot-unbound so we can run this test
454 ;; more than once 454 ;; more than once
@@ -971,7 +971,7 @@ Subclasses to override slot attributes.")
971 971
972;;;; Interaction with defstruct 972;;;; Interaction with defstruct
973 973
974(cl-defstruct eieio-test--struct a b c) 974(cl-defstruct eieio-test--struct a b (c nil :read-only t))
975 975
976(ert-deftest eieio-test-defstruct-slot-value () 976(ert-deftest eieio-test-defstruct-slot-value ()
977 (let ((x (make-eieio-test--struct :a 'A :b 'B :c 'C))) 977 (let ((x (make-eieio-test--struct :a 'A :b 'B :c 'C)))
@@ -980,7 +980,10 @@ Subclasses to override slot attributes.")
980 (should (eq (eieio-test--struct-b x) 980 (should (eq (eieio-test--struct-b x)
981 (slot-value x 'b))) 981 (slot-value x 'b)))
982 (should (eq (eieio-test--struct-c x) 982 (should (eq (eieio-test--struct-c x)
983 (slot-value x 'c))))) 983 (slot-value x 'c)))
984 (setf (slot-value x 'a) 1)
985 (should (eq (eieio-test--struct-a x) 1))
986 (should-error (setf (slot-value x 'c) 3) :type 'eieio-read-only)))
984 987
985(provide 'eieio-tests) 988(provide 'eieio-tests)
986 989
diff --git a/test/lisp/emacs-lisp/generator-tests.el b/test/lisp/emacs-lisp/generator-tests.el
index 50b8cc53a28..492c4e40853 100644
--- a/test/lisp/emacs-lisp/generator-tests.el
+++ b/test/lisp/emacs-lisp/generator-tests.el
@@ -74,7 +74,7 @@ identical output."
74(cps-testcase cps-prog1-b (prog1 1)) 74(cps-testcase cps-prog1-b (prog1 1))
75(cps-testcase cps-prog1-c (prog2 1 2 3)) 75(cps-testcase cps-prog1-c (prog2 1 2 3))
76(cps-testcase cps-quote (progn 'hello)) 76(cps-testcase cps-quote (progn 'hello))
77(cps-testcase cps-function (progn #'hello)) 77(cps-testcase cps-function (progn #'message))
78 78
79(cps-testcase cps-and-fail (and 1 nil 2)) 79(cps-testcase cps-and-fail (and 1 nil 2))
80(cps-testcase cps-and-succeed (and 1 2 3)) 80(cps-testcase cps-and-succeed (and 1 2 3))
@@ -307,6 +307,7 @@ identical output."
307 (1+ it))))))) 307 (1+ it)))))))
308 -2))) 308 -2)))
309 309
310(defun generator-tests-edebug ()) ; silence byte-compiler
310(ert-deftest generator-tests-edebug () 311(ert-deftest generator-tests-edebug ()
311 "Check that Bug#40434 is fixed." 312 "Check that Bug#40434 is fixed."
312 (with-temp-buffer 313 (with-temp-buffer
diff --git a/test/lisp/emacs-lisp/lisp-tests.el b/test/lisp/emacs-lisp/lisp-tests.el
index 8301d9906a2..7f4d50c5958 100644
--- a/test/lisp/emacs-lisp/lisp-tests.el
+++ b/test/lisp/emacs-lisp/lisp-tests.el
@@ -213,6 +213,7 @@
213 (should-error (forward-sexp)))) ;; FIXME: Shouldn't be an error. 213 (should-error (forward-sexp)))) ;; FIXME: Shouldn't be an error.
214 214
215;; Test some core Elisp rules. 215;; Test some core Elisp rules.
216(defvar c-e-x)
216(ert-deftest core-elisp-tests-1-defvar-in-let () 217(ert-deftest core-elisp-tests-1-defvar-in-let ()
217 "Test some core Elisp rules." 218 "Test some core Elisp rules."
218 (with-temp-buffer 219 (with-temp-buffer
diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el
index 8dc0b93b5af..8cfa3bdb862 100644
--- a/test/lisp/emacs-lisp/seq-tests.el
+++ b/test/lisp/emacs-lisp/seq-tests.el
@@ -172,17 +172,23 @@ Evaluate BODY for each created sequence.
172 (should-not (seq-find #'null '(1 2 3))) 172 (should-not (seq-find #'null '(1 2 3)))
173 (should (seq-find #'null '(1 2 3) 'sentinel))) 173 (should (seq-find #'null '(1 2 3) 'sentinel)))
174 174
175;; Hack to work around the ERT limitation that we can't reliably use
176;; `with-suppressed-warnings' inside an `ert-deftest'. (Bug#36568)
177(defun seq--contains (&rest args)
178 (with-suppressed-warnings ((obsolete seq-contains))
179 (apply #'seq-contains args)))
180
175(ert-deftest test-seq-contains () 181(ert-deftest test-seq-contains ()
176 (with-test-sequences (seq '(3 4 5 6)) 182 (with-test-sequences (seq '(3 4 5 6))
177 (should (seq-contains seq 3)) 183 (should (seq--contains seq 3))
178 (should-not (seq-contains seq 7))) 184 (should-not (seq--contains seq 7)))
179 (with-test-sequences (seq '()) 185 (with-test-sequences (seq '())
180 (should-not (seq-contains seq 3)) 186 (should-not (seq--contains seq 3))
181 (should-not (seq-contains seq nil)))) 187 (should-not (seq--contains seq nil))))
182 188
183(ert-deftest test-seq-contains-should-return-the-elt () 189(ert-deftest test-seq-contains-should-return-the-elt ()
184 (with-test-sequences (seq '(3 4 5 6)) 190 (with-test-sequences (seq '(3 4 5 6))
185 (should (= 5 (seq-contains seq 5))))) 191 (should (= 5 (seq--contains seq 5)))))
186 192
187(ert-deftest test-seq-contains-p () 193(ert-deftest test-seq-contains-p ()
188 (with-test-sequences (seq '(3 4 5 6)) 194 (with-test-sequences (seq '(3 4 5 6))
@@ -404,7 +410,7 @@ Evaluate BODY for each created sequence.
404 (let ((seq '(1 (2 (3 (4)))))) 410 (let ((seq '(1 (2 (3 (4))))))
405 (seq-let (_ (_ (_ (a)))) seq 411 (seq-let (_ (_ (_ (a)))) seq
406 (should (= a 4)))) 412 (should (= a 4))))
407 (let (seq) 413 (let ((seq nil))
408 (seq-let (a b c) seq 414 (seq-let (a b c) seq
409 (should (null a)) 415 (should (null a))
410 (should (null b)) 416 (should (null b))
@@ -428,7 +434,7 @@ Evaluate BODY for each created sequence.
428 (seq '(1 (2 (3 (4)))))) 434 (seq '(1 (2 (3 (4))))))
429 (seq-setq (_ (_ (_ (a)))) seq) 435 (seq-setq (_ (_ (_ (a)))) seq)
430 (should (= a 4))) 436 (should (= a 4)))
431 (let (seq a b c) 437 (let ((seq nil) a b c)
432 (seq-setq (a b c) seq) 438 (seq-setq (a b c) seq)
433 (should (null a)) 439 (should (null a))
434 (should (null b)) 440 (should (null b))
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el
index 69d59e84f6d..d8369506000 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -169,13 +169,13 @@
169 "no") 169 "no")
170 "no")) 170 "no"))
171 (should (equal 171 (should (equal
172 (let (z) 172 (let ((z nil))
173 (if-let* (z (a 1) (b 2) (c 3)) 173 (if-let* (z (a 1) (b 2) (c 3))
174 "yes" 174 "yes"
175 "no")) 175 "no"))
176 "no")) 176 "no"))
177 (should (equal 177 (should (equal
178 (let (d) 178 (let ((d nil))
179 (if-let* ((a 1) (b 2) (c 3) d) 179 (if-let* ((a 1) (b 2) (c 3) d)
180 "yes" 180 "yes"
181 "no")) 181 "no"))
@@ -191,7 +191,7 @@
191 191
192(ert-deftest subr-x-test-if-let*-and-laziness-is-preserved () 192(ert-deftest subr-x-test-if-let*-and-laziness-is-preserved ()
193 "Test `if-let' respects `and' laziness." 193 "Test `if-let' respects `and' laziness."
194 (let (a-called b-called c-called) 194 (let ((a-called nil) (b-called nil) c-called)
195 (should (equal 195 (should (equal
196 (if-let* ((a nil) 196 (if-let* ((a nil)
197 (b (setq b-called t)) 197 (b (setq b-called t))
@@ -199,7 +199,7 @@
199 "yes" 199 "yes"
200 (list a-called b-called c-called)) 200 (list a-called b-called c-called))
201 (list nil nil nil)))) 201 (list nil nil nil))))
202 (let (a-called b-called c-called) 202 (let ((a-called nil) (b-called nil) c-called)
203 (should (equal 203 (should (equal
204 (if-let* ((a (setq a-called t)) 204 (if-let* ((a (setq a-called t))
205 (b nil) 205 (b nil)
@@ -207,12 +207,12 @@
207 "yes" 207 "yes"
208 (list a-called b-called c-called)) 208 (list a-called b-called c-called))
209 (list t nil nil)))) 209 (list t nil nil))))
210 (let (a-called b-called c-called) 210 (let ((a-called nil) (b-called nil) c-called)
211 (should (equal 211 (should (equal
212 (if-let* ((a (setq a-called t)) 212 (if-let* ((a (setq a-called t))
213 (b (setq b-called t)) 213 (b (setq b-called t))
214 (c nil) 214 (c nil)
215 (d (setq c-called t))) 215 (d (setq c-called t)))
216 "yes" 216 "yes"
217 (list a-called b-called c-called)) 217 (list a-called b-called c-called))
218 (list t t nil))))) 218 (list t t nil)))))
@@ -329,12 +329,12 @@
329 "no") 329 "no")
330 nil)) 330 nil))
331 (should (equal 331 (should (equal
332 (let (z) 332 (let ((z nil))
333 (when-let* (z (a 1) (b 2) (c 3)) 333 (when-let* (z (a 1) (b 2) (c 3))
334 "no")) 334 "no"))
335 nil)) 335 nil))
336 (should (equal 336 (should (equal
337 (let (d) 337 (let ((d nil))
338 (when-let* ((a 1) (b 2) (c 3) d) 338 (when-let* ((a 1) (b 2) (c 3) d)
339 "no")) 339 "no"))
340 nil))) 340 nil)))
@@ -348,7 +348,7 @@
348 348
349(ert-deftest subr-x-test-when-let*-and-laziness-is-preserved () 349(ert-deftest subr-x-test-when-let*-and-laziness-is-preserved ()
350 "Test `when-let' respects `and' laziness." 350 "Test `when-let' respects `and' laziness."
351 (let (a-called b-called c-called) 351 (let ((a-called nil) (b-called nil) (c-called nil))
352 (should (equal 352 (should (equal
353 (progn 353 (progn
354 (when-let* ((a nil) 354 (when-let* ((a nil)
@@ -357,7 +357,7 @@
357 "yes") 357 "yes")
358 (list a-called b-called c-called)) 358 (list a-called b-called c-called))
359 (list nil nil nil)))) 359 (list nil nil nil))))
360 (let (a-called b-called c-called) 360 (let ((a-called nil) (b-called nil) (c-called nil))
361 (should (equal 361 (should (equal
362 (progn 362 (progn
363 (when-let* ((a (setq a-called t)) 363 (when-let* ((a (setq a-called t))
@@ -366,7 +366,7 @@
366 "yes") 366 "yes")
367 (list a-called b-called c-called)) 367 (list a-called b-called c-called))
368 (list t nil nil)))) 368 (list t nil nil))))
369 (let (a-called b-called c-called) 369 (let ((a-called nil) (b-called nil) (c-called nil))
370 (should (equal 370 (should (equal
371 (progn 371 (progn
372 (when-let* ((a (setq a-called t)) 372 (when-let* ((a (setq a-called t))
diff --git a/test/lisp/emacs-lisp/timer-tests.el b/test/lisp/emacs-lisp/timer-tests.el
index 7856c217f9e..0f5b1a71868 100644
--- a/test/lisp/emacs-lisp/timer-tests.el
+++ b/test/lisp/emacs-lisp/timer-tests.el
@@ -37,7 +37,8 @@
37(ert-deftest timer-tests-debug-timer-check () 37(ert-deftest timer-tests-debug-timer-check ()
38 ;; This function exists only if --enable-checking. 38 ;; This function exists only if --enable-checking.
39 (skip-unless (fboundp 'debug-timer-check)) 39 (skip-unless (fboundp 'debug-timer-check))
40 (should (debug-timer-check))) 40 (when (fboundp 'debug-timer-check) ; silence byte-compiler
41 (should (debug-timer-check))))
41 42
42(ert-deftest timer-test-multiple-of-time () 43(ert-deftest timer-test-multiple-of-time ()
43 (should (time-equal-p 44 (should (time-equal-p
diff --git a/test/lisp/format-spec-tests.el b/test/lisp/format-spec-tests.el
index ff2abdeaad5..3c6fa540fe8 100644
--- a/test/lisp/format-spec-tests.el
+++ b/test/lisp/format-spec-tests.el
@@ -56,7 +56,7 @@
56 56
57(ert-deftest format-spec-do-flags-truncate () 57(ert-deftest format-spec-do-flags-truncate ()
58 "Test `format-spec--do-flags' truncation." 58 "Test `format-spec--do-flags' truncation."
59 (let (flags) 59 (let ((flags nil))
60 (should (equal (format-spec--do-flags "" flags nil 0) "")) 60 (should (equal (format-spec--do-flags "" flags nil 0) ""))
61 (should (equal (format-spec--do-flags "" flags nil 1) "")) 61 (should (equal (format-spec--do-flags "" flags nil 1) ""))
62 (should (equal (format-spec--do-flags "a" flags nil 0) "")) 62 (should (equal (format-spec--do-flags "a" flags nil 0) ""))
@@ -75,7 +75,7 @@
75 75
76(ert-deftest format-spec-do-flags-pad () 76(ert-deftest format-spec-do-flags-pad ()
77 "Test `format-spec--do-flags' padding." 77 "Test `format-spec--do-flags' padding."
78 (let (flags) 78 (let ((flags nil))
79 (should (equal (format-spec--do-flags "" flags 0 nil) "")) 79 (should (equal (format-spec--do-flags "" flags 0 nil) ""))
80 (should (equal (format-spec--do-flags "" flags 1 nil) " ")) 80 (should (equal (format-spec--do-flags "" flags 1 nil) " "))
81 (should (equal (format-spec--do-flags "a" flags 0 nil) "a")) 81 (should (equal (format-spec--do-flags "a" flags 0 nil) "a"))
diff --git a/test/lisp/ls-lisp-tests.el b/test/lisp/ls-lisp-tests.el
index e3a75bed41d..9f2c63225b5 100644
--- a/test/lisp/ls-lisp-tests.el
+++ b/test/lisp/ls-lisp-tests.el
@@ -54,7 +54,8 @@
54 (kill-buffer buf) 54 (kill-buffer buf)
55 (setq buf (dired (nconc (list dir) files))) 55 (setq buf (dired (nconc (list dir) files)))
56 (should (looking-at "src")) 56 (should (looking-at "src"))
57 (next-line) ; File names must be aligned. 57 (with-suppressed-warnings ((interactive-only next-line))
58 (next-line)) ; File names must be aligned.
58 (should (looking-at "src"))) 59 (should (looking-at "src")))
59 (when (buffer-live-p buf) (kill-buffer buf))))) 60 (when (buffer-live-p buf) (kill-buffer buf)))))
60 61
diff --git a/test/lisp/obsolete/cl-tests.el b/test/lisp/obsolete/cl-tests.el
index 0e02e1ca1bc..0b8c1178f3a 100644
--- a/test/lisp/obsolete/cl-tests.el
+++ b/test/lisp/obsolete/cl-tests.el
@@ -27,10 +27,15 @@
27 27
28 28
29 29
30;; Hack to work around the ERT limitation that we can't reliably use
31;; `with-suppressed-warnings' inside an `ert-deftest'. (Bug#36568)
32(defun cl-tests-labels-test ()
33 (with-suppressed-warnings ((obsolete labels))
34 (funcall (labels ((foo () t))
35 #'foo))))
36
30(ert-deftest labels-function-quoting () 37(ert-deftest labels-function-quoting ()
31 "Test that #'foo does the right thing in `labels'." ; Bug#31792. 38 "Test that #'foo does the right thing in `labels'." ; Bug#31792.
32 (should (eq (funcall (labels ((foo () t)) 39 (should (eq (cl-tests-labels-test) t)))
33 #'foo))
34 t)))
35 40
36;;; cl-tests.el ends here 41;;; cl-tests.el ends here
diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el
index 63bae79bb40..9dc5e8cadcf 100644
--- a/test/lisp/progmodes/elisp-mode-tests.el
+++ b/test/lisp/progmodes/elisp-mode-tests.el
@@ -438,7 +438,8 @@ to (xref-elisp-test-descr-to-target xref)."
438;; track down the problem. 438;; track down the problem.
439(cl-defmethod xref-elisp-generic-no-default ((this xref-elisp-root-type) arg2) 439(cl-defmethod xref-elisp-generic-no-default ((this xref-elisp-root-type) arg2)
440 "Doc string generic no-default xref-elisp-root-type." 440 "Doc string generic no-default xref-elisp-root-type."
441 "non-default for no-default") 441 "non-default for no-default"
442 (list this arg2)) ; silence byte-compiler
442 443
443;; defgeneric after defmethod in file to ensure the fallback search 444;; defgeneric after defmethod in file to ensure the fallback search
444;; method of just looking for the function name will fail. 445;; method of just looking for the function name will fail.
@@ -463,19 +464,23 @@ to (xref-elisp-test-descr-to-target xref)."
463 464
464(cl-defmethod xref-elisp-generic-separate-default (arg1 arg2) 465(cl-defmethod xref-elisp-generic-separate-default (arg1 arg2)
465 "Doc string generic separate-default default." 466 "Doc string generic separate-default default."
466 "separate default") 467 "separate default"
468 (list arg1 arg2)) ; silence byte-compiler
467 469
468(cl-defmethod xref-elisp-generic-separate-default ((this xref-elisp-root-type) arg2) 470(cl-defmethod xref-elisp-generic-separate-default ((this xref-elisp-root-type) arg2)
469 "Doc string generic separate-default xref-elisp-root-type." 471 "Doc string generic separate-default xref-elisp-root-type."
470 "non-default for separate-default") 472 "non-default for separate-default"
473 (list this arg2)) ; silence byte-compiler
471 474
472(cl-defmethod xref-elisp-generic-implicit-generic (arg1 arg2) 475(cl-defmethod xref-elisp-generic-implicit-generic (arg1 arg2)
473 "Doc string generic implicit-generic default." 476 "Doc string generic implicit-generic default."
474 "default for implicit generic") 477 "default for implicit generic"
478 (list arg1 arg2)) ; silence byte-compiler
475 479
476(cl-defmethod xref-elisp-generic-implicit-generic ((this xref-elisp-root-type) arg2) 480(cl-defmethod xref-elisp-generic-implicit-generic ((this xref-elisp-root-type) arg2)
477 "Doc string generic implicit-generic xref-elisp-root-type." 481 "Doc string generic implicit-generic xref-elisp-root-type."
478 "non-default for implicit generic") 482 "non-default for implicit generic"
483 (list this arg2)) ; silence byte-compiler
479 484
480 485
481(xref-elisp-deftest find-defs-defgeneric-no-methods 486(xref-elisp-deftest find-defs-defgeneric-no-methods
@@ -845,7 +850,8 @@ to (xref-elisp-test-descr-to-target xref)."
845 (if (stringp form) 850 (if (stringp form)
846 (insert form) 851 (insert form)
847 (pp form (current-buffer))) 852 (pp form (current-buffer)))
848 (font-lock-debug-fontify) 853 (with-suppressed-warnings ((interactive-only font-lock-debug-fontify))
854 (font-lock-debug-fontify))
849 (goto-char (point-min)) 855 (goto-char (point-min))
850 (and (re-search-forward search nil t) 856 (and (re-search-forward search nil t)
851 (get-text-property (match-beginning 1) 'face)))) 857 (get-text-property (match-beginning 1) 'face))))
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index 7f62a417a02..dcd5ebb1fe6 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -599,11 +599,12 @@ bound to HIGHLIGHT-LOCUS."
599 (with-temp-buffer 599 (with-temp-buffer
600 (insert before) 600 (insert before)
601 (goto-char (point-min)) 601 (goto-char (point-min))
602 (replace-regexp 602 (with-suppressed-warnings ((interactive-only replace-regexp))
603 "\\(\\(L\\)\\|\\(R\\)\\)" 603 (replace-regexp
604 '(replace-eval-replacement 604 "\\(\\(L\\)\\|\\(R\\)\\)"
605 replace-quote 605 '(replace-eval-replacement
606 (if (match-string 2) "R" "L"))) 606 replace-quote
607 (if (match-string 2) "R" "L"))))
607 (should (equal (buffer-string) after))))) 608 (should (equal (buffer-string) after)))))
608 609
609(ert-deftest test-count-matches () 610(ert-deftest test-count-matches ()
diff --git a/test/lisp/ses-tests.el b/test/lisp/ses-tests.el
index 9a7fb502d7c..932291afcc1 100644
--- a/test/lisp/ses-tests.el
+++ b/test/lisp/ses-tests.el
@@ -24,6 +24,10 @@
24(require 'ert) 24(require 'ert)
25(require 'ses) 25(require 'ses)
26 26
27;; Silence byte-compiler.
28(with-suppressed-warnings ((lexical A2) (lexical A3))
29 (defvar A2)
30 (defvar A3))
27 31
28;; PLAIN FORMULA TESTS 32;; PLAIN FORMULA TESTS
29;; ====================================================================== 33;; ======================================================================
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index e02de952f2f..063c6fe6a7b 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -926,6 +926,7 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350."
926 (should-not (apropos-internal "^next-line$" #'keymapp))) 926 (should-not (apropos-internal "^next-line$" #'keymapp)))
927 927
928 928
929(defvar test-global-boundp)
929(ert-deftest test-buffer-local-boundp () 930(ert-deftest test-buffer-local-boundp ()
930 (let ((buf (generate-new-buffer "boundp"))) 931 (let ((buf (generate-new-buffer "boundp")))
931 (with-current-buffer buf 932 (with-current-buffer buf
diff --git a/test/lisp/tar-mode-tests.el b/test/lisp/tar-mode-tests.el
index 6964d423185..dd430cac2fd 100644
--- a/test/lisp/tar-mode-tests.el
+++ b/test/lisp/tar-mode-tests.el
@@ -24,6 +24,12 @@
24(defvar tar-mode-tests-data-directory 24(defvar tar-mode-tests-data-directory
25 (expand-file-name "test/data/decompress" source-directory)) 25 (expand-file-name "test/data/decompress" source-directory))
26 26
27;; Hack to work around the ERT limitation that we can't reliably use
28;; `with-suppressed-warnings' inside an `ert-deftest'. (Bug#36568)
29(defun tar-mode-tests--tar-grind-file-mode (&rest args)
30 (with-suppressed-warnings ((obsolete tar-grind-file-mode))
31 (apply #'tar-grind-file-mode args)))
32
27(ert-deftest tar-mode-test-tar-grind-file-mode () 33(ert-deftest tar-mode-test-tar-grind-file-mode ()
28 (let ((alist (list (cons 448 "rwx------") 34 (let ((alist (list (cons 448 "rwx------")
29 (cons 420 "rw-r--r--") 35 (cons 420 "rw-r--r--")
@@ -32,7 +38,7 @@
32 (cons 1024 "-----S---") 38 (cons 1024 "-----S---")
33 (cons 2048 "--S------")))) 39 (cons 2048 "--S------"))))
34 (dolist (x alist) 40 (dolist (x alist)
35 (should (equal (cdr x) (tar-grind-file-mode (car x))))))) 41 (should (equal (cdr x) (tar-mode-tests--tar-grind-file-mode (car x)))))))
36 42
37(ert-deftest tar-mode-test-tar-extract-gz () 43(ert-deftest tar-mode-test-tar-extract-gz ()
38 (skip-unless (executable-find "gzip")) 44 (skip-unless (executable-find "gzip"))
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index dfc12735bda..8cc271b9e1c 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -433,26 +433,27 @@ comparing the subr with a much slower Lisp implementation."
433 ;; More specifically, test the problem seen in bug#41029 where setting 433 ;; More specifically, test the problem seen in bug#41029 where setting
434 ;; the default value of a variable takes time proportional to the 434 ;; the default value of a variable takes time proportional to the
435 ;; number of buffers. 435 ;; number of buffers.
436 (let* ((fun #'error) 436 (when (fboundp 'current-cpu-time) ; silence byte-compiler
437 (test (lambda () 437 (let* ((fun #'error)
438 (with-temp-buffer 438 (test (lambda ()
439 (let ((st (car (current-cpu-time)))) 439 (with-temp-buffer
440 (dotimes (_ 1000) 440 (let ((st (car (current-cpu-time))))
441 (let ((case-fold-search 'data-test)) 441 (dotimes (_ 1000)
442 ;; Use an indirection through a mutable var 442 (let ((case-fold-search 'data-test))
443 ;; to try and make sure the byte-compiler 443 ;; Use an indirection through a mutable var
444 ;; doesn't optimize away the let bindings. 444 ;; to try and make sure the byte-compiler
445 (funcall fun))) 445 ;; doesn't optimize away the let bindings.
446 ;; FIXME: Handle the wraparound, if any. 446 (funcall fun)))
447 (- (car (current-cpu-time)) st))))) 447 ;; FIXME: Handle the wraparound, if any.
448 (_ (setq fun #'ignore)) 448 (- (car (current-cpu-time)) st)))))
449 (time1 (funcall test)) 449 (_ (setq fun #'ignore))
450 (bufs (mapcar (lambda (_) (generate-new-buffer " data-test")) 450 (time1 (funcall test))
451 (make-list 1000 nil))) 451 (bufs (mapcar (lambda (_) (generate-new-buffer " data-test"))
452 (time2 (funcall test))) 452 (make-list 1000 nil)))
453 (mapc #'kill-buffer bufs) 453 (time2 (funcall test)))
454 ;; Don't divide one time by the other since they may be 0. 454 (mapc #'kill-buffer bufs)
455 (should (< time2 (* time1 5))))) 455 ;; Don't divide one time by the other since they may be 0.
456 (should (< time2 (* time1 5))))))
456 457
457;; More tests to write - 458;; More tests to write -
458;; kill-local-variable 459;; kill-local-variable
diff --git a/test/src/search-tests.el b/test/src/search-tests.el
index b7b4ab9a8ff..b5f4730f265 100644
--- a/test/src/search-tests.el
+++ b/test/src/search-tests.el
@@ -28,7 +28,7 @@
28 (setq ov-set (make-overlay 3 5)) 28 (setq ov-set (make-overlay 3 5))
29 (overlay-put 29 (overlay-put
30 ov-set 'modification-hooks 30 ov-set 'modification-hooks
31 (list (lambda (o after &rest _args) 31 (list (lambda (_o after &rest _args)
32 (when after 32 (when after
33 (let ((inhibit-modification-hooks t)) 33 (let ((inhibit-modification-hooks t))
34 (save-excursion 34 (save-excursion