emacs-diffs
[Top][All Lists]
Advanced

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

feature/pgtk ff3d719: Merge branch 'master' of git.sv.gnu.org:/srv/git/e


From: Yuuki Harano
Subject: feature/pgtk ff3d719: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Date: Thu, 6 May 2021 10:42:12 -0400 (EDT)

branch: feature/pgtk
commit ff3d7190bbaebf196c0ac7f84d4869fa9362276f
Merge: 5b97b98 896384b
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Yuuki Harano <masm+github@masm11.me>

    Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
---
 etc/NEWS                                |  16 ++++
 lisp/bookmark.el                        |  64 ++++++++++------
 lisp/dired-aux.el                       |   5 ++
 lisp/emacs-lisp/advice.el               |   2 +-
 lisp/emacs-lisp/comp.el                 |   2 +-
 lisp/emacs-lisp/map.el                  |  32 ++++----
 lisp/emacs-lisp/nadvice.el              |   2 +-
 lisp/emacs-lisp/package.el              |   4 +-
 lisp/emacs-lisp/rmc.el                  | 129 ++++++++++++++++++--------------
 lisp/files.el                           |  63 ++++++++++++----
 lisp/help.el                            |   2 +-
 lisp/info.el                            |  18 +++--
 lisp/kmacro.el                          |   2 +-
 lisp/language/japan-util.el             |   4 +-
 lisp/loadup.el                          |   4 +-
 lisp/mail/sendmail.el                   |   8 +-
 lisp/mail/smtpmail.el                   |  39 ++++++----
 lisp/progmodes/cperl-mode.el            |  16 ++--
 lisp/progmodes/js.el                    |   1 -
 lisp/ses.el                             |  13 ++--
 lisp/startup.el                         |   4 +-
 lisp/textmodes/ispell.el                |   2 +-
 lisp/window.el                          |   2 +-
 src/comp.c                              |   2 +-
 src/frame.c                             |  71 +++---------------
 src/minibuf.c                           |  18 ++++-
 test/lisp/emacs-lisp/map-tests.el       |  37 +++++++++
 test/lisp/help-fns-tests.el             |   6 +-
 test/lisp/progmodes/cperl-mode-tests.el |  27 +++++++
 test/src/comp-tests.el                  |   2 +-
 30 files changed, 373 insertions(+), 224 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 8f4a683..737b64b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -276,6 +276,22 @@ commands.  The new keystrokes are 'C-x x g' 
('revert-buffer'),
 ** Commands 'set-frame-width' and 'set-frame-height' can now get their
 input using the minibuffer.
 
+---
+** New user option 'bookmark-menu-confirm-deletion'
+In Bookmark Menu mode, Emacs by default does not prompt for
+confirmation when you type 'x' to execute the deletion of bookmarks
+that have been marked for deletion.  However, if this new option is
+non-nil then Emacs will require confirmation with 'yes-or-no-p' before
+deleting.
+
+---
+** New help window when Emacs prompts before opening a large file.
+Commands like 'find-file' or 'visit-tags-table' ask to visit a file
+normally or literally when the file is larger than a certain size (by
+default, 9.5 MiB).  Press '?' or 'C-h' in that prompt to read more
+about the different options to visit a file, how you can disable the
+prompt, and how you can tweak the file size threshold.
+
 
 * Editing Changes in Emacs 28.1
 
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 3b75190..64b467a 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -121,6 +121,12 @@ recently set ones come first, oldest ones come last)."
   :type 'boolean)
 
 
