commit 7543d5f173bf8da58a5553510e330456b479d24c (HEAD, refs/remotes/origin/master) Author: Stephen Berman Date: Fri Oct 16 10:33:19 2020 +0200 Adjust some tests so that they work in symlinked environs * test/lisp/help-fns-tests.el (help-fns-test-lisp-macro) (help-fns-test-lisp-defsubst): * test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--method-files--finds-methods): Adjust test so that they work in a symlinked environment (bug#43004). (cl-generic-tests--method-files--finds-methods): Use file-truename so that this works in a symlinked environment (bug#43004). diff --git a/test/lisp/emacs-lisp/cl-generic-tests.el b/test/lisp/emacs-lisp/cl-generic-tests.el index 5aa58782f3..9582907e51 100644 --- a/test/lisp/emacs-lisp/cl-generic-tests.el +++ b/test/lisp/emacs-lisp/cl-generic-tests.el @@ -240,7 +240,7 @@ (let ((retval (cl--generic-method-files 'cl-generic-tests--generic))) (should (equal (length retval) 2)) (mapc (lambda (x) - (should (equal (car x) cl-generic-tests--this-file)) + (should (equal (file-truename (car x)) cl-generic-tests--this-file)) (should (equal (cadr x) 'cl-generic-tests--generic))) retval) (should-not (equal (nth 0 retval) (nth 1 retval))))) diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el index 811b367791..bdd488de3f 100644 --- a/test/lisp/help-fns-tests.el +++ b/test/lisp/help-fns-tests.el @@ -56,28 +56,28 @@ Return first line of the output of (describe-function-1 FUNC)." (should (string-match regexp result)))) (ert-deftest help-fns-test-lisp-macro () - (let ((regexp "a Lisp macro in .subr\\.el") + (let ((regexp "a Lisp macro in .+subr\\.el") (result (help-fns-tests--describe-function 'when))) (should (string-match regexp result)))) (ert-deftest help-fns-test-lisp-defun () - (let ((regexp "a compiled Lisp function in .subr\\.el") + (let ((regexp "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 "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)))) (ert-deftest help-fns-test-alias-to-defun () - (let ((regexp "an alias for .set-file-modes. in .subr\\.el") + (let ((regexp "an alias for .set-file-modes. in .+subr\\.el") (result (help-fns-tests--describe-function 'chmod))) (should (string-match regexp result)))) (ert-deftest help-fns-test-bug23887 () "Test for https://debbugs.gnu.org/23887 ." - (let ((regexp "an alias for .re-search-forward. in .subr\\.el") + (let ((regexp "an alias for .re-search-forward. in .+subr\\.el") (result (help-fns-tests--describe-function 'search-forward-regexp))) (should (string-match regexp result)))) commit 95d0b71683336979b3cc1633c8b3f6a88b4d7bff Author: Lars Ingebrigtsen Date: Fri Oct 16 10:16:31 2020 +0200 Sanitize ical data in gnus-icalendar-event-from-ical * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-ical): Sanitise the data before passing it on to the constructor. This avoids backtraces on icals with extra, unknown slots (bug#43057). diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index d7e35c5587..bc1bb83822 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el @@ -264,7 +264,14 @@ (map-property ical-property)) args))))) (mapc #'accumulate-args prop-map) - (apply #'make-instance event-class args)))) + (apply + #'make-instance + event-class + (cl-loop for slot in (eieio-class-slots event-class) + for keyword = (intern + (format ":%s" (eieio-slot-descriptor-name slot))) + when (plist-get args keyword) + append (list keyword (plist-get args keyword))))))) (defun gnus-icalendar-event-from-buffer (buf &optional attendee-name-or-email) "Parse RFC5545 iCalendar in buffer BUF and return an event object. commit a950a6e6cf8dafc40acc1e32cc6fd62d515bb52d Author: Basil L. Contovounesios Date: Fri Oct 16 09:32:48 2020 +0200 Substitute command keys in button help-echo values * lisp/button.el (button--help-echo): Pass resulting string through substitute-command-keys for consistency with show-help-function. * test/lisp/button-tests.el (button-tests--map): New test keymap. (button--help-echo-string, button--help-echo-form) (button--help-echo-function): Use it to test command key substitution in help-echo strings (bug#43070). diff --git a/lisp/button.el b/lisp/button.el index 11317605ce..ba0682348d 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -493,12 +493,17 @@ butting, use the `button-describe' command." t)))) (defun button--help-echo (button) - "Evaluate BUTTON's `help-echo' property and return its value." - (let ((help (button-get button 'help-echo))) - (if (functionp help) - (let ((obj (if (overlayp button) button (current-buffer)))) - (funcall help (selected-window) obj (button-start button))) - (eval help lexical-binding)))) + "Evaluate BUTTON's `help-echo' property and return its value. +If the result is non-nil, pass it through `substitute-command-keys' +before returning it, as is done for `show-help-function'." + (let* ((help (button-get button 'help-echo)) + (help (if (functionp help) + (funcall help + (selected-window) + (if (overlayp button) button (current-buffer)) + (button-start button)) + (eval help lexical-binding)))) + (and help (substitute-command-keys help)))) (defun forward-button (n &optional wrap display-message no-error) "Move to the Nth next button, or Nth previous button if N is negative. diff --git a/test/lisp/button-tests.el b/test/lisp/button-tests.el index 11cc14042c..b463366c33 100644 --- a/test/lisp/button-tests.el +++ b/test/lisp/button-tests.el @@ -21,6 +21,12 @@ (require 'ert) +(defvar button-tests--map + (let ((map (make-sparse-keymap))) + (define-key map "x" #'ignore) + map) + "Keymap for testing command substitution.") + (ert-deftest button-at () "Test `button-at' behavior." (with-temp-buffer @@ -41,11 +47,13 @@ "Test `button--help-echo' with strings." (with-temp-buffer ;; Text property buttons. - (let ((button (insert-text-button "text" 'help-echo "text help"))) - (should (equal (button--help-echo button) "text help"))) + (let ((button (insert-text-button + "text" 'help-echo "text: \\\\[ignore]"))) + (should (equal (button--help-echo button) "text: x"))) ;; Overlay buttons. - (let ((button (insert-button "overlay" 'help-echo "overlay help"))) - (should (equal (button--help-echo button) "overlay help"))))) + (let ((button (insert-button "overlay" 'help-echo + "overlay: \\\\[ignore]"))) + (should (equal (button--help-echo button) "overlay: x"))))) (ert-deftest button--help-echo-form () "Test `button--help-echo' with forms." @@ -55,16 +63,17 @@ (form `(funcall (let ((,help "lexical form")) (lambda () ,help)))) (button (insert-text-button "text" 'help-echo form))) - (set help "dynamic form") - (should (equal (button--help-echo button) "dynamic form"))) + (set help "dynamic: \\\\[ignore]") + (should (equal (button--help-echo button) "dynamic: x"))) ;; Test overlay buttons with lexical scoping. (setq lexical-binding t) (let* ((help (make-symbol "help")) - (form `(funcall (let ((,help "lexical form")) - (lambda () ,help)))) + (form `(funcall + (let ((,help "lexical: \\\\[ignore]")) + (lambda () ,help)))) (button (insert-button "overlay" 'help-echo form))) (set help "dynamic form") - (should (equal (button--help-echo button) "lexical form"))))) + (should (equal (button--help-echo button) "lexical: x"))))) (ert-deftest button--help-echo-function () "Test `button--help-echo' with functions." @@ -77,9 +86,9 @@ (should (eq win owin)) (should (eq obj obuf)) (should (= pos opos)) - "text function")) + "text: \\\\[ignore]")) (button (insert-text-button "text" 'help-echo help))) - (should (equal (button--help-echo button) "text function")) + (should (equal (button--help-echo button) "text: x")) ;; Overlay buttons. (setq help (lambda (win obj pos) (should (eq win owin)) @@ -88,9 +97,9 @@ (should (eq (overlay-buffer obj) obuf)) (should (= (overlay-start obj) opos)) (should (= pos opos)) - "overlay function")) + "overlay: \\\\[ignore]")) (setq opos (point)) (setq button (insert-button "overlay" 'help-echo help)) - (should (equal (button--help-echo button) "overlay function"))))) + (should (equal (button--help-echo button) "overlay: x"))))) ;;; button-tests.el ends here commit 1e89dfc6c8bcab8b64ded08e8d42e32929189799 Author: Lars Ingebrigtsen Date: Fri Oct 16 09:10:05 2020 +0200 Make package-install-from-buffer maybe refresh the quickstart file * lisp/emacs-lisp/package.el (package-install-from-buffer): Refresh the quickstart file (bug#43237). This makes this command more consistent with package-install. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 5b7735125f..7b192d640b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2152,6 +2152,7 @@ Downloads and installs required packages as needed." (unless (package--user-selected-p name) (package--save-selected-packages (cons name package-selected-packages))) + (package--quickstart-maybe-refresh) pkg-desc)) ;;;###autoload commit 8b4dd261cb8c87d428dadb98d22254c818ac2eb6 Author: Lars Ingebrigtsen Date: Fri Oct 16 08:46:07 2020 +0200 diff-update-on-the-fly doc string clarification * lisp/vc/diff-mode.el (diff-update-on-the-fly): Mention what the nil value does (bug#43297). diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index f223ae48f3..d586afb97b 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -83,7 +83,10 @@ When editing a diff file, the line numbers in the hunk headers need to be kept consistent with the actual diff. This can either be done on the fly (but this sometimes interacts poorly with the undo mechanism) or whenever the file is written (can be slow -when editing big diffs)." +when editing big diffs). + +If this variable is nil, the hunk header numbers are updated when +the file is written instead." :type 'boolean) (defcustom diff-advance-after-apply-hunk t commit 2d7d98e1a6d16e26c34539d66c2cdadba930e816 Author: Lars Ingebrigtsen Date: Fri Oct 16 08:36:21 2020 +0200 Restore vc-revision-other-window buffer-changing behaviour * lisp/vc/vc.el (vc-revision-other-window): This function used to change the current buffer, but this was changed in the previous patch for indirect buffer support. Ensure that it still does this, because this is what the callers expect (bug#44026). diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 46c44fa54b..39d0fab391 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2058,13 +2058,13 @@ If `F.~REV~' already exists, use it instead of checking it out again." (list (vc-read-revision "Revision to visit (default is working revision): " (list buffer-file-name))))) - (with-current-buffer (or (buffer-base-buffer) (current-buffer)) - (vc-ensure-vc-buffer) - (let* ((file buffer-file-name) - (revision (if (string-equal rev "") - (vc-working-revision file) - rev))) - (switch-to-buffer-other-window (vc-find-revision file revision))))) + (set-buffer (or (buffer-base-buffer) (current-buffer))) + (vc-ensure-vc-buffer) + (let* ((file buffer-file-name) + (revision (if (string-equal rev "") + (vc-working-revision file) + rev))) + (switch-to-buffer-other-window (vc-find-revision file revision)))) (defun vc-find-revision (file revision &optional backend) "Read REVISION of FILE into a buffer and return the buffer. commit 9be54e3dba824a6d435d145deb786c71b3773593 Author: Lars Ingebrigtsen Date: Fri Oct 16 07:36:08 2020 +0200 Doc string clarification for keep-lines * lisp/replace.el (keep-lines): Note that REND isn't optional if RSTART is given (bug#44021). diff --git a/lisp/replace.el b/lisp/replace.el index d34cabfe89..3a2ab1d24c 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -906,7 +906,8 @@ and `search-upper-case' is non-nil, the matching is case-sensitive. Second and third arg RSTART and REND specify the region to operate on. This command operates on (the accessible part of) all lines whose accessible part is entirely contained in the region determined by RSTART -and REND. (A newline ending a line counts as part of that line.) +and REND. (A newline ending a line counts as part of that line.) If RSTART +is non-nil, REND also has to be given. Interactively, in Transient Mark mode when the mark is active, operate on all lines whose accessible part is entirely contained in the region. commit 41d220dc6085cb8cd96cfcf65248eb83015c1b90 Author: Lars Ingebrigtsen Date: Fri Oct 16 07:21:05 2020 +0200 Add a new variable to control Gnus Agent caching * doc/misc/gnus.texi (Agent Variables): Document it. * lisp/gnus/gnus-art.el (gnus-request-article-this-buffer): Ditto. * lisp/gnus/gnus-async.el (gnus-async-article-callback): Use it. * lisp/gnus/gnus.el (gnus-agent-eagerly-store-articles): New variable. Includes work from Madhu . diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index f356dfe4d0..3f893e93c8 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -19489,6 +19489,11 @@ Variable to control whether use the locally stored @acronym{NOV} and articles when plugged, e.g., essentially using the Agent as a cache. The default is non-@code{nil}, which means to use the Agent as a cache. +@item gnus-agent-eagerly-store-articles +@vindex gnus-agent-eagerly-store-articles +If non-@code{nil} (which is the default), store all articles read in +agentized groups in the Agent cache. + @item gnus-agent-go-online @vindex gnus-agent-go-online If @code{gnus-agent-go-online} is @code{nil}, the Agent will never diff --git a/etc/NEWS b/etc/NEWS index 2a75e13eff..1838b6b38a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -434,6 +434,11 @@ tags to be considered as well. ** Gnus ++++ +*** New user option 'gnus-agent-eagerly-store-articles'. +If non-nil (which is the default), the Gnus Agent will store all read +articles in the Agent cache. + +++ *** New user option 'gnus-global-groups'. Gnus handles private groups differently from public (i.e., NNTP-like) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 2d9d5ece01..2e9d85e39d 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -7094,6 +7094,7 @@ If given a prefix, show the hidden text instead." (gnus-backlog-enter-article group article (current-buffer))) (when (and gnus-agent + gnus-agent-eagerly-store-articles (gnus-agent-group-covered-p group)) (gnus-agent-store-article article group))) (setq result 'article)) diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el index e3e81c8bbc..9b08e6a0ef 100644 --- a/lisp/gnus/gnus-async.el +++ b/lisp/gnus/gnus-async.el @@ -227,6 +227,7 @@ that was fetched." (narrow-to-region mark (point-max)) ;; Put the articles into the agent, if they aren't already. (when (and gnus-agent + gnus-agent-eagerly-store-articles (gnus-agent-group-covered-p group)) (save-restriction (narrow-to-region mark (point-max)) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index cb534260a6..c1cfddc87b 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -2285,6 +2285,14 @@ a string, be sure to use a valid format, see RFC 2616." (gnus-message 1 "Edit your init file to make this change permanent.") (sit-for 2))) +(defcustom gnus-agent-eagerly-store-articles t + "If non-nil, cache articles eagerly. + +When using the Gnus Agent and reading an agentized newsgroup, +automatically cache the article in the agent cache." + :type 'boolean + :version "28.1") + ;;; Internal variables commit 7e3a95d8fd0ced4a75edea7b14b3038b1997d516 Author: Richard M Stallman Date: Thu Oct 15 22:32:41 2020 -0400 Add way to prevent asking "increase specpdl size?" * net/shr.el (shr-offer-extend-specpdl): New option, default t. (shr-descend): If shr-offer-extend-specpdl is nil, don't even ask whether to extend the specpdl, just signal error. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 88e691752a..2e5dd5ffa5 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -146,6 +146,14 @@ same domain as the main data." :version "24.4" :type 'boolean) +(defcustom shr-offer-extend-specpdl t + "Non-nil means offer to extend the specpdl if the HTML nests deeply. +Complicated HTML can require more nesting than the current specpdl +size permits. If this variable is t, ask the user whether to increase +the specpdl size. If nil, just give up." + :version "28.1" + :type 'boolean) + (defvar shr-content-function nil "If bound, this should be a function that will return the content. This is used for cid: URLs, and the function is called with the @@ -527,7 +535,8 @@ size, and full-buffer size." (start (point))) ;; shr uses many frames per nested node. (if (and (> shr-depth (/ max-specpdl-size 15)) - (not (and (y-or-n-p "Too deeply nested to render properly; increase `max-specpdl-size'?") + (not (and shr-offer-extend-specpdl + (y-or-n-p "Too deeply nested to render properly; increase `max-specpdl-size'?") (setq max-specpdl-size (* max-specpdl-size 2))))) (setq shr-warning "Not rendering the complete page because of too-deep nesting") commit f5c9d3f54ec85a83bfe33d0171df2546e750ec0c Author: Stefan Monnier Date: Thu Oct 15 14:34:12 2020 -0400 * lisp/emacs-lisp/warnings.el (display-warning): Don't be so negative diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 6919edcc81..f525ea433a 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -294,8 +294,7 @@ entirely by setting `warning-suppress-types' or message) ;; Don't output the buttons when doing batch compilation ;; and similar. - (when (and (not noninteractive) - (not (eq type 'bytecomp))) + (unless (or noninteractive (eq type 'bytecomp)) (insert " ") (insert-button "Disable showing" 'type 'warning-suppress-warning commit ce09f19c2849c6c13520cc1d8351974c8bee9640 Author: Lars Ingebrigtsen Date: Thu Oct 15 18:36:26 2020 +0200 Don't display the warning buttons in bytecomp buffers * lisp/emacs-lisp/warnings.el (display-warning): Don't do the buttons in bytecomp buffers. diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index e10c149d89..6919edcc81 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -294,7 +294,8 @@ entirely by setting `warning-suppress-types' or message) ;; Don't output the buttons when doing batch compilation ;; and similar. - (unless noninteractive + (when (and (not noninteractive) + (not (eq type 'bytecomp))) (insert " ") (insert-button "Disable showing" 'type 'warning-suppress-warning commit 97b8c0adc1d6ce42c43829e1270c0ccd13a82382 Author: Lars Ingebrigtsen Date: Thu Oct 15 17:45:12 2020 +0200 Make hi-lock-face-buffer more resilient * lisp/hi-lock.el (hi-lock-face-buffer): If given a face name a string, convert it to a symbol first, as later usage of this expects a symbol and not a string (bug#43339). diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index a81cefacb0..536a1af846 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -493,6 +493,8 @@ the major mode specifies support for Font Lock." 'regexp-history-last))) (hi-lock-read-face-name) current-prefix-arg)) + (when (stringp face) + (setq face (intern face))) (or (facep face) (setq face 'hi-yellow)) (unless hi-lock-mode (hi-lock-mode 1)) (hi-lock-set-pattern commit c7b952c45c4aab86b8039c22dc95c4be8782a9e6 Author: Lars Ingebrigtsen Date: Thu Oct 15 17:10:41 2020 +0200 Add some references to the microdocs in the comments in cperl-mode * lisp/progmodes/cperl-mode.el: Tell the people reading the comments how to read the docs explicitly (bug#1621). diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 2e4b9d4693..5b6e50c820 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -48,6 +48,10 @@ ;; DO NOT FORGET to read micro-docs (available from `Perl' menu) <<<<<< ;; or as help on variables `cperl-tips', `cperl-problems', <<<<<< ;; `cperl-praise', `cperl-speed'. <<<<<< +;; +;; Or search for "Short extra-docs" further down in this file for +;; details on how to use `cperl-mode' instead of `perl-mode' and lots +;; of other details. ;; The mode information (on C-h m) provides some customization help. ;; If you use font-lock feature of this mode, it is advisable to use commit 5f53a49d48df8c637904fdc2b5e58ab900a1a327 Author: David Engster Date: Thu Oct 15 16:47:44 2020 +0200 Search harder for file name matches in *compilation* buffers * lisp/progmodes/compile.el (compilation-find-file): Use it (bug#14411). (compilation-search-all-directories): New variable. diff --git a/etc/NEWS b/etc/NEWS index 97e2e6f1d3..2a75e13eff 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1138,6 +1138,14 @@ window after starting). This variable defaults to nil. ** Miscellaneous +--- +*** New user option 'compilation-search-all-directories'. +When doing parallel builds, directories and compilation errors may +arrive in the *compilation* buffer out-of-order. If this variable is +non-nil (the default), Emacs will now search backwards in the buffer +for any directory the file with errors may be in. If nil, this won't +be done (and this restores how this previously worked). + +++ *** New user option 'next-error-message-highlight'. In addition to a fringe arrow, 'next-error' error may now optionally diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 4fe13770b5..bc0fe6d63a 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -745,6 +745,18 @@ variable, and you might not notice. Therefore, `compile-command' is considered unsafe if this variable is nil." :type 'boolean) +(defcustom compilation-search-all-directories t + "Whether further upward directories should be used when searching a file. +When doing a parallel build, several files from different +directories can be compiled at the same time. This makes it +difficult to determine the base directory for a relative file +name in a compiler error or warning. If this variable is +non-nil, instead of just relying on the previous directory change +in the compilation buffer, all other directories further upwards +will be used as well." + :type 'boolean + :version "28.1") + ;;;###autoload (defcustom compilation-ask-about-save t "Non-nil means \\[compile] asks which buffers to save before compiling. @@ -2916,6 +2928,28 @@ attempts to find a file whose name is produced by (format FMT FILENAME)." (find-file-noselect name)) fmts (cdr fmts))) (setq dirs (cdr dirs))) + ;; If we haven't found it, this might be a parallel build. + ;; Search the directories further up the buffer. + (when (and (null buffer) + compilation-search-all-directories) + (with-current-buffer (marker-buffer marker) + (save-excursion + (goto-char (marker-position marker)) + (when-let ((prev (compilation--previous-directory (point)))) + (goto-char prev)) + (setq dirs (cdr (or (get-text-property + (1- (point)) 'compilation-directory) + (get-text-property + (point) 'compilation-directory)))))) + (while (and dirs (null buffer)) + (setq thisdir (car dirs) + fmts formats) + (while (and fmts (null buffer)) + (setq name (expand-file-name (format (car fmts) filename) thisdir) + buffer (and (file-exists-p name) + (find-file-noselect name)) + fmts (cdr fmts))) + (setq dirs (cdr dirs)))) (while (null buffer) ;Repeat until the user selects an existing file. ;; The file doesn't exist. Ask the user where to find it. (save-excursion ;This save-excursion is probably not right. commit c6ecf6428e8d4848a633782ed0605ddbacfcebee Author: Lars Ingebrigtsen Date: Thu Oct 15 16:26:40 2020 +0200 Make `C-x C-e' work more like `C-M-x' on defvar etc * doc/emacs/building.texi (Lisp Eval): Document it. * lisp/emacs-lisp/pp.el (pp-eval-last-sexp): Ditto. * lisp/progmodes/elisp-mode.el (elisp--eval-last-sexp): Work more like `eval-defun': Re-evaluate defvar/defcustom/defface forms. diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 573b7ad71a..3e09f24322 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -1672,21 +1672,26 @@ abbreviation of the output according to the variables argument of @code{-1} overrides the effect of @code{eval-expression-print-length}. + @kbd{C-x C-e} (@code{eval-last-sexp}) treats @code{defvar} +expressions specially. Normally, evaluating a @code{defvar} +expression does nothing if the variable it defines already has a +value. But this command unconditionally resets the variable to the +initial value specified by the @code{defvar}; this is convenient for +debugging Emacs Lisp programs. @code{defcustom} and @code{defface} +expressions are treated similarly. Note the other commands documented +in this section, except @code{eval-defun}, do not have this special +feature. + @kindex C-M-x @r{(Emacs Lisp mode)} @findex eval-defun The @code{eval-defun} command is bound to @kbd{C-M-x} in Emacs Lisp mode. It evaluates the top-level Lisp expression containing or following point, and prints the value in the echo area. In this context, a top-level expression is referred to as a ``defun'', but it -need not be an actual @code{defun} (function definition). In -particular, this command treats @code{defvar} expressions specially. -Normally, evaluating a @code{defvar} expression does nothing if the -variable it defines already has a value. But this command -unconditionally resets the variable to the initial value specified by -the @code{defvar}; this is convenient for debugging Emacs Lisp -programs. @code{defcustom} and @code{defface} expressions are treated -similarly. Note that the other commands documented in this section do -not have this special feature. +need not be an actual @code{defun} (function definition). + + This command handles @code{defvar}/@code{defcustom}/@code{defface} +forms the same way that @code{eval-last-sexp} does. With a prefix argument, @kbd{C-M-x} instruments the function definition for Edebug, the Emacs Lisp Debugger. @xref{Instrumenting, diff --git a/etc/NEWS b/etc/NEWS index 6b9105f577..97e2e6f1d3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -180,6 +180,12 @@ file during parsing" and dropping out of the minibuffer. The user would have to type 'M-: M-p' to edit and redo the expression. Now Emacs will echo the message and allow the user to continue editing. ++++ +** 'eval-last-sexp' now handles 'defvar'/'defcustom'/'defface' specially. +This command would previously not redefine values defined by these +forms, but this command has now been changed to work more like +'eval-defun', and reset the values as specified. + +++ ** New command 'undo-redo'. It undoes previous undo commands, but doesn't record itself as an diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 3df7b0e368..eb2ee94be3 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -164,8 +164,11 @@ With argument, pretty-print output into current buffer. Ignores leading comment characters." (interactive "P") (if arg - (insert (pp-to-string (eval (pp-last-sexp) lexical-binding))) - (pp-eval-expression (pp-last-sexp)))) + (insert (pp-to-string (eval (elisp--eval-defun-1 + (macroexpand (pp-last-sexp))) + lexical-binding))) + (pp-eval-expression (elisp--eval-defun-1 + (macroexpand (pp-last-sexp)))))) ;;;###autoload (defun pp-macroexpand-last-sexp (arg) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index b4803687b5..dbbb1274fa 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1190,7 +1190,8 @@ character)." ;; Setup the lexical environment if lexical-binding is enabled. (elisp--eval-last-sexp-print-value (eval (macroexpand-all - (eval-sexp-add-defvars (elisp--preceding-sexp))) + (eval-sexp-add-defvars + (elisp--eval-defun-1 (macroexpand (elisp--preceding-sexp))))) lexical-binding) (if insert-value (current-buffer) t) no-truncate char-print-limit))) @@ -1246,6 +1247,10 @@ POS specifies the starting position where EXP was found and defaults to point." Interactively, with a non `-' prefix argument, print output into current buffer. +This commands handles `defvar', `defcustom' and `defface' the +same way that `eval-defun' does. See the doc string of that +function for details. + Normally, this function truncates long output according to the value of the variables `eval-expression-print-length' and `eval-expression-print-level'. With a prefix argument of zero, commit 1117366d030fd8eb0ed7c8285ca7d763ac9edc98 Author: Stefan Kangas Date: Thu Oct 15 15:03:42 2020 +0200 * doc/misc/efaq.texi: Remove reference to FTP. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index f42d675978..115dd8a5ae 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -27,7 +27,7 @@ The same conditions apply to any derivative of the FAQ as apply to the FAQ itself. Every copy of the FAQ must include this notice or an approved translation, information on who is currently maintaining the FAQ and how to contact them (including their e-mail address), and information on where the -latest version of the FAQ is archived (including FTP information). +latest version of the FAQ is archived. The FAQ may be copied and redistributed under these conditions, except that the FAQ may not be embedded in a larger literary work unless that work commit 0f3bdd577ec832696d681cbeb764590c45561b9e Author: Stefan Kangas Date: Thu Oct 15 15:00:05 2020 +0200 Remove some references to "in Emacs 21 or later" * doc/misc/efaq.texi (Colors on a TTY, Disabling backups) (Errors with init files, Backspace invokes help) (Backspace invokes help): Remove some references to "in Emacs 21 or later". Now everyone can be assumed to use at least that version. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 3c1244101f..f42d675978 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -1525,13 +1525,12 @@ customize, with completion. @cindex Syntax highlighting on a TTY @cindex Console, colors -In Emacs 21.1 and later, colors and faces are supported in non-windowed mode, -i.e., on Unix and GNU/Linux text-only terminals and consoles, and when -invoked as @samp{emacs -nw} on X, and MS-Windows. (Colors and faces were -supported in the MS-DOS port since Emacs 19.29.) Emacs automatically -detects color support at startup and uses it if available. If you think -that your terminal supports colors, but Emacs won't use them, check the -@code{termcap} entry for your display type for color-related +Colors and faces are supported in non-windowed mode, i.e., on Unix and +GNU/Linux text-only terminals and consoles, and when invoked as +@samp{emacs -nw} on X, MS-DOS and MS-Windows. Emacs automatically +detects color support at startup and uses it if available. If you +think that your terminal supports colors, but Emacs won't use them, +check the @code{termcap} entry for your display type for color-related capabilities. The command @kbd{M-x list-colors-display} pops up a window which @@ -2540,12 +2539,12 @@ To disable or change the way backups are made, @pxref{Backup Names,,, emacs, The GNU Emacs Manual}. @cindex Backup files in a single directory -Beginning with Emacs 21.1, you can control where Emacs puts backup files -by customizing the variable @code{backup-directory-alist}. This -variable's value specifies that files whose names match specific patters -should have their backups put in certain directories. A typical use is -to add the element @code{("." . @var{dir})} to force Emacs to put -@strong{all} backup files in the directory @file{dir}. +You can control where Emacs puts backup files by customizing the +variable @code{backup-directory-alist}. This variable's value +specifies that files whose names match specific patters should have +their backups put in certain directories. A typical use is to add the +element @code{("." . @var{dir})} to force Emacs to put @strong{all} +backup files in the directory @file{dir}. @node Disabling auto-save-mode @section How do I disable @code{auto-save-mode}? @@ -3054,7 +3053,7 @@ if ("$term" == emacs) set term=dumb @cindex Debugging @file{.emacs} file An error occurred while loading either your @file{.emacs} file or the -system-wide file @file{site-lisp/default.el}. Emacs 21.1 and later pops the +system-wide file @file{site-lisp/default.el}. Emacs pops the @file{*Messages*} buffer, and puts there some additional information about the error, to provide some hints for debugging. @@ -3869,12 +3868,11 @@ You may be able to get a keyboard that is completely programmable, or a terminal emulator that supports remapping of any key to any other key. @item -With Emacs 21.1 and later, you can control the effect of the -@key{Backspace} and @key{Delete} keys, on both dumb terminals and a -windowed displays, by customizing the option -@code{normal-erase-is-backspace-mode}, or by invoking @kbd{M-x -normal-erase-is-backspace}. See the documentation of these symbols -(@pxref{Emacs Lisp documentation}) for more info. +You can control the effect of the @key{Backspace} and @key{Delete} +keys, on both dumb terminals and a windowed displays, by customizing +the option @code{normal-erase-is-backspace-mode}, or by invoking +@kbd{M-x normal-erase-is-backspace}. See the documentation of these +symbols (@pxref{Emacs Lisp documentation}) for more info. @item It is possible to swap the @key{Backspace} and @key{DEL} keys inside @@ -3925,9 +3923,9 @@ many modes that have local bindings of @key{DEL} that will interfere. @end itemize -When Emacs 21 or later runs on a windowed display, it binds the -@key{Delete} key to a command which deletes the character at point, to -make Emacs more consistent with keyboard operation on these systems. +When Emacs runs on a windowed display, it binds the @key{Delete} key +to a command which deletes the character at point, to make Emacs more +consistent with keyboard operation on these systems. For more information about troubleshooting this problem, see @ref{DEL Does Not Delete, , If @key{DEL} Fails to Delete, emacs, The GNU Emacs commit 519e23d727a293f04dadf9f6eaebf07b6723500f Author: Stefan Kangas Date: Thu Oct 15 14:49:23 2020 +0200 Move emacsclient.1 file history further down * doc/man/emacsclient.1: Move file history further down; it doesn't need to be prominently displayed in the introductory paragraph. diff --git a/doc/man/emacsclient.1 b/doc/man/emacsclient.1 index 9d14d0fe75..62f5489653 100644 --- a/doc/man/emacsclient.1 +++ b/doc/man/emacsclient.1 @@ -1,5 +1,5 @@ .\" See section COPYING for conditions for redistribution. -.TH EMACSCLIENT 1 "2019-08-02" "GNU Emacs" "GNU" +.TH EMACSCLIENT 1 "2020-10-15" "GNU Emacs" "GNU" .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other params are allowed: see man(7), man(1) .SH NAME @@ -12,8 +12,6 @@ This manual page documents briefly the .BR emacsclient command. Full documentation is available in the GNU Info format; see below. -This manual page was originally written for the Debian GNU/Linux -distribution, but is not specific to that system. .PP .B emacsclient works in conjunction with the built-in Emacs server. @@ -110,8 +108,9 @@ The program is documented fully in .IR "Using Emacs as a Server" available via the Info system. .SH AUTHOR -This manual page was written by Stephane Bortzmeyer , -for the Debian GNU/Linux system (but may be used by others). +This manual page was originally written by Stephane Bortzmeyer +, for the Debian GNU/Linux system, but is not +specific to that system. .SH COPYING This manual page is in the public domain. commit 8fb761af6b9576022170aeb8278a8e27cd1d2be5 Author: Lars Ingebrigtsen Date: Thu Oct 15 13:20:22 2020 +0200 Fix undefined function in project-compile * lisp/progmodes/project.el (project-compile): Require compile.el before using functions from the file (bug#44009). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 40a804b00e..8f7482a23d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -940,6 +940,7 @@ Arguments the same as in `compile'." (interactive (list (let ((command (eval compile-command))) + (require 'compile) (if (or compilation-read-command current-prefix-arg) (compilation-read-command command) command)) commit 674fee5e9fb70d83d9408ebc01d8c15bd641663c Author: Mattias EngdegÄrd Date: Thu Oct 15 11:46:49 2020 +0200 Remove dynamic declaration of 'save-match-data-internal' * lisp/subr.el: Remove defvar which has no relevance today; it can very well be a lexical variable. diff --git a/lisp/subr.el b/lisp/subr.el index 867c9f0bfb..b7a746f2db 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -886,10 +886,6 @@ side-effects, and the argument LIST is not modified." ;;;; Keymap support. -;; Declare before first use of `save-match-data', -;; where it is used internally. -(defvar save-match-data-internal) - (defun kbd (keys) "Convert KEYS to the internal Emacs key representation. KEYS should be a string in the format returned by commands such