commit b61c828ea37f6d875f9c2672a262482af5efedb4 (HEAD, refs/remotes/origin/master) Author: Daniel Martín Date: Thu May 6 10:27:03 2021 +0200 Add a help option to the open large files prompt * lisp/files.el (files--ask-user-about-large-file-help-text): New function that returns information about opening large files in Emacs. (Bug#45412) (files--ask-user-about-large-file): Use read-multiple-choice to display the available actions. * etc/NEWS: Advertise the new feature. diff --git a/etc/NEWS b/etc/NEWS index c759b333b6..737b64b0da 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -284,6 +284,14 @@ 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/files.el b/lisp/files.el index 16ebe744b9..27074beffc 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) commit 2705fc4ab05bb81ba8c6fd6469499be32a4ac420 Author: Daniel Martín Date: Thu May 6 10:21:59 2021 +0200 Extend read-multiple-choice to support free-form help descriptions * lisp/emacs-lisp/rmc.el (read-multiple-choice): Add a new argument to override the default help description in `read-multiple-choice'. Use the `help-char' variable instead of ?\C-h. Also support the `edit' action from `query-replace-map', so that help links can be visited by entering a recursive edit. diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index bedf598d44..6aa169c032 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))) commit b8bdf64377120d2c802e4ef13cfab1fec8c37a27 Author: Karl Fogel Date: Wed May 5 16:40:52 2021 -0500 New option to confirm deletion in bookmark menu * lisp/bookmark.el (bookmark-menu-confirm-deletion): New defcustom. (bookmark-delete-all): Add comment explaining why we don't use the new confirmation formula here. (bookmark-bmenu-execute-deletions): Conditionally confirm deletion. Note that the bulk of the code diff here is just reindentation of an otherwise unchanged `let' expression. * etc/NEWS: Announce the new option. Thanks to Lars Ingebrigtsen and Eli Zaretskii for review, and thanks to Oliver Taylor for suggesting the option in the first place: https://lists.gnu.org/archive/html/emacs-humanities/2021-02/msg00022.html From: Oliver Taylor Subject: Re: [emacs-humanities] Extending Emacs Bookmarks to Work with EWW To: Karl Fogel Cc: Stefan Kangas, Emacs-humanities mailing list Date: Wed, 3 Feb 2021 20:21:59 -0800 Message-Id: <936D47EA-4D11-452B-8303-971B6386877B@me.com> diff --git a/etc/NEWS b/etc/NEWS index 8f4a6837b1..c759b333b6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -276,6 +276,14 @@ 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. + * Editing Changes in Emacs 28.1 diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 3b7519059f..64b467adfa 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 \\\\ (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 () commit 40736357b8b811ffbe9023527db5c2a91a9c7a5a Author: Andrea Corallo Date: Wed May 5 17:18:07 2021 +0200 Rename feature `nativecomp' into `native-compile' * test/src/comp-tests.el : Rename feature `nativecomp' into `native-compile'. * test/lisp/help-fns-tests.el (help-fns-test-lisp-defun): Likewise. * src/comp.c (syms_of_comp): Likewise. * lisp/startup.el (normal-top-level): Likewise. * lisp/loadup.el: Likewise. * lisp/help.el (help-function-arglist): Likewise. * lisp/emacs-lisp/package.el (package--native-compile-async) (package--delete-directory): Likewise. * lisp/emacs-lisp/nadvice.el (advice--add-function): Likewise. * lisp/emacs-lisp/comp.el (comp-ensure-native-compiler): Likewise. * lisp/emacs-lisp/advice.el (ad-add-advice): Likewise. diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index dc8636f8f7..8e8d0e2265 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 297c1f7ebc..f700faa38b 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/nadvice.el b/lisp/emacs-lisp/nadvice.el index f974056538..747572a336 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 503585079e..e133917751 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/help.el b/lisp/help.el index 6ba59ae852..e70041aea4 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/loadup.el b/lisp/loadup.el index c82d08133c..158c02ecea 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -449,7 +449,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: @@ -521,7 +521,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/startup.el b/lisp/startup.el index 3513ab7c4e..6bab9e364c 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/src/comp.c b/src/comp.c index a4dba435b4..89667b2feb 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/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el index 5b60939f8a..513a0c2dae 100644 --- a/test/lisp/help-fns-tests.el +++ b/test/lisp/help-fns-tests.el @@ -62,7 +62,7 @@ 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 (featurep 'nativecomp) + (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))) diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index ba8b8b0093..e3e4bdd9b6 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)) commit e9baa733b8cac00e008cb834abc8712c8c00beed Author: Martin Rudalics Date: Wed May 5 18:36:00 2021 +0200 Fix setting of 'width' and 'height' frame parameters * src/frame.c (Fframe_parameters): Fix bogus setting of 'height' and 'width' parameters. diff --git a/src/frame.c b/src/frame.c index d884a6d8b9..738bfe9a5c 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3295,12 +3295,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)); commit 31f64d862b5d4557363363316ef51d3fb0eaca82 Author: Andrea Corallo Date: Wed May 5 17:11:08 2021 +0200 * test/lisp/help-fns-tests.el (help-fns-test-lisp-defsubst): Fix (bug#48221). diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el index 8a226c4a0b..5b60939f8a 100644 --- a/test/lisp/help-fns-tests.el +++ b/test/lisp/help-fns-tests.el @@ -69,9 +69,7 @@ Return first line of the output of (describe-function-1 FUNC)." (should (string-match regexp result)))) (ert-deftest help-fns-test-lisp-defsubst () - (let ((regexp (if (featurep 'nativecomp) - "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)))) commit f1c6a4c41e801b722cbde22d6c8c653dccb2fe85 Author: Kazuhiro Ito Date: Wed May 5 17:09:07 2021 +0200 Tweak how some Japanese punctuation chars are translated to ASCII * lisp/language/japan-util.el (japanese-symbol-table): Tweak Japanese punctuation character translation (bug#47767). diff --git a/lisp/language/japan-util.el b/lisp/language/japan-util.el index 948bfef9f2..f3e3590645 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 ?\」) commit 3481903d136af4380b5ee22879500e0295da8eba Author: Andrea Corallo Date: Wed May 5 17:00:59 2021 +0200 * Better identify native compiler presence in two tests. * test/lisp/help-fns-tests.el (help-fns-test-lisp-defun) (help-fns-test-lisp-defsubst): Better identify native-comp presence. diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el index 099d627f35..8a226c4a0b 100644 --- a/test/lisp/help-fns-tests.el +++ b/test/lisp/help-fns-tests.el @@ -62,14 +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 'nativecomp) "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) + (let ((regexp (if (featurep 'nativecomp) "a native compiled Lisp function in .+subr\\.el" "a compiled Lisp function in .+subr\\.el")) (result (help-fns-tests--describe-function 'posn-window))) commit a9f4ee3d3d69a91fde905684e5e9838a18ab855c Author: Daniel Mendler Date: Wed May 5 16:58:35 2021 +0200 Don't bug out in `Info-goto-node' completion * lisp/info.el (Info-read-node-name-1): Don't bug out in the middle of completion, but return nil instead (and issue a message) (bug#47771). diff --git a/lisp/info.el b/lisp/info.el index 82f0eb37ae..67d27c7898 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. commit 0b437dd75ce530c5daa76add915711bceb31acb8 Author: Boruch Baum Date: Wed May 5 15:05:50 2021 +0200 Fix error in ses.el when setting the current row * lisp/ses.el (ses-jump, ses-list-local-printers) (ses-list-named-cells): Use `user-error' for user errors. (ses-set-header-row): Function `ses-set-header-row' was determining the current row based upon variable `ses--curcell', but that variable is NIL until one begins an operation on a cell (eg. keybindings '=', '"'), so navigating to a row was insufficient to select that row, and further generated an ERROR because the code was not expecting a NIL value for variable `ses--curcell' (bug#47784). diff --git a/lisp/ses.el b/lisp/ses.el index bc3c2deaa1..ca515f829d 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))))) commit b4685a3d6183db65b350bafd8246f5e8864c8363 Author: Lars Ingebrigtsen Date: Wed May 5 14:59:49 2021 +0200 Allow `C-x C-k l' to work even if `C-h l' is unbound * lisp/kmacro.el (kmacro-edit-lossage): `view-lossage' may be bound to a different key than `C-h l' (bug#47785). diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 303f38a59b..3a4ede403a 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 commit 14c9245e8243cac2388149f06ff91ba809384410 Author: Matt Beshara Date: Wed May 5 14:49:33 2021 +0200 Remove unnecessary call to message in js.el * lisp/progmodes/js.el (js--end-of-defun-nested): Remove debugging message left over (bug#48234). diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index a942235f47..eeb85d9df0 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))