aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuuki Harano2021-05-06 21:47:23 +0900
committerYuuki Harano2021-05-06 21:47:23 +0900
commitff3d7190bbaebf196c0ac7f84d4869fa9362276f (patch)
treee00d8dd9815703e4081abb7d5a3efae52d1a6eb0
parent5b97b98daa7f61311c3662beecbeca7037505992 (diff)
parent896384b542cabdc000eafb80c9082830f692bbb2 (diff)
downloademacs-ff3d7190bbaebf196c0ac7f84d4869fa9362276f.tar.gz
emacs-ff3d7190bbaebf196c0ac7f84d4869fa9362276f.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
-rw-r--r--etc/NEWS16
-rw-r--r--lisp/bookmark.el64
-rw-r--r--lisp/dired-aux.el5
-rw-r--r--lisp/emacs-lisp/advice.el2
-rw-r--r--lisp/emacs-lisp/comp.el2
-rw-r--r--lisp/emacs-lisp/map.el32
-rw-r--r--lisp/emacs-lisp/nadvice.el2
-rw-r--r--lisp/emacs-lisp/package.el4
-rw-r--r--lisp/emacs-lisp/rmc.el129
-rw-r--r--lisp/files.el63
-rw-r--r--lisp/help.el2
-rw-r--r--lisp/info.el18
-rw-r--r--lisp/kmacro.el2
-rw-r--r--lisp/language/japan-util.el4
-rw-r--r--lisp/loadup.el4
-rw-r--r--lisp/mail/sendmail.el8
-rw-r--r--lisp/mail/smtpmail.el39
-rw-r--r--lisp/progmodes/cperl-mode.el16
-rw-r--r--lisp/progmodes/js.el1
-rw-r--r--lisp/ses.el13
-rw-r--r--lisp/startup.el4
-rw-r--r--lisp/textmodes/ispell.el2
-rw-r--r--lisp/window.el2
-rw-r--r--src/comp.c2
-rw-r--r--src/frame.c71
-rw-r--r--src/minibuf.c18
-rw-r--r--test/lisp/emacs-lisp/map-tests.el37
-rw-r--r--test/lisp/help-fns-tests.el6
-rw-r--r--test/lisp/progmodes/cperl-mode-tests.el27
-rw-r--r--test/src/comp-tests.el2
30 files changed, 373 insertions, 224 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 8f4a6837b1a..737b64b0dad 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -276,6 +276,22 @@ commands. The new keystrokes are 'C-x x g' ('revert-buffer'),
276** Commands 'set-frame-width' and 'set-frame-height' can now get their 276** Commands 'set-frame-width' and 'set-frame-height' can now get their
277input using the minibuffer. 277input using the minibuffer.
278 278
279---
280** New user option 'bookmark-menu-confirm-deletion'
281In Bookmark Menu mode, Emacs by default does not prompt for
282confirmation when you type 'x' to execute the deletion of bookmarks
283that have been marked for deletion. However, if this new option is
284non-nil then Emacs will require confirmation with 'yes-or-no-p' before
285deleting.
286
287---
288** New help window when Emacs prompts before opening a large file.
289Commands like 'find-file' or 'visit-tags-table' ask to visit a file
290normally or literally when the file is larger than a certain size (by
291default, 9.5 MiB). Press '?' or 'C-h' in that prompt to read more
292about the different options to visit a file, how you can disable the
293prompt, and how you can tweak the file size threshold.
294
279 295
280* Editing Changes in Emacs 28.1 296* Editing Changes in Emacs 28.1
281 297
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 3b7519059f7..64b467adfae 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -121,6 +121,12 @@ recently set ones come first, oldest ones come last)."
121 :type 'boolean) 121 :type 'boolean)
122 122
123 123
124(defcustom bookmark-menu-confirm-deletion nil
125 "Non-nil means confirm before deleting bookmarks in a bookmark menu buffer.
126Nil means don't prompt for confirmation."
127 :version "28.1"
128 :type 'boolean)
129
124(defcustom bookmark-automatically-show-annotations t 130(defcustom bookmark-automatically-show-annotations t
125 "Non-nil means show annotations when jumping to a bookmark." 131 "Non-nil means show annotations when jumping to a bookmark."
126 :type 'boolean) 132 :type 'boolean)
@@ -1433,6 +1439,13 @@ probably because we were called from there."
1433If optional argument NO-CONFIRM is non-nil, don't ask for 1439If optional argument NO-CONFIRM is non-nil, don't ask for
1434confirmation." 1440confirmation."
1435 (interactive "P") 1441 (interactive "P")
1442 ;; We don't use `bookmark-menu-confirm-deletion' here because that
1443 ;; variable is specifically to control confirmation prompting in a
1444 ;; bookmark menu buffer, where the user has the marked-for-deletion
1445 ;; bookmarks arrayed in front of them and might have accidentally
1446 ;; hit the key that executes the deletions. The UI situation here
1447 ;; is quite different, by contrast: the user got to this point by a
1448 ;; sequence of keystrokes unlikely to be typed by chance.
1436 (when (or no-confirm 1449 (when (or no-confirm
1437 (yes-or-no-p "Permanently delete all bookmarks? ")) 1450 (yes-or-no-p "Permanently delete all bookmarks? "))
1438 (bookmark-maybe-load-default-file) 1451 (bookmark-maybe-load-default-file)
@@ -2199,30 +2212,35 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
2199 2212
2200 2213
2201(defun bookmark-bmenu-execute-deletions () 2214(defun bookmark-bmenu-execute-deletions ()
2202 "Delete bookmarks flagged `D'." 2215 "Delete bookmarks flagged `D'.
2216If `bookmark-menu-confirm-deletion' is non-nil, prompt for
2217confirmation first."
2203 (interactive nil bookmark-bmenu-mode) 2218 (interactive nil bookmark-bmenu-mode)
2204 (let ((reporter (make-progress-reporter "Deleting bookmarks...")) 2219 (if (and bookmark-menu-confirm-deletion
2205 (o-point (point)) 2220 (not (yes-or-no-p "Delete selected bookmarks? ")))
2206 (o-str (save-excursion 2221 (message "Bookmarks not deleted.")
2207 (beginning-of-line) 2222 (let ((reporter (make-progress-reporter "Deleting bookmarks..."))
2208 (unless (= (following-char) ?D) 2223 (o-point (point))
2209 (buffer-substring 2224 (o-str (save-excursion
2210 (point) 2225 (beginning-of-line)
2211 (progn (end-of-line) (point)))))) 2226 (unless (= (following-char) ?D)
2212 (o-col (current-column))) 2227 (buffer-substring
2213 (goto-char (point-min)) 2228 (point)
2214 (while (re-search-forward "^D" (point-max) t) 2229 (progn (end-of-line) (point))))))
2215 (bookmark-delete (bookmark-bmenu-bookmark) t)) ; pass BATCH arg 2230 (o-col (current-column)))
2216 (bookmark-bmenu-list) 2231 (goto-char (point-min))
2217 (if o-str 2232 (while (re-search-forward "^D" (point-max) t)
2218 (progn 2233 (bookmark-delete (bookmark-bmenu-bookmark) t)) ; pass BATCH arg
2219 (goto-char (point-min)) 2234 (bookmark-bmenu-list)
2220 (search-forward o-str) 2235 (if o-str
2221 (beginning-of-line) 2236 (progn
2222 (forward-char o-col)) 2237 (goto-char (point-min))
2223 (goto-char o-point)) 2238 (search-forward o-str)
2224 (beginning-of-line) 2239 (beginning-of-line)
2225 (progress-reporter-done reporter))) 2240 (forward-char o-col))
2241 (goto-char o-point))
2242 (beginning-of-line)
2243 (progress-reporter-done reporter))))
2226 2244
2227 2245
2228(defun bookmark-bmenu-rename () 2246(defun bookmark-bmenu-rename ()
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 8fe612fa0b1..8fce402c7ad 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1962,6 +1962,11 @@ ESC or `q' to not overwrite any of the remaining files,
1962 (file-in-directory-p destname from) 1962 (file-in-directory-p destname from)
1963 (error "Cannot copy `%s' into its subdirectory `%s'" 1963 (error "Cannot copy `%s' into its subdirectory `%s'"
1964 from to))) 1964 from to)))
1965 ;; Check, that `dired-do-symlink' does not create symlinks
1966 ;; on different hosts.
1967 (when (and (eq file-creator 'make-symbolic-link)
1968 (not (equal (file-remote-p from) (file-remote-p to))))
1969 (error "Cannot symlink `%s' to `%s' on another host" from to))
1965 (condition-case err 1970 (condition-case err
1966 (progn 1971 (progn
1967 (funcall file-creator from to dired-overwrite-confirmed) 1972 (funcall file-creator from to dired-overwrite-confirmed)
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index dc8636f8f76..8e8d0e22651 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2076,7 +2076,7 @@ mapped to the closest extremal position).
2076If FUNCTION was not advised already, its advice info will be 2076If FUNCTION was not advised already, its advice info will be
2077initialized. Redefining a piece of advice whose name is part of 2077initialized. Redefining a piece of advice whose name is part of
2078the cache-id will clear the cache." 2078the cache-id will clear the cache."
2079 (when (and (featurep 'nativecomp) 2079 (when (and (featurep 'native-compile)
2080 (subr-primitive-p (symbol-function function))) 2080 (subr-primitive-p (symbol-function function)))
2081 (comp-subr-trampoline-install function)) 2081 (comp-subr-trampoline-install function))
2082 (cond ((not (ad-is-advised function)) 2082 (cond ((not (ad-is-advised function))
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 297c1f7ebca..f700faa38b3 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -938,7 +938,7 @@ In use by the back-end."
938Signal an error otherwise. 938Signal an error otherwise.
939To be used by all entry points." 939To be used by all entry points."
940 (cond 940 (cond
941 ((null (featurep 'nativecomp)) 941 ((null (featurep 'native-compile))
942 (error "Emacs was not compiled with native compiler support (--with-native-compilation)")) 942 (error "Emacs was not compiled with native compiler support (--with-native-compilation)"))
943 ((null (native-comp-available-p)) 943 ((null (native-comp-available-p))
944 (error "Cannot find libgccjit library")))) 944 (error "Cannot find libgccjit library"))))
diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el
index c0cbc7b5a18..5c76fb9eb95 100644
--- a/lisp/emacs-lisp/map.el
+++ b/lisp/emacs-lisp/map.el
@@ -124,7 +124,9 @@ or array."
124 (with-no-warnings (map-put! ,mgetter ,key ,v ,testfn)) 124 (with-no-warnings (map-put! ,mgetter ,key ,v ,testfn))
125 (map-not-inplace 125 (map-not-inplace
126 ,(funcall msetter 126 ,(funcall msetter
127 `(map-insert ,mgetter ,key ,v)))))))))) 127 `(map-insert ,mgetter ,key ,v))
128 ;; Always return the value.
129 ,v))))))))
128 ;; `testfn' is deprecated. 130 ;; `testfn' is deprecated.
129 (advertised-calling-convention (map key &optional default) "27.1")) 131 (advertised-calling-convention (map key &optional default) "27.1"))
130 ;; Can't use `cl-defmethod' with `advertised-calling-convention'. 132 ;; Can't use `cl-defmethod' with `advertised-calling-convention'.
@@ -429,18 +431,22 @@ To insert an element without modifying MAP, use `map-insert'."
429 ;; `testfn' only exists for backward compatibility with `map-put'! 431 ;; `testfn' only exists for backward compatibility with `map-put'!
430 (declare (advertised-calling-convention (map key value) "27.1")) 432 (declare (advertised-calling-convention (map key value) "27.1"))
431 ;; Can't use `cl-defmethod' with `advertised-calling-convention'. 433 ;; Can't use `cl-defmethod' with `advertised-calling-convention'.
432 (map--dispatch map 434 (map--dispatch
433 :list 435 map
434 (if (map--plist-p map) 436 :list
435 (plist-put map key value) 437 (progn
436 (let ((oldmap map)) 438 (if (map--plist-p map)
437 (setf (alist-get key map key nil (or testfn #'equal)) value) 439 (plist-put map key value)
438 (unless (eq oldmap map) 440 (let ((oldmap map))
439 (signal 'map-not-inplace (list oldmap))))) 441 (setf (alist-get key map key nil (or testfn #'equal)) value)
440 :hash-table (puthash key value map) 442 (unless (eq oldmap map)
441 ;; FIXME: If `key' is too large, should we signal `map-not-inplace' 443 (signal 'map-not-inplace (list oldmap)))))
442 ;; and let `map-insert' grow the array? 444 ;; Always return the value.
443 :array (aset map key value))) 445 value)
446 :hash-table (puthash key value map)
447 ;; FIXME: If `key' is too large, should we signal `map-not-inplace'
448 ;; and let `map-insert' grow the array?
449 :array (aset map key value)))
444 450
445(cl-defgeneric map-insert (map key value) 451(cl-defgeneric map-insert (map key value)
446 "Return a new map like MAP except that it associates KEY with VALUE. 452 "Return a new map like MAP except that it associates KEY with VALUE.
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index f9740565389..747572a3363 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -320,7 +320,7 @@ is also interactive. There are 3 cases:
320 320
321;;;###autoload 321;;;###autoload
322(defun advice--add-function (where ref function props) 322(defun advice--add-function (where ref function props)
323 (when (and (featurep 'nativecomp) 323 (when (and (featurep 'native-compile)
324 (subr-primitive-p (gv-deref ref))) 324 (subr-primitive-p (gv-deref ref)))
325 (let ((subr-name (intern (subr-name (gv-deref ref))))) 325 (let ((subr-name (intern (subr-name (gv-deref ref)))))
326 ;; Requiring the native compiler to advice `macroexpand' cause a 326 ;; Requiring the native compiler to advice `macroexpand' cause a
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 503585079e4..e1339177519 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1081,7 +1081,7 @@ This assumes that `pkg-desc' has already been activated with
1081 "Native compile installed package PKG-DESC asynchronously. 1081 "Native compile installed package PKG-DESC asynchronously.
1082This assumes that `pkg-desc' has already been activated with 1082This assumes that `pkg-desc' has already been activated with
1083`package-activate-1'." 1083`package-activate-1'."
1084 (when (and (featurep 'nativecomp) 1084 (when (and (featurep 'native-compile)
1085 (native-comp-available-p)) 1085 (native-comp-available-p))
1086 (let ((warning-minimum-level :error)) 1086 (let ((warning-minimum-level :error))
1087 (native-compile-async (package-desc-dir pkg-desc) t)))) 1087 (native-compile-async (package-desc-dir pkg-desc) t))))
@@ -2265,7 +2265,7 @@ confirmation to install packages."
2265 "Delete DIR recursively. 2265 "Delete DIR recursively.
2266Clean-up the corresponding .eln files if Emacs is native 2266Clean-up the corresponding .eln files if Emacs is native
2267compiled." 2267compiled."
2268 (when (featurep 'nativecomp) 2268 (when (featurep 'native-compile)
2269 (cl-loop 2269 (cl-loop
2270 for file in (directory-files-recursively dir ".el\\'") 2270 for file in (directory-files-recursively dir ".el\\'")
2271 do (comp-clean-up-stale-eln (comp-el-to-eln-filename file)))) 2271 do (comp-clean-up-stale-eln (comp-el-to-eln-filename file))))
diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el
index bedf598d442..6aa169c0323 100644
--- a/lisp/emacs-lisp/rmc.el
+++ b/lisp/emacs-lisp/rmc.el
@@ -26,24 +26,32 @@
26(require 'seq) 26(require 'seq)
27 27
28;;;###autoload 28;;;###autoload
29(defun read-multiple-choice (prompt choices) 29(defun read-multiple-choice (prompt choices &optional help-string)
30 "Ask user a multiple choice question. 30 "Ask user a multiple choice question.
31PROMPT should be a string that will be displayed as the prompt. 31PROMPT should be a string that will be displayed as the prompt.
32 32
33CHOICES is a list of (KEY NAME [DESCRIPTION]). KEY is a 33CHOICES is a list of (KEY NAME [DESCRIPTION]). KEY is a
34character to be entered. NAME is a short name for the entry to 34character to be entered. NAME is a short name for the entry to
35be displayed while prompting (if there's room, it might be 35be displayed while prompting (if there's room, it might be
36shortened). DESCRIPTION is an optional longer explanation that 36shortened). DESCRIPTION is an optional longer explanation for
37will be displayed in a help buffer if the user requests more 37the entry that will be displayed in a help buffer if the user
38help. 38requests more help. This help description has a fixed format in
39columns, but, for greater flexibility, instead of passing a
40DESCRIPTION, the user can use the optional argument HELP-STRING.
41This argument is a string that contains the text with the
42complete description of all choices. `read-multiple-choice' will
43display that description in a help buffer if the user requests
44it.
39 45
40This function translates user input into responses by consulting 46This function translates user input into responses by consulting
41the bindings in `query-replace-map'; see the documentation of 47the bindings in `query-replace-map'; see the documentation of
42that variable for more information. In this case, the useful 48that variable for more information. In this case, the useful
43bindings are `recenter', `scroll-up', and `scroll-down'. If the 49bindings are `recenter', `scroll-up', `scroll-down', and `edit'.
44user enters `recenter', `scroll-up', or `scroll-down' responses, 50If the user enters `recenter', `scroll-up', or `scroll-down'
45perform the requested window recentering or scrolling and ask 51responses, perform the requested window recentering or scrolling
46again. 52and ask again. If the user enters `edit', start a recursive
53edit. When the user exit the recursive edit, the multiple choice
54prompt gains focus again.
47 55
48When `use-dialog-box' is t (the default), this function can pop 56When `use-dialog-box' is t (the default), this function can pop
49up a dialog window to collect the user input. That functionality 57up a dialog window to collect the user input. That functionality
@@ -133,6 +141,13 @@ Usage example:
133 (ignore-errors (scroll-other-window)) t) 141 (ignore-errors (scroll-other-window)) t)
134 ((eq answer 'scroll-other-window-down) 142 ((eq answer 'scroll-other-window-down)
135 (ignore-errors (scroll-other-window-down)) t) 143 (ignore-errors (scroll-other-window-down)) t)
144 ((eq answer 'edit)
145 (save-match-data
146 (save-excursion
147 (message "%s"
148 (substitute-command-keys
149 "Recursive edit. Resume with \\[exit-recursive-edit]"))
150 (recursive-edit))))
136 (t tchar))) 151 (t tchar)))
137 (when (eq tchar t) 152 (when (eq tchar t)
138 (setq wrong-char nil 153 (setq wrong-char nil
@@ -141,57 +156,61 @@ Usage example:
141 ;; help messages. 156 ;; help messages.
142 (when (and (not (eq tchar nil)) 157 (when (and (not (eq tchar nil))
143 (not (assq tchar choices))) 158 (not (assq tchar choices)))
144 (setq wrong-char (not (memq tchar '(?? ?\C-h))) 159 (setq wrong-char (not (memq tchar `(?? ,help-char)))
145 tchar nil) 160 tchar nil)
146 (when wrong-char 161 (when wrong-char
147 (ding)) 162 (ding))
148 (with-help-window (setq buf (get-buffer-create 163 (setq buf (get-buffer-create "*Multiple Choice Help*"))
149 "*Multiple Choice Help*")) 164 (if (stringp help-string)
150 (with-current-buffer buf 165 (with-help-window buf
151 (erase-buffer) 166 (with-current-buffer buf
152 (pop-to-buffer buf) 167 (insert help-string)))
153 (insert prompt "\n\n") 168 (with-help-window buf
154 (let* ((columns (/ (window-width) 25)) 169 (with-current-buffer buf
155 (fill-column 21) 170 (erase-buffer)
156 (times 0) 171 (pop-to-buffer buf)
157 (start (point))) 172 (insert prompt "\n\n")
158 (dolist (elem choices) 173 (let* ((columns (/ (window-width) 25))
159 (goto-char start) 174 (fill-column 21)
160 (unless (zerop times) 175 (times 0)
161 (if (zerop (mod times columns)) 176 (start (point)))
162 ;; Go to the next "line". 177 (dolist (elem choices)
163 (goto-char (setq start (point-max)))
164 ;; Add padding.
165 (while (not (eobp))
166 (end-of-line)
167 (insert (make-string (max (- (* (mod times columns)
168 (+ fill-column 4))
169 (current-column))
170 0)
171 ?\s))
172 (forward-line 1))))
173 (setq times (1+ times))
174 (let ((text
175 (with-temp-buffer
176 (insert (format
177 "%c: %s\n"
178 (car elem)
179 (cdr (assq (car elem) altered-names))))
180 (fill-region (point-min) (point-max))
181 (when (nth 2 elem)
182 (let ((start (point)))
183 (insert (nth 2 elem))
184 (unless (bolp)
185 (insert "\n"))
186 (fill-region start (point-max))))
187 (buffer-string))))
188 (goto-char start) 178 (goto-char start)
189 (dolist (line (split-string text "\n")) 179 (unless (zerop times)
190 (end-of-line) 180 (if (zerop (mod times columns))
191 (if (bolp) 181 ;; Go to the next "line".
192 (insert line "\n") 182 (goto-char (setq start (point-max)))
193 (insert line)) 183 ;; Add padding.
194 (forward-line 1))))))))))) 184 (while (not (eobp))
185 (end-of-line)
186 (insert (make-string (max (- (* (mod times columns)
187 (+ fill-column 4))
188 (current-column))
189 0)
190 ?\s))
191 (forward-line 1))))
192 (setq times (1+ times))
193 (let ((text
194 (with-temp-buffer
195 (insert (format
196 "%c: %s\n"
197 (car elem)
198 (cdr (assq (car elem) altered-names))))
199 (fill-region (point-min) (point-max))
200 (when (nth 2 elem)
201 (let ((start (point)))
202 (insert (nth 2 elem))
203 (unless (bolp)
204 (insert "\n"))
205 (fill-region start (point-max))))
206 (buffer-string))))
207 (goto-char start)
208 (dolist (line (split-string text "\n"))
209 (end-of-line)
210 (if (bolp)
211 (insert line "\n")
212 (insert line))
213 (forward-line 1))))))))))))
195 (when (buffer-live-p buf) 214 (when (buffer-live-p buf)
196 (kill-buffer buf)) 215 (kill-buffer buf))
197 (assq tchar choices))) 216 (assq tchar choices)))
diff --git a/lisp/files.el b/lisp/files.el
index 16ebe744b98..27074beffc1 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2129,27 +2129,60 @@ think it does, because \"free\" is pretty hard to define in practice."
2129 2129
2130(declare-function x-popup-dialog "menu.c" (position contents &optional header)) 2130(declare-function x-popup-dialog "menu.c" (position contents &optional header))
2131 2131
2132(defun files--ask-user-about-large-file-help-text (op-type size)
2133 "Format the text that explains the options to open large files in Emacs.
2134OP-TYPE contains the kind of file operation that will be
2135performed. SIZE is the size of the large file."
2136 (format
2137 "The file that you want to %s is large (%s), which exceeds the
2138 threshold above which Emacs asks for confirmation (%s).
2139
2140 Large files may be slow to edit or navigate so Emacs asks you
2141 before you try to %s such files.
2142
2143 You can press:
2144 'y' to %s the file.
2145 'n' to abort, and not %s the file.
2146 'l' (the letter ell) to %s the file literally, which means that
2147 Emacs will %s the file without doing any format or character code
2148 conversion and in Fundamental mode, without loading any potentially
2149 expensive features.
2150
2151 You can customize the option `large-file-warning-threshold' to be the
2152 file size, in bytes, from which Emacs will ask for confirmation. Set
2153 it to nil to never request confirmation."
2154 op-type
2155 size
2156 (funcall byte-count-to-string-function large-file-warning-threshold)
2157 op-type
2158 op-type
2159 op-type
2160 op-type
2161 op-type))
2162
2132(defun files--ask-user-about-large-file (size op-type filename offer-raw) 2163(defun files--ask-user-about-large-file (size op-type filename offer-raw)
2164 "Query the user about what to do with large files.
2165Files are \"large\" if file SIZE is larger than `large-file-warning-threshold'.
2166
2167OP-TYPE specifies the file operation being performed on FILENAME.
2168
2169If OFFER-RAW is true, give user the additional option to open the
2170file literally."
2133 (let ((prompt (format "File %s is large (%s), really %s?" 2171 (let ((prompt (format "File %s is large (%s), really %s?"
2134 (file-name-nondirectory filename) 2172 (file-name-nondirectory filename)
2135 (funcall byte-count-to-string-function size) op-type))) 2173 (funcall byte-count-to-string-function size) op-type)))
2136 (if (not offer-raw) 2174 (if (not offer-raw)
2137 (if (y-or-n-p prompt) nil 'abort) 2175 (if (y-or-n-p prompt) nil 'abort)
2138 (let* ((use-dialog (and (display-popup-menus-p) 2176 (let ((choice
2139 last-input-event 2177 (car
2140 (listp last-nonmenu-event) 2178 (read-multiple-choice
2141 use-dialog-box)) 2179 prompt '((?y "yes")
2142 (choice 2180 (?n "no")
2143 (if use-dialog 2181 (?l "literally"))
2144 (x-popup-dialog t `(,prompt 2182 (files--ask-user-about-large-file-help-text
2145 ("Yes" . ?y) 2183 op-type (funcall byte-count-to-string-function size))))))
2146 ("No" . ?n) 2184 (cond ((eq choice ?y) nil)
2147 ("Open literally" . ?l))) 2185 ((eq choice ?l) 'raw)
2148 (read-char-choice
2149 (concat prompt " (y)es or (n)o or (l)iterally ")
2150 '(?y ?Y ?n ?N ?l ?L)))))
2151 (cond ((memq choice '(?y ?Y)) nil)
2152 ((memq choice '(?l ?L)) 'raw)
2153 (t 'abort)))))) 2186 (t 'abort))))))
2154 2187
2155(defun abort-if-file-too-large (size op-type filename &optional offer-raw) 2188(defun abort-if-file-too-large (size op-type filename &optional offer-raw)
diff --git a/lisp/help.el b/lisp/help.el
index 6ba59ae852d..e70041aea4b 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1890,7 +1890,7 @@ the same names as used in the original source code, when possible."
1890 ((and (byte-code-function-p def) (listp (aref def 0))) (aref def 0)) 1890 ((and (byte-code-function-p def) (listp (aref def 0))) (aref def 0))
1891 ((eq (car-safe def) 'lambda) (nth 1 def)) 1891 ((eq (car-safe def) 'lambda) (nth 1 def))
1892 ((eq (car-safe def) 'closure) (nth 2 def)) 1892 ((eq (car-safe def) 'closure) (nth 2 def))
1893 ((and (featurep 'nativecomp) 1893 ((and (featurep 'native-compile)
1894 (subrp def) 1894 (subrp def)
1895 (listp (subr-native-lambda-list def))) 1895 (listp (subr-native-lambda-list def)))
1896 (subr-native-lambda-list def)) 1896 (subr-native-lambda-list def))
diff --git a/lisp/info.el b/lisp/info.el
index 82f0eb37ae9..2757ed57826 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1855,7 +1855,8 @@ See `completing-read' for a description of arguments and usage."
1855 (lambda (string pred action) 1855 (lambda (string pred action)
1856 (complete-with-action 1856 (complete-with-action
1857 action 1857 action
1858 (Info-build-node-completions (Info-find-file file1 nil t)) 1858 (when-let ((file2 (Info-find-file file1 'noerror t)))
1859 (Info-build-node-completions file2))
1859 string pred)) 1860 string pred))
1860 nodename predicate code)))) 1861 nodename predicate code))))
1861 ;; Otherwise use Info-read-node-completion-table. 1862 ;; Otherwise use Info-read-node-completion-table.
@@ -1881,10 +1882,17 @@ the Top node in FILENAME."
1881 (or (cdr (assoc filename Info-file-completions)) 1882 (or (cdr (assoc filename Info-file-completions))
1882 (with-temp-buffer 1883 (with-temp-buffer
1883 (Info-mode) 1884 (Info-mode)
1884 (Info-goto-node (format "(%s)Top" filename)) 1885 (condition-case nil
1885 (Info-build-node-completions-1) 1886 (Info-goto-node (format "(%s)Top" filename))
1886 (push (cons filename Info-current-file-completions) Info-file-completions) 1887 ;; `Info-goto-node' signals a `user-error' when there
1887 Info-current-file-completions)) 1888 ;; are no nodes in the file in question (for instance,
1889 ;; if it's not actually an Info file).
1890 (user-error nil)
1891 (:success
1892 (Info-build-node-completions-1)
1893 (push (cons filename Info-current-file-completions)
1894 Info-file-completions)
1895 Info-current-file-completions))))
1888 (or Info-current-file-completions 1896 (or Info-current-file-completions
1889 (Info-build-node-completions-1)))) 1897 (Info-build-node-completions-1))))
1890 1898
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 303f38a59b6..3a4ede403a4 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -965,7 +965,7 @@ without repeating the prefix."
965 "Edit most recent 300 keystrokes as a keyboard macro." 965 "Edit most recent 300 keystrokes as a keyboard macro."
966 (interactive) 966 (interactive)
967 (kmacro-push-ring) 967 (kmacro-push-ring)
968 (edit-kbd-macro "\C-hl")) 968 (edit-kbd-macro (car (where-is-internal 'view-lossage))))
969 969
970 970
971;;; Single-step editing of keyboard macros 971;;; Single-step editing of keyboard macros
diff --git a/lisp/language/japan-util.el b/lisp/language/japan-util.el
index 948bfef9f22..f3e3590645b 100644
--- a/lisp/language/japan-util.el
+++ b/lisp/language/japan-util.el
@@ -96,9 +96,9 @@ HANKAKU-KATAKANA belongs to `japanese-jisx0201-kana'.")
96 (put-char-code-property jisx0201 'jisx0208 katakana))))) 96 (put-char-code-property jisx0201 'jisx0208 katakana)))))
97 97
98(defconst japanese-symbol-table 98(defconst japanese-symbol-table
99 '((?\  ?\ ) (?, ?, ?、) (?. ?. ?。) (?、 ?, ?、) (?。 ?. ?。) (?・ nil ?・) 99 '((?\  ?\ ) (?, ?,) (?. ?.) (?、 nil ?、) (?。 nil ?。) (?・ nil ?・)
100 (?: ?:) (?; ?\;) (?? ??) (?! ?!) (?゛ nil ?゙) (?゜ nil ?゚) 100 (?: ?:) (?; ?\;) (?? ??) (?! ?!) (?゛ nil ?゙) (?゜ nil ?゚)
101 (?´ ?') (?` ?`) (?^ ?^) (?_ ?_) (?ー ?- ?ー) (?— ?-) (?‐ ?-) 101 (?´ ?') (?` ?`) (?^ ?^) (?_ ?_) (?ー nil ?ー) (?— ?-) (?‐ ?-)
102 (?/ ?/) (?\ ?\\) (?〜 ?~) (?| ?|) (?‘ ?`) (?’ ?') (?“ ?\") (?” ?\") 102 (?/ ?/) (?\ ?\\) (?〜 ?~) (?| ?|) (?‘ ?`) (?’ ?') (?“ ?\") (?” ?\")
103 (?\( ?\() (?\) ?\)) (?\[ ?\[) (?\] ?\]) (?\{ ?{) (?\} ?}) 103 (?\( ?\() (?\) ?\)) (?\[ ?\[) (?\] ?\]) (?\{ ?{) (?\} ?})
104 (?〈 ?<) (?〉 ?>) (?\「 nil ?\「) (?\」 nil ?\」) 104 (?〈 ?<) (?〉 ?>) (?\「 nil ?\「) (?\」 nil ?\」)
diff --git a/lisp/loadup.el b/lisp/loadup.el
index c3b2da2a07f..dbc3ab79def 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -456,7 +456,7 @@ lost after dumping")))
456;; At this point, we're ready to resume undo recording for scratch. 456;; At this point, we're ready to resume undo recording for scratch.
457(buffer-enable-undo "*scratch*") 457(buffer-enable-undo "*scratch*")
458 458
459(when (featurep 'nativecomp) 459(when (featurep 'native-compile)
460 ;; Fix the compilation unit filename to have it working when 460 ;; Fix the compilation unit filename to have it working when
461 ;; installed or if the source directory got moved. This is set to be 461 ;; installed or if the source directory got moved. This is set to be
462 ;; a pair in the form of: 462 ;; a pair in the form of:
@@ -528,7 +528,7 @@ lost after dumping")))
528 ((equal dump-mode "bootstrap") "emacs") 528 ((equal dump-mode "bootstrap") "emacs")
529 ((equal dump-mode "pbootstrap") "bootstrap-emacs.pdmp") 529 ((equal dump-mode "pbootstrap") "bootstrap-emacs.pdmp")
530 (t (error "unrecognized dump mode %s" dump-mode))))) 530 (t (error "unrecognized dump mode %s" dump-mode)))))
531 (when (and (featurep 'nativecomp) 531 (when (and (featurep 'native-compile)
532 (equal dump-mode "pdump")) 532 (equal dump-mode "pdump"))
533 ;; Don't enable this before bootstrap is completed, as the 533 ;; Don't enable this before bootstrap is completed, as the
534 ;; compiler infrastructure may not be usable yet. 534 ;; compiler infrastructure may not be usable yet.
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index cd071667562..9a4c8f3c665 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -30,6 +30,7 @@
30(require 'mail-utils) 30(require 'mail-utils)
31(require 'rfc2047) 31(require 'rfc2047)
32(autoload 'message-make-date "message") 32(autoload 'message-make-date "message")
33(autoload 'message-narrow-to-headers "message")
33 34
34(defgroup sendmail nil 35(defgroup sendmail nil
35 "Mail sending commands for Emacs." 36 "Mail sending commands for Emacs."
@@ -1177,7 +1178,12 @@ external program defined by `sendmail-program'."
1177 ;; local binding in the mail buffer will take effect. 1178 ;; local binding in the mail buffer will take effect.
1178 (envelope-from 1179 (envelope-from
1179 (and mail-specify-envelope-from 1180 (and mail-specify-envelope-from
1180 (or (mail-envelope-from) user-mail-address)))) 1181 (or (save-restriction
1182 ;; Only look at the headers when fetching the
1183 ;; envelope address.
1184 (message-narrow-to-headers)
1185 (mail-envelope-from))
1186 user-mail-address))))
1181 (unwind-protect 1187 (unwind-protect
1182 (with-current-buffer tembuf 1188 (with-current-buffer tembuf
1183 (erase-buffer) 1189 (erase-buffer)
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index ab58aa455e9..c1e22800331 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -207,11 +207,15 @@ for `smtpmail-try-auth-method'.")
207 ;; Examine this variable now, so that 207 ;; Examine this variable now, so that
208 ;; local binding in the mail buffer will take effect. 208 ;; local binding in the mail buffer will take effect.
209 (smtpmail-mail-address 209 (smtpmail-mail-address
210 (or (and mail-specify-envelope-from (mail-envelope-from)) 210 (save-restriction
211 (let ((from (mail-fetch-field "from"))) 211 ;; Only look at the headers when fetching the
212 (and from 212 ;; envelope address.
213 (cadr (mail-extract-address-components from)))) 213 (message-narrow-to-headers)
214 (smtpmail-user-mail-address))) 214 (or (and mail-specify-envelope-from (mail-envelope-from))
215 (let ((from (mail-fetch-field "from")))
216 (and from
217 (cadr (mail-extract-address-components from))))
218 (smtpmail-user-mail-address))))
215 (smtpmail-code-conv-from 219 (smtpmail-code-conv-from
216 (if enable-multibyte-characters 220 (if enable-multibyte-characters
217 (let ((sendmail-coding-system smtpmail-code-conv-from)) 221 (let ((sendmail-coding-system smtpmail-code-conv-from))
@@ -434,7 +438,12 @@ for `smtpmail-try-auth-method'.")
434 (let ((coding-system-for-read 'no-conversion)) 438 (let ((coding-system-for-read 'no-conversion))
435 (insert-file-contents file-data)) 439 (insert-file-contents file-data))
436 (let ((smtpmail-mail-address 440 (let ((smtpmail-mail-address
437 (or (and mail-specify-envelope-from (mail-envelope-from)) 441 (or (and mail-specify-envelope-from
442 (save-restriction
443 ;; Only look at the headers when fetching the
444 ;; envelope address.
445 (message-narrow-to-headers)
446 (mail-envelope-from)))
438 user-mail-address))) 447 user-mail-address)))
439 (if (not (null smtpmail-recipient-address-list)) 448 (if (not (null smtpmail-recipient-address-list))
440 (when (setq result (smtpmail-via-smtp 449 (when (setq result (smtpmail-via-smtp
@@ -677,13 +686,17 @@ Returns an error if the server cannot be contacted."
677 ;; `smtpmail-mail-address' should be set to the appropriate 686 ;; `smtpmail-mail-address' should be set to the appropriate
678 ;; buffer-local value by the caller, but in case not: 687 ;; buffer-local value by the caller, but in case not:
679 (envelope-from 688 (envelope-from
680 (or smtpmail-mail-address 689 (save-restriction
681 (and mail-specify-envelope-from 690 ;; Only look at the headers when fetching the
682 (mail-envelope-from)) 691 ;; envelope address.
683 (let ((from (mail-fetch-field "from"))) 692 (message-narrow-to-headers)
684 (and from 693 (or smtpmail-mail-address
685 (cadr (mail-extract-address-components from)))) 694 (and mail-specify-envelope-from
686 (smtpmail-user-mail-address))) 695 (mail-envelope-from))
696 (let ((from (mail-fetch-field "from")))
697 (and from
698 (cadr (mail-extract-address-components from))))
699 (smtpmail-user-mail-address))))
687 process-buffer 700 process-buffer
688 result 701 result
689 auth-mechanisms 702 auth-mechanisms
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index bff3e60e90e..fa384bcad68 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -3585,7 +3585,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3585 "\\<\\(q[wxqr]?\\|[msy]\\|tr\\)\\>" ; QUOTED CONSTRUCT 3585 "\\<\\(q[wxqr]?\\|[msy]\\|tr\\)\\>" ; QUOTED CONSTRUCT
3586 "\\|" 3586 "\\|"
3587 ;; 1+6+2+1=10 extra () before this: 3587 ;; 1+6+2+1=10 extra () before this:
3588 "\\([?/<]\\)" ; /blah/ or ?blah? or <file*glob> 3588 "\\([/<]\\)" ; /blah/ or <file*glob>
3589 "\\|" 3589 "\\|"
3590 ;; 1+6+2+1+1=11 extra () before this 3590 ;; 1+6+2+1+1=11 extra () before this
3591 "\\<" cperl-sub-regexp "\\>" ; sub with proto/attr 3591 "\\<" cperl-sub-regexp "\\>" ; sub with proto/attr
@@ -3920,7 +3920,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3920 ;; 1+6+2=9 extra () before this: 3920 ;; 1+6+2=9 extra () before this:
3921 ;; "\\<\\(q[wxqr]?\\|[msy]\\|tr\\)\\>" 3921 ;; "\\<\\(q[wxqr]?\\|[msy]\\|tr\\)\\>"
3922 ;; "\\|" 3922 ;; "\\|"
3923 ;; "\\([?/<]\\)" ; /blah/ or ?blah? or <file*glob> 3923 ;; "\\([/<]\\)" ; /blah/ or <file*glob>
3924 (setq b1 (if (match-beginning 10) 10 11) 3924 (setq b1 (if (match-beginning 10) 10 11)
3925 argument (buffer-substring 3925 argument (buffer-substring
3926 (match-beginning b1) (match-end b1)) 3926 (match-beginning b1) (match-end b1))
@@ -3958,7 +3958,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3958 (goto-char (match-beginning b1)) 3958 (goto-char (match-beginning b1))
3959 (cperl-backward-to-noncomment (point-min)) 3959 (cperl-backward-to-noncomment (point-min))
3960 (or bb 3960 (or bb
3961 (if (eq b1 11) ; bare /blah/ or ?blah? or <foo> 3961 (if (eq b1 11) ; bare /blah/ or <foo>
3962 (setq argument "" 3962 (setq argument ""
3963 b1 nil 3963 b1 nil
3964 bb ; Not a regexp? 3964 bb ; Not a regexp?
@@ -3966,7 +3966,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3966 ;; What is below: regexp-p? 3966 ;; What is below: regexp-p?
3967 (and 3967 (and
3968 (or (memq (preceding-char) 3968 (or (memq (preceding-char)
3969 (append (if (memq c '(?\? ?\<)) 3969 (append (if (char-equal c ?\<)
3970 ;; $a++ ? 1 : 2 3970 ;; $a++ ? 1 : 2
3971 "~{(=|&*!,;:[" 3971 "~{(=|&*!,;:["
3972 "~{(=|&+-*!,;:[") nil)) 3972 "~{(=|&+-*!,;:[") nil))
@@ -3977,14 +3977,11 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3977 (forward-sexp -1) 3977 (forward-sexp -1)
3978;; After these keywords `/' starts a RE. One should add all the 3978;; After these keywords `/' starts a RE. One should add all the
3979;; functions/builtins which expect an argument, but ... 3979;; functions/builtins which expect an argument, but ...
3980 (if (eq (preceding-char) ?-)
3981 ;; -d ?foo? is a RE
3982 (looking-at "[a-zA-Z]\\>")
3983 (and 3980 (and
3984 (not (memq (preceding-char) 3981 (not (memq (preceding-char)
3985 '(?$ ?@ ?& ?%))) 3982 '(?$ ?@ ?& ?%)))
3986 (looking-at 3983 (looking-at
3987 "\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\|say\\|return\\)\\>"))))) 3984 "\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\|say\\|return\\)\\>"))))
3988 (and (eq (preceding-char) ?.) 3985 (and (eq (preceding-char) ?.)
3989 (eq (char-after (- (point) 2)) ?.)) 3986 (eq (char-after (- (point) 2)) ?.))
3990 (bobp)) 3987 (bobp))
@@ -7232,8 +7229,7 @@ $~ The name of the current report format.
7232... >= ... Numeric greater than or equal to. 7229... >= ... Numeric greater than or equal to.
7233... >> ... Bitwise shift right. 7230... >> ... Bitwise shift right.
7234... >>= ... Bitwise shift right assignment. 7231... >>= ... Bitwise shift right assignment.
7235... ? ... : ... Condition=if-then-else operator. ?PAT? One-time pattern match. 7232... ? ... : ... Condition=if-then-else operator.
7236?PATTERN? One-time pattern match.
7237@ARGV Command line arguments (not including the command name - see $0). 7233@ARGV Command line arguments (not including the command name - see $0).
7238@INC List of places to look for perl scripts during do/include/use. 7234@INC List of places to look for perl scripts during do/include/use.
7239@_ Parameter array for subroutines; result of split() unless in list context. 7235@_ Parameter array for subroutines; result of split() unless in list context.
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index a942235f474..eeb85d9df0c 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1340,7 +1340,6 @@ LIMIT defaults to point."
1340 1340
1341(defun js--end-of-defun-nested () 1341(defun js--end-of-defun-nested ()
1342 "Helper function for `js-end-of-defun'." 1342 "Helper function for `js-end-of-defun'."
1343 (message "test")
1344 (let* (pitem 1343 (let* (pitem
1345 (this-end (save-excursion 1344 (this-end (save-excursion
1346 (and (setq pitem (js--beginning-of-defun-nested)) 1345 (and (setq pitem (js--beginning-of-defun-nested))
diff --git a/lisp/ses.el b/lisp/ses.el
index bc3c2deaa1b..ca515f829dc 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -2252,9 +2252,8 @@ Based on the current set of columns and `window-hscroll' position."
2252 (push (symbol-name key) names)) 2252 (push (symbol-name key) names))
2253 ses--named-cell-hashmap) 2253 ses--named-cell-hashmap)
2254 names))))) 2254 names)))))
2255 (if 2255 (if (string= s "")
2256 (string= s "") 2256 (user-error "Invalid cell name")
2257 (error "Invalid cell name")
2258 (list (intern s))))) 2257 (list (intern s)))))
2259 (let ((rowcol (ses-sym-rowcol sym))) 2258 (let ((rowcol (ses-sym-rowcol sym)))
2260 (or rowcol (error "Invalid cell name")) 2259 (or rowcol (error "Invalid cell name"))
@@ -3381,7 +3380,7 @@ while in the SES buffer."
3381 ((derived-mode-p 'ses-mode) ses--local-printer-hashmap) 3380 ((derived-mode-p 'ses-mode) ses--local-printer-hashmap)
3382 ((minibufferp) ses--completion-table) 3381 ((minibufferp) ses--completion-table)
3383 ((derived-mode-p 'help-mode) nil) 3382 ((derived-mode-p 'help-mode) nil)
3384 (t (error "Not in a SES buffer"))))) 3383 (t (user-error "Not in a SES buffer")))))
3385 (when local-printer-hashmap 3384 (when local-printer-hashmap
3386 (let ((ses--list-orig-buffer (or ses--list-orig-buffer (current-buffer)))) 3385 (let ((ses--list-orig-buffer (or ses--list-orig-buffer (current-buffer))))
3387 (help-setup-xref 3386 (help-setup-xref
@@ -3415,7 +3414,7 @@ while in the SES buffer."
3415 ((derived-mode-p 'ses-mode) ses--named-cell-hashmap) 3414 ((derived-mode-p 'ses-mode) ses--named-cell-hashmap)
3416 ((minibufferp) ses--completion-table) 3415 ((minibufferp) ses--completion-table)
3417 ((derived-mode-p 'help-mode) nil) 3416 ((derived-mode-p 'help-mode) nil)
3418 (t (error "Not in a SES buffer"))))) 3417 (t (user-error "Not in a SES buffer")))))
3419 (when named-cell-hashmap 3418 (when named-cell-hashmap
3420 (let ((ses--list-orig-buffer (or ses--list-orig-buffer (current-buffer)))) 3419 (let ((ses--list-orig-buffer (or ses--list-orig-buffer (current-buffer))))
3421 (help-setup-xref 3420 (help-setup-xref
@@ -3458,7 +3457,9 @@ With a \\[universal-argument] prefix arg, prompt the user.
3458The top row is row 1. Selecting row 0 displays the default header row." 3457The top row is row 1. Selecting row 0 displays the default header row."
3459 (interactive 3458 (interactive
3460 (list (if (numberp current-prefix-arg) current-prefix-arg 3459 (list (if (numberp current-prefix-arg) current-prefix-arg
3461 (let ((currow (1+ (car (ses-sym-rowcol ses--curcell))))) 3460 (let* ((curcell (or (ses--cell-at-pos (point))
3461 (user-error "Invalid header-row")))
3462 (currow (1+ (car (ses-sym-rowcol curcell)))))
3462 (if current-prefix-arg 3463 (if current-prefix-arg
3463 (read-number "Header row: " currow) 3464 (read-number "Header row: " currow)
3464 currow))))) 3465 currow)))))
diff --git a/lisp/startup.el b/lisp/startup.el
index 9b4dde5e11f..b51e0f1dde1 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -537,7 +537,7 @@ It is the default value of the variable `top-level'."
537 (setq user-emacs-directory 537 (setq user-emacs-directory
538 (startup--xdg-or-homedot startup--xdg-config-home-emacs nil)) 538 (startup--xdg-or-homedot startup--xdg-config-home-emacs nil))
539 539
540 (when (featurep 'nativecomp) 540 (when (featurep 'native-compile)
541 ;; Form `comp-eln-load-path'. 541 ;; Form `comp-eln-load-path'.
542 (let ((path-env (getenv "EMACSNATIVELOADPATH"))) 542 (let ((path-env (getenv "EMACSNATIVELOADPATH")))
543 (when path-env 543 (when path-env
@@ -639,7 +639,7 @@ It is the default value of the variable `top-level'."
639 (set pathsym (mapcar (lambda (dir) 639 (set pathsym (mapcar (lambda (dir)
640 (decode-coding-string dir coding t)) 640 (decode-coding-string dir coding t))
641 path))))) 641 path)))))
642 (when (featurep 'nativecomp) 642 (when (featurep 'native-compile)
643 (let ((npath (symbol-value 'comp-eln-load-path))) 643 (let ((npath (symbol-value 'comp-eln-load-path)))
644 (set 'comp-eln-load-path 644 (set 'comp-eln-load-path
645 (mapcar (lambda (dir) 645 (mapcar (lambda (dir)
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 932308ee59d..4dbc7640bcf 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1245,7 +1245,7 @@ aspell is used along with Emacs).")
1245 1245
1246(defun ispell-set-spellchecker-params () 1246(defun ispell-set-spellchecker-params ()
1247 "Initialize some spellchecker parameters when changed or first used." 1247 "Initialize some spellchecker parameters when changed or first used."
1248 (unless (eq ispell-last-program-name ispell-program-name) 1248 (unless (equal ispell-last-program-name ispell-program-name)
1249 (ispell-kill-ispell t) 1249 (ispell-kill-ispell t)
1250 (if (and (condition-case () 1250 (if (and (condition-case ()
1251 (progn 1251 (progn
diff --git a/lisp/window.el b/lisp/window.el
index cf5752113d5..bba4992ca24 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4117,7 +4117,7 @@ frame can be safely deleted."
4117 (let ((minibuf (active-minibuffer-window))) 4117 (let ((minibuf (active-minibuffer-window)))
4118 (and minibuf (eq frame (window-frame minibuf)) 4118 (and minibuf (eq frame (window-frame minibuf))
4119 (not (eq (default-toplevel-value 4119 (not (eq (default-toplevel-value
4120 minibuffer-follows-selected-frame) 4120 'minibuffer-follows-selected-frame)
4121 t))))) 4121 t)))))
4122 'frame)) 4122 'frame))
4123 ((window-minibuffer-p window) 4123 ((window-minibuffer-p window)
diff --git a/src/comp.c b/src/comp.c
index a4dba435b4a..89667b2febc 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -5403,7 +5403,7 @@ For internal use. */);
5403 doc: /* When non-nil assume the file being compiled to 5403 doc: /* When non-nil assume the file being compiled to
5404be preloaded. */); 5404be preloaded. */);
5405 5405
5406 Fprovide (intern_c_string ("nativecomp"), Qnil); 5406 Fprovide (intern_c_string ("native-compile"), Qnil);
5407#endif /* #ifdef HAVE_NATIVE_COMP */ 5407#endif /* #ifdef HAVE_NATIVE_COMP */
5408 5408
5409 defsubr (&Snative_comp_available_p); 5409 defsubr (&Snative_comp_available_p);
diff --git a/src/frame.c b/src/frame.c
index 177022f6ebc..eb5aed82f7d 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1931,52 +1931,6 @@ other_frames (struct frame *f, bool invisible, bool force)
1931 return false; 1931 return false;
1932} 1932}
1933 1933
1934/* Make sure that minibuf_window doesn't refer to FRAME's minibuffer
1935 window. Preferably use the selected frame's minibuffer window
1936 instead. If the selected frame doesn't have one, get some other
1937 frame's minibuffer window. SELECT non-zero means select the new
1938 minibuffer window. */
1939static void
1940check_minibuf_window (Lisp_Object frame, int select)
1941{
1942 struct frame *f = decode_live_frame (frame);
1943
1944 XSETFRAME (frame, f);
1945
1946 if (WINDOWP (minibuf_window) && EQ (f->minibuffer_window, minibuf_window))
1947 {
1948 Lisp_Object frames, this, window = make_fixnum (0);
1949
1950 if (!EQ (frame, selected_frame)
1951 && FRAME_HAS_MINIBUF_P (XFRAME (selected_frame)))
1952 window = FRAME_MINIBUF_WINDOW (XFRAME (selected_frame));
1953 else
1954 FOR_EACH_FRAME (frames, this)
1955 {
1956 if (!EQ (this, frame) && FRAME_HAS_MINIBUF_P (XFRAME (this)))
1957 {
1958 window = FRAME_MINIBUF_WINDOW (XFRAME (this));
1959 break;
1960 }
1961 }
1962
1963 /* Don't abort if no window was found (Bug#15247). */
1964 if (WINDOWP (window))
1965 {
1966 /* Use set_window_buffer instead of Fset_window_buffer (see
1967 discussion of bug#11984, bug#12025, bug#12026). */
1968 set_window_buffer (window, XWINDOW (minibuf_window)->contents, 0, 0);
1969 minibuf_window = window;
1970
1971 /* SELECT non-zero usually means that FRAME's minibuffer
1972 window was selected; select the new one. */
1973 if (select)
1974 Fselect_window (minibuf_window, Qnil);
1975 }
1976 }
1977}
1978
1979
1980/** 1934/**
1981 * delete_frame: 1935 * delete_frame:
1982 * 1936 *
@@ -1991,7 +1945,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1991 struct frame *sf; 1945 struct frame *sf;
1992 struct kboard *kb; 1946 struct kboard *kb;
1993 Lisp_Object frames, frame1; 1947 Lisp_Object frames, frame1;
1994 int minibuffer_selected, is_tooltip_frame; 1948 int is_tooltip_frame;
1995 bool nochild = !FRAME_PARENT_FRAME (f); 1949 bool nochild = !FRAME_PARENT_FRAME (f);
1996 Lisp_Object minibuffer_child_frame = Qnil; 1950 Lisp_Object minibuffer_child_frame = Qnil;
1997 1951
@@ -2099,7 +2053,6 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
2099 2053
2100 /* At this point, we are committed to deleting the frame. 2054 /* At this point, we are committed to deleting the frame.
2101 There is no more chance for errors to prevent it. */ 2055 There is no more chance for errors to prevent it. */
2102 minibuffer_selected = EQ (minibuf_window, selected_window);
2103 sf = SELECTED_FRAME (); 2056 sf = SELECTED_FRAME ();
2104 /* Don't let the frame remain selected. */ 2057 /* Don't let the frame remain selected. */
2105 if (f == sf) 2058 if (f == sf)
@@ -2157,9 +2110,10 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
2157 do_switch_frame (frame1, 0, 1, Qnil); 2110 do_switch_frame (frame1, 0, 1, Qnil);
2158 sf = SELECTED_FRAME (); 2111 sf = SELECTED_FRAME ();
2159 } 2112 }
2160 2113 else
2161 /* Don't allow minibuf_window to remain on a deleted frame. */ 2114 /* Ensure any minibuffers on FRAME are moved onto the selected
2162 check_minibuf_window (frame, minibuffer_selected); 2115 frame. */
2116 move_minibuffers_onto_frame (f, true);
2163 2117
2164 /* Don't let echo_area_window to remain on a deleted frame. */ 2118 /* Don't let echo_area_window to remain on a deleted frame. */
2165 if (EQ (f->minibuffer_window, echo_area_window)) 2119 if (EQ (f->minibuffer_window, echo_area_window))
@@ -2791,9 +2745,6 @@ displayed in the terminal. */)
2791 if (NILP (force) && !other_frames (f, true, false)) 2745 if (NILP (force) && !other_frames (f, true, false))
2792 error ("Attempt to make invisible the sole visible or iconified frame"); 2746 error ("Attempt to make invisible the sole visible or iconified frame");
2793 2747
2794 /* Don't allow minibuf_window to remain on an invisible frame. */
2795 check_minibuf_window (frame, EQ (minibuf_window, selected_window));
2796
2797 if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook) 2748 if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook)
2798 FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, false); 2749 FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, false);
2799 2750
@@ -2836,9 +2787,6 @@ for how to proceed. */)
2836 } 2787 }
2837#endif /* HAVE_WINDOW_SYSTEM */ 2788#endif /* HAVE_WINDOW_SYSTEM */
2838 2789
2839 /* Don't allow minibuf_window to remain on an iconified frame. */
2840 check_minibuf_window (frame, EQ (minibuf_window, selected_window));
2841
2842 if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->iconify_frame_hook) 2790 if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->iconify_frame_hook)
2843 FRAME_TERMINAL (f)->iconify_frame_hook (f); 2791 FRAME_TERMINAL (f)->iconify_frame_hook (f);
2844 2792
@@ -3298,12 +3246,15 @@ If FRAME is omitted or nil, return information on the currently selected frame.
3298 /* It's questionable whether here we should report the value of 3246 /* It's questionable whether here we should report the value of
3299 f->new_height (and f->new_width below) but we've done that in the 3247 f->new_height (and f->new_width below) but we've done that in the
3300 past, so let's keep it. Note that a value of -1 for either of 3248 past, so let's keep it. Note that a value of -1 for either of
3301 these means that no new size was requested. */ 3249 these means that no new size was requested.
3302 height = (f->new_height >= 0 3250
3251 But check f->new_size before to make sure that f->new_height and
3252 f->new_width are not ones requested by adjust_frame_size. */
3253 height = ((f->new_size_p && f->new_height >= 0)
3303 ? f->new_height / FRAME_LINE_HEIGHT (f) 3254 ? f->new_height / FRAME_LINE_HEIGHT (f)
3304 : FRAME_LINES (f)); 3255 : FRAME_LINES (f));
3305 store_in_alist (&alist, Qheight, make_fixnum (height)); 3256 store_in_alist (&alist, Qheight, make_fixnum (height));
3306 width = (f->new_width >= 0 3257 width = ((f->new_size_p && f->new_width >= 0)
3307 ? f->new_width / FRAME_COLUMN_WIDTH (f) 3258 ? f->new_width / FRAME_COLUMN_WIDTH (f)
3308 : FRAME_COLS(f)); 3259 : FRAME_COLS(f));
3309 store_in_alist (&alist, Qwidth, make_fixnum (width)); 3260 store_in_alist (&alist, Qwidth, make_fixnum (width));
diff --git a/src/minibuf.c b/src/minibuf.c
index c4482d7f1ee..bc7d4393985 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -212,7 +212,23 @@ DEFUN ("active-minibuffer-window", Factive_minibuffer_window,
212 doc: /* Return the currently active minibuffer window, or nil if none. */) 212 doc: /* Return the currently active minibuffer window, or nil if none. */)
213 (void) 213 (void)
214{ 214{
215 return minibuf_level ? minibuf_window : Qnil; 215 Lisp_Object frames, frame;
216 struct frame *f;
217 Lisp_Object innermost_MB;
218
219 if (!minibuf_level)
220 return Qnil;
221
222 innermost_MB = nth_minibuffer (minibuf_level);
223 FOR_EACH_FRAME (frames, frame)
224 {
225 f = XFRAME (frame);
226 if (FRAME_LIVE_P (f)
227 && WINDOW_LIVE_P (f->minibuffer_window)
228 && EQ (XWINDOW (f->minibuffer_window)->contents, innermost_MB))
229 return f->minibuffer_window;
230 }
231 return minibuf_window; /* "Can't happen." */
216} 232}
217 233
218DEFUN ("set-minibuffer-window", Fset_minibuffer_window, 234DEFUN ("set-minibuffer-window", Fset_minibuffer_window,
diff --git a/test/lisp/emacs-lisp/map-tests.el b/test/lisp/emacs-lisp/map-tests.el
index 67666d8e7e7..a04c6bef02a 100644
--- a/test/lisp/emacs-lisp/map-tests.el
+++ b/test/lisp/emacs-lisp/map-tests.el
@@ -476,5 +476,42 @@ Evaluate BODY for each created map."
476 (list one two)) 476 (list one two))
477 '(1 2))))) 477 '(1 2)))))
478 478
479(ert-deftest test-map-setf-alist-insert-key ()
480 (let ((alist))
481 (should (equal (setf (map-elt alist 'key) 'value)
482 'value))
483 (should (equal alist '((key . value))))))
484
485(ert-deftest test-map-setf-alist-overwrite-key ()
486 (let ((alist '((key . value1))))
487 (should (equal (setf (map-elt alist 'key) 'value2)
488 'value2))
489 (should (equal alist '((key . value2))))))
490
491(ert-deftest test-map-setf-plist-insert-key ()
492 (let ((plist '(key value)))
493 (should (equal (setf (map-elt plist 'key2) 'value2)
494 'value2))
495 (should (equal plist '(key value key2 value2)))))
496
497(ert-deftest test-map-setf-plist-overwrite-key ()
498 (let ((plist '(key value)))
499 (should (equal (setf (map-elt plist 'key) 'value2)
500 'value2))
501 (should (equal plist '(key value2)))))
502
503(ert-deftest test-hash-table-setf-insert-key ()
504 (let ((ht (make-hash-table)))
505 (should (equal (setf (map-elt ht 'key) 'value)
506 'value))
507 (should (equal (map-elt ht 'key) 'value))))
508
509(ert-deftest test-hash-table-setf-overwrite-key ()
510 (let ((ht (make-hash-table)))
511 (puthash 'key 'value1 ht)
512 (should (equal (setf (map-elt ht 'key) 'value2)
513 'value2))
514 (should (equal (map-elt ht 'key) 'value2))))
515
479(provide 'map-tests) 516(provide 'map-tests)
480;;; map-tests.el ends here 517;;; map-tests.el ends here
diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el
index 099d627f355..513a0c2daea 100644
--- a/test/lisp/help-fns-tests.el
+++ b/test/lisp/help-fns-tests.el
@@ -62,16 +62,14 @@ Return first line of the output of (describe-function-1 FUNC)."
62 (should (string-match regexp result)))) 62 (should (string-match regexp result))))
63 63
64(ert-deftest help-fns-test-lisp-defun () 64(ert-deftest help-fns-test-lisp-defun ()
65 (let ((regexp (if (boundp 'comp-ctxt) 65 (let ((regexp (if (featurep 'native-compile)
66 "a native compiled Lisp function in .+subr\\.el" 66 "a native compiled Lisp function in .+subr\\.el"
67 "a compiled Lisp function in .+subr\\.el")) 67 "a compiled Lisp function in .+subr\\.el"))
68 (result (help-fns-tests--describe-function 'last))) 68 (result (help-fns-tests--describe-function 'last)))
69 (should (string-match regexp result)))) 69 (should (string-match regexp result))))
70 70
71(ert-deftest help-fns-test-lisp-defsubst () 71(ert-deftest help-fns-test-lisp-defsubst ()
72 (let ((regexp (if (boundp 'comp-ctxt) 72 (let ((regexp "a compiled Lisp function in .+subr\\.el")
73 "a native compiled Lisp function in .+subr\\.el"
74 "a compiled Lisp function in .+subr\\.el"))
75 (result (help-fns-tests--describe-function 'posn-window))) 73 (result (help-fns-tests--describe-function 'posn-window)))
76 (should (string-match regexp result)))) 74 (should (string-match regexp result))))
77 75
diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el
index 9867aa884c6..7cdfa45d6f7 100644
--- a/test/lisp/progmodes/cperl-mode-tests.el
+++ b/test/lisp/progmodes/cperl-mode-tests.el
@@ -524,4 +524,31 @@ however, must not happen when the keyword occurs in a variable
524 ;; No block should have been created here 524 ;; No block should have been created here
525 (should-not (search-forward-regexp "{" nil t)))) 525 (should-not (search-forward-regexp "{" nil t))))
526 526
527(ert-deftest cperl-test-bug-47598 ()
528 "Check that a file test followed by ? is no longer interpreted
529as a regex."
530 ;; Testing the text from the bug report
531 (with-temp-buffer
532 (insert "my $f = -f ? 'file'\n")
533 (insert " : -l ? [readlink]\n")
534 (insert " : -d ? 'dir'\n")
535 (insert " : 'unknown';\n")
536 (funcall cperl-test-mode)
537 ;; Perl mode doesn't highlight file tests as functions, so we
538 ;; can't test for the function's face. But we can verify that the
539 ;; function is not a string.
540 (goto-char (point-min))
541 (search-forward "?")
542 (should-not (nth 3 (syntax-ppss (point)))))
543 ;; Testing the actual targets for the regexp: m?foo? (still valid)
544 ;; and ?foo? (invalid since Perl 5.22)
545 (with-temp-buffer
546 (insert "m?foo?;")
547 (funcall cperl-test-mode)
548 (should (nth 3 (syntax-ppss 3))))
549 (with-temp-buffer
550 (insert " ?foo?;")
551 (funcall cperl-test-mode)
552 (should-not (nth 3 (syntax-ppss 3)))))
553
527;;; cperl-mode-tests.el ends here 554;;; cperl-mode-tests.el ends here
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index ba8b8b00936..e3e4bdd9b61 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -33,7 +33,7 @@
33 33
34(defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el")) 34(defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el"))
35 35
36(when (featurep 'nativecomp) 36(when (featurep 'native-compile)
37 (require 'comp) 37 (require 'comp)
38 (message "Compiling tests...") 38 (message "Compiling tests...")
39 (load (native-compile comp-test-src)) 39 (load (native-compile comp-test-src))