+(defcustom bookmark-menu-confirm-deletion nil
+  "Non-nil means confirm before deleting bookmarks in a bookmark menu buffer.
+Nil means don't prompt for confirmation."
+  :version "28.1"
+  :type 'boolean)
+
 (defcustom bookmark-automatically-show-annotations t
   "Non-nil means show annotations when jumping to a bookmark."
   :type 'boolean)
@@ -1433,6 +1439,13 @@ probably because we were called from there."
 If optional argument NO-CONFIRM is non-nil, don't ask for
 confirmation."
   (interactive "P")
+  ;; We don't use `bookmark-menu-confirm-deletion' here because that
+  ;; variable is specifically to control confirmation prompting in a
+  ;; bookmark menu buffer, where the user has the marked-for-deletion
+  ;; bookmarks arrayed in front of them and might have accidentally
+  ;; hit the key that executes the deletions.  The UI situation here
+  ;; is quite different, by contrast: the user got to this point by a
+  ;; sequence of keystrokes unlikely to be typed by chance.
   (when (or no-confirm
             (yes-or-no-p "Permanently delete all bookmarks? "))
     (bookmark-maybe-load-default-file)
@@ -2199,30 +2212,35 @@ To carry out the deletions that you've marked, use 
\\<bookmark-bmenu-mode-map>\\
 
 
 (defun bookmark-bmenu-execute-deletions ()
-  "Delete bookmarks flagged `D'."
+  "Delete bookmarks flagged `D'.
+If `bookmark-menu-confirm-deletion' is non-nil, prompt for
+confirmation first."
   (interactive nil bookmark-bmenu-mode)
-  (let ((reporter (make-progress-reporter "Deleting bookmarks..."))
-        (o-point  (point))
-        (o-str    (save-excursion
-                    (beginning-of-line)
-                    (unless (= (following-char) ?D)
-                      (buffer-substring
-                       (point)
-                       (progn (end-of-line) (point))))))
-        (o-col     (current-column)))
-    (goto-char (point-min))
-    (while (re-search-forward "^D" (point-max) t)
-      (bookmark-delete (bookmark-bmenu-bookmark) t)) ; pass BATCH arg
-    (bookmark-bmenu-list)
-    (if o-str
-        (progn
-          (goto-char (point-min))
-          (search-forward o-str)
-          (beginning-of-line)
-          (forward-char o-col))
-      (goto-char o-point))
-    (beginning-of-line)
-    (progress-reporter-done reporter)))
+  (if (and bookmark-menu-confirm-deletion
+           (not (yes-or-no-p "Delete selected bookmarks? ")))
+      (message "Bookmarks not deleted.")
+    (let ((reporter (make-progress-reporter "Deleting bookmarks..."))
+          (o-point  (point))
+          (o-str    (save-excursion
+                      (beginning-of-line)
+                      (unless (= (following-char) ?D)
+                        (buffer-substring
+                         (point)
+                         (progn (end-of-line) (point))))))
+          (o-col     (current-column)))
+      (goto-char (point-min))
+      (while (re-search-forward "^D" (point-max) t)
+        (bookmark-delete (bookmark-bmenu-bookmark) t)) ; pass BATCH arg
+      (bookmark-bmenu-list)
+      (if o-str
+          (progn
+            (goto-char (point-min))
+            (search-forward o-str)
+            (beginning-of-line)
+            (forward-char o-col))
+        (goto-char o-point))
+      (beginning-of-line)
+      (progress-reporter-done reporter))))
 
 
 (defun bookmark-bmenu-rename ()
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 8fe612f..8fce402 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,
                   (file-in-directory-p destname from)
                   (error "Cannot copy `%s' into its subdirectory `%s'"
                          from to)))
+            ;; Check, that `dired-do-symlink' does not create symlinks
+            ;; on different hosts.
+            (when (and (eq file-creator 'make-symbolic-link)
+                       (not (equal (file-remote-p from) (file-remote-p to))))
+             (error "Cannot symlink `%s' to `%s' on another host" from to))
             (condition-case err
                 (progn
                   (funcall file-creator from to dired-overwrite-confirmed)
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index dc8636f..8e8d0e2 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2076,7 +2076,7 @@ mapped to the closest extremal position).
 If FUNCTION was not advised already, its advice info will be
 initialized.  Redefining a piece of advice whose name is part of
 the cache-id will clear the cache."
-  (when (and (featurep 'nativecomp)
+  (when (and (featurep 'native-compile)
              (subr-primitive-p (symbol-function function)))
     (comp-subr-trampoline-install function))
   (cond ((not (ad-is-advised function))
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 297c1f7..f700faa 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -938,7 +938,7 @@ In use by the back-end."
 Signal an error otherwise.
 To be used by all entry points."
   (cond
-   ((null (featurep 'nativecomp))
+   ((null (featurep 'native-compile))
     (error "Emacs was not compiled with native compiler support 
(--with-native-compilation)"))
    ((null (native-comp-available-p))
     (error "Cannot find libgccjit library"))))
diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el
index c0cbc7b..5c76fb9 100644
--- a/lisp/emacs-lisp/map.el
+++ b/lisp/emacs-lisp/map.el
@@ -124,7 +124,9 @@ or array."
                           (with-no-warnings (map-put! ,mgetter ,key ,v 
,testfn))
                         (map-not-inplace
                          ,(funcall msetter
-                                   `(map-insert ,mgetter ,key ,v))))))))))
+                                   `(map-insert ,mgetter ,key ,v))
+                         ;; Always return the value.
+                         ,v))))))))
    ;; `testfn' is deprecated.
    (advertised-calling-convention (map key &optional default) "27.1"))
   ;; Can't use `cl-defmethod' with `advertised-calling-convention'.
@@ -429,18 +431,22 @@ To insert an element without modifying MAP, use 
`map-insert'."
   ;; `testfn' only exists for backward compatibility with `map-put'!
   (declare (advertised-calling-convention (map key value) "27.1"))
   ;; Can't use `cl-defmethod' with `advertised-calling-convention'.
-  (map--dispatch map
-    :list
-    (if (map--plist-p map)
-        (plist-put map key value)
-      (let ((oldmap map))
-        (setf (alist-get key map key nil (or testfn #'equal)) value)
-        (unless (eq oldmap map)
-          (signal 'map-not-inplace (list oldmap)))))
-    :hash-table (puthash key value map)
-    ;; FIXME: If `key' is too large, should we signal `map-not-inplace'
-    ;; and let `map-insert' grow the array?
-    :array (aset map key value)))
+  (map--dispatch
+   map
+   :list
+   (progn
+     (if (map--plist-p map)
+         (plist-put map key value)
+       (let ((oldmap map))
+         (setf (alist-get key map key nil (or testfn #'equal)) value)
+         (unless (eq oldmap map)
+           (signal 'map-not-inplace (list oldmap)))))
+     ;; Always return the value.
+     value)
+   :hash-table (puthash key value map)
+   ;; FIXME: If `key' is too large, should we signal `map-not-inplace'
+   ;; and let `map-insert' grow the array?
+   :array (aset map key value)))
 
 (cl-defgeneric map-insert (map key value)
   "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 f974056..747572a 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -320,7 +320,7 @@ is also interactive.  There are 3 cases:
 
 ;;;###autoload
 (defun advice--add-function (where ref function props)
-  (when (and (featurep 'nativecomp)
+  (when (and (featurep 'native-compile)
              (subr-primitive-p (gv-deref ref)))
     (let ((subr-name (intern (subr-name (gv-deref ref)))))
       ;; Requiring the native compiler to advice `macroexpand' cause a
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 5035850..e133917 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
   "Native compile installed package PKG-DESC asynchronously.
 This assumes that `pkg-desc' has already been activated with
 `package-activate-1'."
-  (when (and (featurep 'nativecomp)
+  (when (and (featurep 'native-compile)
              (native-comp-available-p))
     (let ((warning-minimum-level :error))
       (native-compile-async (package-desc-dir pkg-desc) t))))
@@ -2265,7 +2265,7 @@ confirmation to install packages."
   "Delete DIR recursively.
 Clean-up the corresponding .eln files if Emacs is native
 compiled."
-  (when (featurep 'nativecomp)
+  (when (featurep 'native-compile)
     (cl-loop
      for file in (directory-files-recursively dir ".el\\'")
      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 bedf598..6aa169c 100644
--- a/lisp/emacs-lisp/rmc.el
+++ b/lisp/emacs-lisp/rmc.el
@@ -26,24 +26,32 @@
 (require 'seq)
 
 ;;;###autoload
-(defun read-multiple-choice (prompt choices)
+(defun read-multiple-choice (prompt choices &optional help-string)
   "Ask user a multiple choice question.
 PROMPT should be a string that will be displayed as the prompt.
 
 CHOICES is a list of (KEY NAME [DESCRIPTION]).  KEY is a
 character to be entered.  NAME is a short name for the entry to
 be displayed while prompting (if there's room, it might be
-shortened).  DESCRIPTION is an optional longer explanation that
-will be displayed in a help buffer if the user requests more
-help.
+shortened).  DESCRIPTION is an optional longer explanation for
+the entry that will be displayed in a help buffer if the user
+requests more help.  This help description has a fixed format in
+columns, but, for greater flexibility, instead of passing a
+DESCRIPTION, the user can use the optional argument HELP-STRING.
+This argument is a string that contains the text with the
+complete description of all choices.  `read-multiple-choice' will
+display that description in a help buffer if the user requests
+it.
 
 This function translates user input into responses by consulting
 the bindings in `query-replace-map'; see the documentation of
 that variable for more information.  In this case, the useful
-bindings are `recenter', `scroll-up', and `scroll-down'.  If the
-user enters `recenter', `scroll-up', or `scroll-down' responses,
-perform the requested window recentering or scrolling and ask
-again.
+bindings are `recenter', `scroll-up', `scroll-down', and `edit'.
+If the user enters `recenter', `scroll-up', or `scroll-down'
+responses, perform the requested window recentering or scrolling
+and ask again.  If the user enters `edit', start a recursive
+edit.  When the user exit the recursive edit, the multiple choice
+prompt gains focus again.
 
 When `use-dialog-box' is t (the default), this function can pop
 up a dialog window to collect the user input.  That functionality
@@ -133,6 +141,13 @@ Usage example:
                   (ignore-errors (scroll-other-window)) t)
                  ((eq answer 'scroll-other-window-down)
                   (ignore-errors (scroll-other-window-down)) t)
+                 ((eq answer 'edit)
+                  (save-match-data
+                    (save-excursion
+                      (message "%s"
+                               (substitute-command-keys
+                                "Recursive edit.  Resume with 
\\[exit-recursive-edit]"))
+                      (recursive-edit))))
                  (t tchar)))
           (when (eq tchar t)
             (setq wrong-char nil
@@ -141,57 +156,61 @@ Usage example:
           ;; help messages.
           (when (and (not (eq tchar nil))
                      (not (assq tchar choices)))
-           (setq wrong-char (not (memq tchar '(?? ?\C-h)))
+           (setq wrong-char (not (memq tchar `(?? ,help-char)))
                   tchar nil)
             (when wrong-char
               (ding))
-            (with-help-window (setq buf (get-buffer-create
-                                         "*Multiple Choice Help*"))
-              (with-current-buffer buf
-                (erase-buffer)
-                (pop-to-buffer buf)
-                (insert prompt "\n\n")
-                (let* ((columns (/ (window-width) 25))
-                       (fill-column 21)
-                       (times 0)
-                       (start (point)))
-                  (dolist (elem choices)
-                    (goto-char start)
-                    (unless (zerop times)
-                      (if (zerop (mod times columns))
-                          ;; Go to the next "line".
-                          (goto-char (setq start (point-max)))
-                        ;; Add padding.
-                        (while (not (eobp))
-                          (end-of-line)
-                          (insert (make-string (max (- (* (mod times columns)
-                                                          (+ fill-column 4))
-                                                       (current-column))
-                                                    0)
-                                               ?\s))
-                          (forward-line 1))))
-                    (setq times (1+ times))
-                    (let ((text
-                           (with-temp-buffer
-                             (insert (format
-                                      "%c: %s\n"
-                                      (car elem)
-                                      (cdr (assq (car elem) altered-names))))
-                             (fill-region (point-min) (point-max))
-                             (when (nth 2 elem)
-                               (let ((start (point)))
-                                 (insert (nth 2 elem))
-                                 (unless (bolp)
-                                   (insert "\n"))
-                                 (fill-region start (point-max))))
-                             (buffer-string))))
+            (setq buf (get-buffer-create "*Multiple Choice Help*"))
+            (if (stringp help-string)
+                (with-help-window buf
+                  (with-current-buffer buf
+                    (insert help-string)))
+              (with-help-window buf
+                (with-current-buffer buf
+                  (erase-buffer)
+                  (pop-to-buffer buf)
+                  (insert prompt "\n\n")
+                  (let* ((columns (/ (window-width) 25))
+                         (fill-column 21)
+                         (times 0)
+                         (start (point)))
+                    (dolist (elem choices)
                       (goto-char start)
-                      (dolist (line (split-string text "\n"))
-                        (end-of-line)
-                        (if (bolp)
-                            (insert line "\n")
-                          (insert line))
-                        (forward-line 1)))))))))))
+                      (unless (zerop times)
+                        (if (zerop (mod times columns))
+                            ;; Go to the next "line".
+                            (goto-char (setq start (point-max)))
+                          ;; Add padding.
+                          (while (not (eobp))
+                            (end-of-line)
+                            (insert (make-string (max (- (* (mod times columns)
+                                                            (+ fill-column 4))
+                                                         (current-column))
+                                                      0)
+                                                 ?\s))
+                            (forward-line 1))))
+                      (setq times (1+ times))
+                      (let ((text
+                             (with-temp-buffer
+                               (insert (format
+                                        "%c: %s\n"
+                                        (car elem)
+                                        (cdr (assq (car elem) altered-names))))
+                               (fill-region (point-min) (point-max))
+                               (when (nth 2 elem)
+                                 (let ((start (point)))
+                                   (insert (nth 2 elem))
+                                   (unless (bolp)
+                                     (insert "\n"))
+                                   (fill-region start (point-max))))
+                               (buffer-string))))
+                        (goto-char start)
+                        (dolist (line (split-string text "\n"))
+                          (end-of-line)
+                          (if (bolp)
+                              (insert line "\n")
+                            (insert line))
+                          (forward-line 1))))))))))))
     (when (buffer-live-p buf)
       (kill-buffer buf))
     (assq tchar choices)))
diff --git a/lisp/files.el b/lisp/files.el
index 16ebe74..27074be 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."
 
 (declare-function x-popup-dialog "menu.c" (position contents &optional header))
 
+(defun files--ask-user-about-large-file-help-text (op-type size)
+  "Format the text that explains the options to open large files in Emacs.
+OP-TYPE contains the kind of file operation that will be
+performed.  SIZE is the size of the large file."
+  (format
+   "The file that you want to %s is large (%s), which exceeds the
+ threshold above which Emacs asks for confirmation (%s).
+
+ Large files may be slow to edit or navigate so Emacs asks you
+ before you try to %s such files.
+
+ You can press:
+ 'y' to %s the file.
+ 'n' to abort, and not %s the file.
+ 'l' (the letter ell) to %s the file literally, which means that
+ Emacs will %s the file without doing any format or character code
+ conversion and in Fundamental mode, without loading any potentially
+ expensive features.
+
+ You can customize the option `large-file-warning-threshold' to be the
+ file size, in bytes, from which Emacs will ask for confirmation.  Set
+ it to nil to never request confirmation."
+   op-type
+   size
+   (funcall byte-count-to-string-function large-file-warning-threshold)
+   op-type
+   op-type
+   op-type
+   op-type
+   op-type))
+
 (defun files--ask-user-about-large-file (size op-type filename offer-raw)
+  "Query the user about what to do with large files.
+Files are \"large\" if file SIZE is larger than `large-file-warning-threshold'.
+
+OP-TYPE specifies the file operation being performed on FILENAME.
+
+If OFFER-RAW is true, give user the additional option to open the
+file literally."
   (let ((prompt (format "File %s is large (%s), really %s?"
                        (file-name-nondirectory filename)
                        (funcall byte-count-to-string-function size) op-type)))
     (if (not offer-raw)
         (if (y-or-n-p prompt) nil 'abort)
-      (let* ((use-dialog (and (display-popup-menus-p)
-                              last-input-event
-                             (listp last-nonmenu-event)
-                             use-dialog-box))
-             (choice
-              (if use-dialog
-                  (x-popup-dialog t `(,prompt
-                                      ("Yes" . ?y)
-                                      ("No" . ?n)
-                                      ("Open literally" . ?l)))
-                (read-char-choice
-                 (concat prompt " (y)es or (n)o or (l)iterally ")
-                 '(?y ?Y ?n ?N ?l ?L)))))
-        (cond ((memq choice '(?y ?Y)) nil)
-              ((memq choice '(?l ?L)) 'raw)
+      (let ((choice
+             (car
+              (read-multiple-choice
+               prompt '((?y "yes")
+                        (?n "no")
+                        (?l "literally"))
+               (files--ask-user-about-large-file-help-text
+                op-type (funcall byte-count-to-string-function size))))))
+        (cond ((eq choice ?y) nil)
+              ((eq choice ?l) 'raw)
               (t 'abort))))))
 
 (defun abort-if-file-too-large (size op-type filename &optional offer-raw)
diff --git a/lisp/help.el b/lisp/help.el
index 6ba59ae..e70041a 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."
    ((and (byte-code-function-p def) (listp (aref def 0))) (aref def 0))
    ((eq (car-safe def) 'lambda) (nth 1 def))
    ((eq (car-safe def) 'closure) (nth 2 def))
-   ((and (featurep 'nativecomp)
+   ((and (featurep 'native-compile)
          (subrp def)
          (listp (subr-native-lambda-list def)))
     (subr-native-lambda-list def))
diff --git a/lisp/info.el b/lisp/info.el
index 82f0eb3..2757ed5 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1855,7 +1855,8 @@ See `completing-read' for a description of arguments and 
usage."
          (lambda (string pred action)
            (complete-with-action
             action
-            (Info-build-node-completions (Info-find-file file1 nil t))
+            (when-let ((file2 (Info-find-file file1 'noerror t)))
+              (Info-build-node-completions file2))
             string pred))
         nodename predicate code))))
    ;; Otherwise use Info-read-node-completion-table.
@@ -1881,10 +1882,17 @@ the Top node in FILENAME."
       (or (cdr (assoc filename Info-file-completions))
          (with-temp-buffer
            (Info-mode)
-           (Info-goto-node (format "(%s)Top" filename))
-           (Info-build-node-completions-1)
-           (push (cons filename Info-current-file-completions) 
Info-file-completions)
-           Info-current-file-completions))
+            (condition-case nil
+               (Info-goto-node (format "(%s)Top" filename))
+              ;; `Info-goto-node' signals a `user-error' when there
+              ;; are no nodes in the file in question (for instance,
+              ;; if it's not actually an Info file).
+              (user-error nil)
+              (:success
+              (Info-build-node-completions-1)
+              (push (cons filename Info-current-file-completions)
+                     Info-file-completions)
+              Info-current-file-completions))))
     (or Info-current-file-completions
        (Info-build-node-completions-1))))
 
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 303f38a..3a4ede4 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -965,7 +965,7 @@ without repeating the prefix."
   "Edit most recent 300 keystrokes as a keyboard macro."
   (interactive)
   (kmacro-push-ring)
-  (edit-kbd-macro "\C-hl"))
+  (edit-kbd-macro (car (where-is-internal 'view-lossage))))
 
 
 ;;; Single-step editing of keyboard macros
diff --git a/lisp/language/japan-util.el b/lisp/language/japan-util.el
index 948bfef..f3e3590 100644
--- a/lisp/language/japan-util.el
+++ b/lisp/language/japan-util.el
@@ -96,9 +96,9 @@ HANKAKU-KATAKANA belongs to `japanese-jisx0201-kana'.")
          (put-char-code-property jisx0201 'jisx0208 katakana)))))
 
 (defconst japanese-symbol-table
-  '((?\  ?\ ) (?, ?, ?、) (?. ?. ?。) (?、 ?, ?、) (?。 ?. ?。) (?・ nil ?・)
+  '((?\  ?\ ) (?, ?,) (?. ?.) (?、 nil ?、) (?。 nil ?。) (?・ nil ?・)
     (?: ?:) (?; ?\;) (?? ??) (?! ?!) (?゛ nil ?゙) (?゜ nil ?゚)
-    (?´ ?') (?` ?`) (?^ ?^) (?_ ?_) (?ー ?- ?ー) (?— ?-) (?‐ ?-)
+    (?´ ?') (?` ?`) (?^ ?^) (?_ ?_) (?ー nil ?ー) (?— ?-) (?‐ ?-)
     (?/ ?/) (?\ ?\\) (?〜 ?~)  (?| ?|) (?‘ ?`) (?’ ?') (?“ ?\") (?” ?\")
     (?\( ?\() (?\) ?\)) (?\[ ?\[) (?\] ?\]) (?\{ ?{) (?\} ?})
     (?〈 ?<) (?〉 ?>) (?\「 nil ?\「) (?\」 nil ?\」)
diff --git a/lisp/loadup.el b/lisp/loadup.el
index c3b2da2..dbc3ab7 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -456,7 +456,7 @@ lost after dumping")))
 ;; At this point, we're ready to resume undo recording for scratch.
 (buffer-enable-undo "*scratch*")
 
-(when (featurep 'nativecomp)
+(when (featurep 'native-compile)
   ;; Fix the compilation unit filename to have it working when
   ;; installed or if the source directory got moved.  This is set to be
   ;; a pair in the form of:
@@ -528,7 +528,7 @@ lost after dumping")))
                         ((equal dump-mode "bootstrap") "emacs")
                         ((equal dump-mode "pbootstrap") "bootstrap-emacs.pdmp")
                         (t (error "unrecognized dump mode %s" dump-mode)))))
-      (when (and (featurep 'nativecomp)
+      (when (and (featurep 'native-compile)
                  (equal dump-mode "pdump"))
         ;; Don't enable this before bootstrap is completed, as the
         ;; compiler infrastructure may not be usable yet.
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index cd07166..9a4c8f3 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -30,6 +30,7 @@
 (require 'mail-utils)
 (require 'rfc2047)
 (autoload 'message-make-date "message")
+(autoload 'message-narrow-to-headers "message")
 
 (defgroup sendmail nil
   "Mail sending commands for Emacs."
@@ -1177,7 +1178,12 @@ external program defined by `sendmail-program'."
        ;; local binding in the mail buffer will take effect.
        (envelope-from
         (and mail-specify-envelope-from
-             (or (mail-envelope-from) user-mail-address))))
+             (or (save-restriction
+                    ;; Only look at the headers when fetching the
+                    ;; envelope address.
+                    (message-narrow-to-headers)
+                    (mail-envelope-from))
+                  user-mail-address))))
     (unwind-protect
        (with-current-buffer tembuf
          (erase-buffer)
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index ab58aa4..c1e2280 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -207,11 +207,15 @@ for `smtpmail-try-auth-method'.")
         ;; Examine this variable now, so that
        ;; local binding in the mail buffer will take effect.
        (smtpmail-mail-address
-         (or (and mail-specify-envelope-from (mail-envelope-from))
-             (let ((from (mail-fetch-field "from")))
-              (and from
-                   (cadr (mail-extract-address-components from))))
-            (smtpmail-user-mail-address)))
+         (save-restriction
+           ;; Only look at the headers when fetching the
+           ;; envelope address.
+           (message-narrow-to-headers)
+           (or (and mail-specify-envelope-from (mail-envelope-from))
+               (let ((from (mail-fetch-field "from")))
+                (and from
+                     (cadr (mail-extract-address-components from))))
+              (smtpmail-user-mail-address))))
        (smtpmail-code-conv-from
         (if enable-multibyte-characters
             (let ((sendmail-coding-system smtpmail-code-conv-from))
@@ -434,7 +438,12 @@ for `smtpmail-try-auth-method'.")
          (let ((coding-system-for-read 'no-conversion))
            (insert-file-contents file-data))
           (let ((smtpmail-mail-address
-                 (or (and mail-specify-envelope-from (mail-envelope-from))
+                 (or (and mail-specify-envelope-from
+                          (save-restriction
+                            ;; Only look at the headers when fetching the
+                            ;; envelope address.
+                            (message-narrow-to-headers)
+                            (mail-envelope-from)))
                      user-mail-address)))
             (if (not (null smtpmail-recipient-address-list))
                 (when (setq result (smtpmail-via-smtp
@@ -677,13 +686,17 @@ Returns an error if the server cannot be contacted."
         ;; `smtpmail-mail-address' should be set to the appropriate
         ;; buffer-local value by the caller, but in case not:
         (envelope-from
-        (or smtpmail-mail-address
-            (and mail-specify-envelope-from
-                 (mail-envelope-from))
-            (let ((from (mail-fetch-field "from")))
-              (and from
-                   (cadr (mail-extract-address-components from))))
-            (smtpmail-user-mail-address)))
+         (save-restriction
+           ;; Only look at the headers when fetching the
+           ;; envelope address.
+           (message-narrow-to-headers)
+          (or smtpmail-mail-address
+              (and mail-specify-envelope-from
+                   (mail-envelope-from))
+              (let ((from (mail-fetch-field "from")))
+                (and from
+                     (cadr (mail-extract-address-components from))))
+              (smtpmail-user-mail-address))))
        process-buffer
        result
        auth-mechanisms
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index bff3e60..fa384bc 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',
                "\\<\\(q[wxqr]?\\|[msy]\\|tr\\)\\>" ; QUOTED CONSTRUCT
                "\\|"
                ;; 1+6+2+1=10 extra () before this:
-               "\\([?/<]\\)"   ; /blah/ or ?blah? or <file*glob>
+               "\\([/<]\\)"    ; /blah/ or <file*glob>
                "\\|"
                ;; 1+6+2+1+1=11 extra () before this
                "\\<" cperl-sub-regexp "\\>" ;  sub with proto/attr
@@ -3920,7 +3920,7 @@ the sections using `cperl-pod-head-face', 
`cperl-pod-face',
                ;; 1+6+2=9 extra () before this:
                ;; "\\<\\(q[wxqr]?\\|[msy]\\|tr\\)\\>"
                ;; "\\|"
-               ;; "\\([?/<]\\)"        ; /blah/ or ?blah? or <file*glob>
+               ;; "\\([/<]\\)" ; /blah/ or <file*glob>
                (setq b1 (if (match-beginning 10) 10 11)
                      argument (buffer-substring
                                (match-beginning b1) (match-end b1))
@@ -3958,7 +3958,7 @@ the sections using `cperl-pod-head-face', 
`cperl-pod-face',
                (goto-char (match-beginning b1))
                (cperl-backward-to-noncomment (point-min))
                (or bb
-                   (if (eq b1 11)      ; bare /blah/ or ?blah? or <foo>
+                   (if (eq b1 11)      ; bare /blah/ or <foo>
                        (setq argument ""
                              b1 nil
                              bb        ; Not a regexp?
@@ -3966,7 +3966,7 @@ the sections using `cperl-pod-head-face', 
`cperl-pod-face',
                               ;; What is below: regexp-p?
                               (and
                                (or (memq (preceding-char)
-                                         (append (if (memq c '(?\? ?\<))
+                                         (append (if (char-equal c ?\<)
                                                      ;; $a++ ? 1 : 2
                                                      "~{(=|&*!,;:["
                                                    "~{(=|&+-*!,;:[") nil))
@@ -3977,14 +3977,11 @@ the sections using `cperl-pod-head-face', 
`cperl-pod-face',
                                           (forward-sexp -1)
 ;; After these keywords `/' starts a RE.  One should add all the
 ;; functions/builtins which expect an argument, but ...
-                                          (if (eq (preceding-char) ?-)
-                                              ;; -d ?foo? is a RE
-                                              (looking-at "[a-zA-Z]\\>")
                                             (and
                                              (not (memq (preceding-char)
                                                         '(?$ ?@ ?& ?%)))
                                              (looking-at
-                                              
"\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\|say\\|return\\)\\>")))))
+                                              
"\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\|say\\|return\\)\\>"))))
                                    (and (eq (preceding-char) ?.)
                                         (eq (char-after (- (point) 2)) ?.))
                                    (bobp))
@@ -7232,8 +7229,7 @@ $~        The name of the current report format.
 ... >= ...     Numeric greater than or equal to.
 ... >> ...     Bitwise shift right.
 ... >>= ...    Bitwise shift right assignment.
-... ? ... : ...        Condition=if-then-else operator.   ?PAT? One-time 
pattern match.
-?PATTERN?      One-time pattern match.
+... ? ... : ...        Condition=if-then-else operator.
 @ARGV  Command line arguments (not including the command name - see $0).
 @INC   List of places to look for perl scripts during do/include/use.
 @_    Parameter array for subroutines; result of split() unless in list 
context.
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index a942235..eeb85d9 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1340,7 +1340,6 @@ LIMIT defaults to point."
 
 (defun js--end-of-defun-nested ()
   "Helper function for `js-end-of-defun'."
-  (message "test")
   (let* (pitem
          (this-end (save-excursion
                      (and (setq pitem (js--beginning-of-defun-nested))
diff --git a/lisp/ses.el b/lisp/ses.el
index bc3c2de..ca515f8 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -2252,9 +2252,8 @@ Based on the current set of columns and `window-hscroll' 
position."
                                                  (push (symbol-name key) 
names))
                                               ses--named-cell-hashmap)
                                      names)))))
-                (if
-                    (string= s "")
-                    (error "Invalid cell name")
+                (if (string= s "")
+                    (user-error "Invalid cell name")
                   (list (intern s)))))
   (let ((rowcol (ses-sym-rowcol sym)))
     (or rowcol (error "Invalid cell name"))
@@ -3381,7 +3380,7 @@ while in the SES buffer."
           ((derived-mode-p 'ses-mode) ses--local-printer-hashmap)
           ((minibufferp) ses--completion-table)
           ((derived-mode-p 'help-mode) nil)
-          (t (error "Not in a SES buffer")))))
+          (t (user-error "Not in a SES buffer")))))
   (when local-printer-hashmap
     (let ((ses--list-orig-buffer (or ses--list-orig-buffer (current-buffer))))
       (help-setup-xref
@@ -3415,7 +3414,7 @@ while in the SES buffer."
           ((derived-mode-p 'ses-mode) ses--named-cell-hashmap)
           ((minibufferp) ses--completion-table)
           ((derived-mode-p 'help-mode) nil)
-          (t (error "Not in a SES buffer")))))
+          (t (user-error "Not in a SES buffer")))))
   (when named-cell-hashmap
     (let ((ses--list-orig-buffer (or ses--list-orig-buffer (current-buffer))))
       (help-setup-xref
@@ -3458,7 +3457,9 @@ With a \\[universal-argument] prefix arg, prompt the user.
 The top row is row 1.  Selecting row 0 displays the default header row."
   (interactive
    (list (if (numberp current-prefix-arg) current-prefix-arg
-          (let ((currow (1+ (car (ses-sym-rowcol ses--curcell)))))
+          (let* ((curcell (or (ses--cell-at-pos (point))
+                               (user-error "Invalid header-row")))
+                  (currow (1+ (car (ses-sym-rowcol curcell)))))
             (if current-prefix-arg
                 (read-number "Header row: " currow)
               currow)))))
diff --git a/lisp/startup.el b/lisp/startup.el
index 9b4dde5..b51e0f1 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -537,7 +537,7 @@ It is the default value of the variable `top-level'."
     (setq user-emacs-directory
          (startup--xdg-or-homedot startup--xdg-config-home-emacs nil))
 
-    (when (featurep 'nativecomp)
+    (when (featurep 'native-compile)
       ;; Form `comp-eln-load-path'.
       (let ((path-env (getenv "EMACSNATIVELOADPATH")))
         (when path-env
@@ -639,7 +639,7 @@ It is the default value of the variable `top-level'."
                (set pathsym (mapcar (lambda (dir)
                                       (decode-coding-string dir coding t))
                                     path)))))
-        (when (featurep 'nativecomp)
+        (when (featurep 'native-compile)
           (let ((npath (symbol-value 'comp-eln-load-path)))
             (set 'comp-eln-load-path
                  (mapcar (lambda (dir)
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 932308e..4dbc764 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1245,7 +1245,7 @@ aspell is used along with Emacs).")
 
 (defun ispell-set-spellchecker-params ()
   "Initialize some spellchecker parameters when changed or first used."
-  (unless (eq ispell-last-program-name ispell-program-name)
+  (unless (equal ispell-last-program-name ispell-program-name)
     (ispell-kill-ispell t)
     (if (and (condition-case ()
                 (progn
diff --git a/lisp/window.el b/lisp/window.el
index cf57521..bba4992 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4117,7 +4117,7 @@ frame can be safely deleted."
                  (let ((minibuf (active-minibuffer-window)))
                    (and minibuf (eq frame (window-frame minibuf))
                          (not (eq (default-toplevel-value
-                                    minibuffer-follows-selected-frame)
+                                    'minibuffer-follows-selected-frame)
                                   t)))))
        'frame))
      ((window-minibuffer-p window)
diff --git a/src/comp.c b/src/comp.c
index a4dba43..89667b2 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -5403,7 +5403,7 @@ For internal use.  */);
               doc: /* When non-nil assume the file being compiled to
 be preloaded.  */);
 
-  Fprovide (intern_c_string ("nativecomp"), Qnil);
+  Fprovide (intern_c_string ("native-compile"), Qnil);
 #endif /* #ifdef HAVE_NATIVE_COMP */
 
   defsubr (&Snative_comp_available_p);
diff --git a/src/frame.c b/src/frame.c
index 177022f..eb5aed8 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1931,52 +1931,6 @@ other_frames (struct frame *f, bool invisible, bool 
force)
   return false;
 }
 
-/* Make sure that minibuf_window doesn't refer to FRAME's minibuffer
-   window.  Preferably use the selected frame's minibuffer window
-   instead.  If the selected frame doesn't have one, get some other
-   frame's minibuffer window.  SELECT non-zero means select the new
-   minibuffer window.  */
-static void
-check_minibuf_window (Lisp_Object frame, int select)
-{
-  struct frame *f = decode_live_frame (frame);
-
-  XSETFRAME (frame, f);
-
-  if (WINDOWP (minibuf_window) && EQ (f->minibuffer_window, minibuf_window))
-    {
-      Lisp_Object frames, this, window = make_fixnum (0);
-
-      if (!EQ (frame, selected_frame)
-         && FRAME_HAS_MINIBUF_P (XFRAME (selected_frame)))
-       window = FRAME_MINIBUF_WINDOW (XFRAME (selected_frame));
-      else
-       FOR_EACH_FRAME (frames, this)
-         {
-           if (!EQ (this, frame) && FRAME_HAS_MINIBUF_P (XFRAME (this)))
-             {
-               window = FRAME_MINIBUF_WINDOW (XFRAME (this));
-               break;
-             }
-         }
-
-      /* Don't abort if no window was found (Bug#15247).  */
-      if (WINDOWP (window))
-       {
-         /* Use set_window_buffer instead of Fset_window_buffer (see
-            discussion of bug#11984, bug#12025, bug#12026).  */
-         set_window_buffer (window, XWINDOW (minibuf_window)->contents, 0, 0);
-         minibuf_window = window;
-
-         /* SELECT non-zero usually means that FRAME's minibuffer
-            window was selected; select the new one.  */
-         if (select)
-           Fselect_window (minibuf_window, Qnil);
-       }
-    }
-}
-
-
 /**
  * delete_frame:
  *
@@ -1991,7 +1945,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
   struct frame *sf;
   struct kboard *kb;
   Lisp_Object frames, frame1;
-  int minibuffer_selected, is_tooltip_frame;
+  int is_tooltip_frame;
   bool nochild = !FRAME_PARENT_FRAME (f);
   Lisp_Object minibuffer_child_frame = Qnil;
 
@@ -2099,7 +2053,6 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
 
   /* At this point, we are committed to deleting the frame.
      There is no more chance for errors to prevent it.  */
-  minibuffer_selected = EQ (minibuf_window, selected_window);
   sf = SELECTED_FRAME ();
   /* Don't let the frame remain selected.  */
   if (f == sf)
@@ -2157,9 +2110,10 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
       do_switch_frame (frame1, 0, 1, Qnil);
       sf = SELECTED_FRAME ();
     }
-
-  /* Don't allow minibuf_window to remain on a deleted frame.  */
-  check_minibuf_window (frame, minibuffer_selected);
+  else
+    /* Ensure any minibuffers on FRAME are moved onto the selected
+       frame.  */
+    move_minibuffers_onto_frame (f, true);
 
   /* Don't let echo_area_window to remain on a deleted frame.  */
   if (EQ (f->minibuffer_window, echo_area_window))
@@ -2791,9 +2745,6 @@ displayed in the terminal.  */)
   if (NILP (force) && !other_frames (f, true, false))
     error ("Attempt to make invisible the sole visible or iconified frame");
 
-  /* Don't allow minibuf_window to remain on an invisible frame.  */
-  check_minibuf_window (frame, EQ (minibuf_window, selected_window));
-
   if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook)
     FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, false);
 
@@ -2836,9 +2787,6 @@ for how to proceed.  */)
     }
 #endif /* HAVE_WINDOW_SYSTEM */
 
-  /* Don't allow minibuf_window to remain on an iconified frame.  */
-  check_minibuf_window (frame, EQ (minibuf_window, selected_window));
-
   if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->iconify_frame_hook)
     FRAME_TERMINAL (f)->iconify_frame_hook (f);
 
@@ -3298,12 +3246,15 @@ If FRAME is omitted or nil, return information on the 
currently selected frame.
   /* It's questionable whether here we should report the value of
      f->new_height (and f->new_width below) but we've done that in the
      past, so let's keep it.  Note that a value of -1 for either of
-     these means that no new size was requested.  */
-  height = (f->new_height >= 0
+     these means that no new size was requested.
+
+     But check f->new_size before to make sure that f->new_height and
+     f->new_width are not ones requested by adjust_frame_size.  */
+  height = ((f->new_size_p && f->new_height >= 0)
            ? f->new_height / FRAME_LINE_HEIGHT (f)
            : FRAME_LINES (f));
   store_in_alist (&alist, Qheight, make_fixnum (height));
-  width = (f->new_width >= 0
+  width = ((f->new_size_p && f->new_width >= 0)
           ? f->new_width / FRAME_COLUMN_WIDTH (f)
           : FRAME_COLS(f));
   store_in_alist (&alist, Qwidth, make_fixnum (width));
diff --git a/src/minibuf.c b/src/minibuf.c
index c4482d7..bc7d439 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -212,7 +212,23 @@ DEFUN ("active-minibuffer-window", 
Factive_minibuffer_window,
        doc: /* Return the currently active minibuffer window, or nil if none.  
*/)
      (void)
 {
-  return minibuf_level ? minibuf_window : Qnil;
+  Lisp_Object frames, frame;
+  struct frame *f;
+  Lisp_Object innermost_MB;
+
+  if (!minibuf_level)
+    return Qnil;
+
+  innermost_MB = nth_minibuffer (minibuf_level);
+  FOR_EACH_FRAME (frames, frame)
+    {
+      f = XFRAME (frame);
+      if (FRAME_LIVE_P (f)
+         && WINDOW_LIVE_P (f->minibuffer_window)
+         && EQ (XWINDOW (f->minibuffer_window)->contents, innermost_MB))
+       return f->minibuffer_window;
+    }
+  return minibuf_window;       /* "Can't happen." */
 }
 
 DEFUN ("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 67666d8..a04c6be 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."
                      (list one two))
                    '(1 2)))))
 
+(ert-deftest test-map-setf-alist-insert-key ()
+  (let ((alist))
+    (should (equal (setf (map-elt alist 'key) 'value)
+                   'value))
+    (should (equal alist '((key . value))))))
+
+(ert-deftest test-map-setf-alist-overwrite-key ()
+  (let ((alist '((key . value1))))
+    (should (equal (setf (map-elt alist 'key) 'value2)
+                   'value2))
+    (should (equal alist '((key . value2))))))
+
+(ert-deftest test-map-setf-plist-insert-key ()
+  (let ((plist '(key value)))
+    (should (equal (setf (map-elt plist 'key2) 'value2)
+                   'value2))
+    (should (equal plist '(key value key2 value2)))))
+
+(ert-deftest test-map-setf-plist-overwrite-key ()
+  (let ((plist '(key value)))
+    (should (equal (setf (map-elt plist 'key) 'value2)
+                   'value2))
+    (should (equal plist '(key value2)))))
+
+(ert-deftest test-hash-table-setf-insert-key ()
+  (let ((ht (make-hash-table)))
+    (should (equal (setf (map-elt ht 'key) 'value)
+                  'value))
+    (should (equal (map-elt ht 'key) 'value))))
+
+(ert-deftest test-hash-table-setf-overwrite-key ()
+  (let ((ht (make-hash-table)))
+    (puthash 'key 'value1 ht)
+    (should (equal (setf (map-elt ht 'key) 'value2)
+                  'value2))
+    (should (equal (map-elt ht 'key) 'value2))))
+
 (provide 'map-tests)
 ;;; map-tests.el ends here
diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el
index 099d627..513a0c2 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)."
     (should (string-match regexp result))))
 
 (ert-deftest help-fns-test-lisp-defun ()
-  (let ((regexp (if (boundp 'comp-ctxt)
+  (let ((regexp (if (featurep 'native-compile)
                     "a native compiled Lisp function in .+subr\\.el"
                   "a compiled Lisp function in .+subr\\.el"))
         (result (help-fns-tests--describe-function 'last)))
     (should (string-match regexp result))))
 
 (ert-deftest help-fns-test-lisp-defsubst ()
-  (let ((regexp (if (boundp 'comp-ctxt)
-                    "a native compiled Lisp function in .+subr\\.el"
-                  "a compiled Lisp function in .+subr\\.el"))
+  (let ((regexp "a compiled Lisp function in .+subr\\.el")
         (result (help-fns-tests--describe-function 'posn-window)))
     (should (string-match regexp result))))
 
diff --git a/test/lisp/progmodes/cperl-mode-tests.el 
b/test/lisp/progmodes/cperl-mode-tests.el
index 9867aa8..7cdfa45 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
     ;; No block should have been created here
     (should-not (search-forward-regexp "{" nil t))))
 
+(ert-deftest cperl-test-bug-47598 ()
+  "Check that a file test followed by ? is no longer interpreted
+as a regex."
+  ;; Testing the text from the bug report
+  (with-temp-buffer
+    (insert "my $f = -f ? 'file'\n")
+    (insert "      : -l ? [readlink]\n")
+    (insert "      : -d ? 'dir'\n")
+    (insert "      : 'unknown';\n")
+    (funcall cperl-test-mode)
+    ;; Perl mode doesn't highlight file tests as functions, so we
+    ;; can't test for the function's face.  But we can verify that the
+    ;; function is not a string.
+    (goto-char (point-min))
+    (search-forward "?")
+    (should-not (nth 3 (syntax-ppss (point)))))
+  ;; Testing the actual targets for the regexp: m?foo? (still valid)
+  ;; and ?foo? (invalid since Perl 5.22)
+  (with-temp-buffer
+    (insert "m?foo?;")
+    (funcall cperl-test-mode)
+    (should (nth 3 (syntax-ppss 3))))
+  (with-temp-buffer
+    (insert " ?foo?;")
+    (funcall cperl-test-mode)
+    (should-not (nth 3 (syntax-ppss 3)))))
+
 ;;; cperl-mode-tests.el ends here
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index ba8b8b0..e3e4bdd 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -33,7 +33,7 @@
 
 (defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el"))
 
-(when (featurep 'nativecomp)
+(when (featurep 'native-compile)
   (require 'comp)
   (message "Compiling tests...")
   (load (native-compile comp-test-src))



reply via email to

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