commit c60d707f2cc62b4cbe7f9c29d6ff9c2ae0277f9b (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Sat May 22 23:52:19 2021 +0300 * src/editfns.c (Finsert_char): Add docstring reference to read-char-by-name. diff --git a/src/editfns.c b/src/editfns.c index 04b8e85d9c..182d3ba6f2 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1452,8 +1452,8 @@ DEFUN ("insert-char", Finsert_char, Sinsert_char, 1, 3, (prefix-numeric-value current-prefix-arg)\ t))", doc: /* Insert COUNT copies of CHARACTER. -Interactively, prompt for CHARACTER. You can specify CHARACTER in one -of these ways: +Interactively, prompt for CHARACTER using `read-char-by-name'. +You can specify CHARACTER in one of these ways: - As its Unicode character name, e.g. \"LATIN SMALL LETTER A\". Completion is available; if you type a substring of the name commit 62e2dce3a99cffb174240eed633196058e3c18a2 Author: Tassilo Horn Date: Sat May 22 19:06:57 2021 +0200 Document bug-reference setup for 3rd-party packages * doc/emacs/maintaining.texi (Bug Reference): Add section explaining adding support for third-party packages. * lisp/progmodes/bug-reference.el (bug-reference-maybe-setup-from-vc) (bug-reference-maybe-setup-from-mail) (bug-reference-maybe-setup-from-irc): Rename from bug-reference--maybe-setup-from-*, i.e., un-privatize them because they are advertised in the docs now. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index d20081137a..a91bfacb9e 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -3123,8 +3123,10 @@ variables itself by calling the functions in @code{bug-reference-auto-setup-functions} one after the other until one is able to set the variables. +@vindex bug-reference-setup-from-vc-alist +@vindex bug-reference-setup-from-mail-alist +@vindex bug-reference-setup-from-irc-alist Right now, there are three types of setup functions. - @enumerate @item Setup for version-controlled files configurable by the variable @@ -3177,6 +3179,38 @@ with Rmail all messages reside in the same buffer but the setup needs to be performed whenever another messages is displayed. +@heading Adding support for third-party packages + +@vindex bug-reference-auto-setup-functions +Adding support for bug-reference' auto-setup is usually quite +straight-forward: write a setup function of zero arguments which +gathers the required information (e.g., List-Id/To/From/Cc mail header +values in the case of a MUA), and then calls one of the following +helper functions: +@itemize @bullet +@item +@code{bug-reference-maybe-setup-from-vc} which does the setup +according to @code{bug-reference-setup-from-vc-alist}, + +@item +@code{bug-reference-maybe-setup-from-mail} which does the setup +according to @code{bug-reference-setup-from-mail-alist}, + +@item +and @code{bug-reference-maybe-setup-from-irc} which does the setup +according to @code{bug-reference-setup-from-irc-alist}. +@end itemize +A setup function should return non-nil if it could setup bug-reference +mode which is the case if the last thing the function does is calling +one of the helper functions above. + +Finally, the setup function has to be added to +@code{bug-reference-auto-setup-functions}. + +Note that these auto-setup functions should check as a first step if +they are applicable, e.g., by checking the @code{major-mode} value. + + @heading Integration with the debbugs package @findex debbugs-browse-mode diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index 141e97c3b0..f1ec5224c7 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -138,7 +138,7 @@ The second subexpression should match the bug reference (usually a number)." (when url (browse-url url)))))) -(defun bug-reference--maybe-setup-from-vc (url url-rx bug-rx bug-url-fmt) +(defun bug-reference-maybe-setup-from-vc (url url-rx bug-rx bug-url-fmt) (when (string-match url-rx url) (setq-local bug-reference-bug-regexp bug-rx) (setq-local bug-reference-url-format @@ -224,7 +224,7 @@ and apply it if applicable." (when url (catch 'found (dolist (config bug-reference-setup-from-vc-alist) - (when (apply #'bug-reference--maybe-setup-from-vc + (when (apply #'bug-reference-maybe-setup-from-vc url config) (throw 'found t))))))))) @@ -258,7 +258,7 @@ same `bug-reference-url-format' and `bug-reference-url-format'.") (defvar gnus-newsgroup-name) -(defun bug-reference--maybe-setup-from-mail (group header-values) +(defun bug-reference-maybe-setup-from-mail (group header-values) "Set up according to mail GROUP or HEADER-VALUES. Group is a mail group/folder name and HEADER-VALUES is a list of mail header values, e.g., the values of From, To, Cc, List-ID, @@ -294,53 +294,51 @@ and set it if applicable." ;; article changes. (add-hook 'gnus-article-prepare-hook #'bug-reference--try-setup-gnus-article) - (bug-reference--maybe-setup-from-mail gnus-newsgroup-name nil))) + (bug-reference-maybe-setup-from-mail gnus-newsgroup-name nil))) (defvar gnus-article-buffer) (defvar gnus-original-article-buffer) (defvar gnus-summary-buffer) (defun bug-reference--try-setup-gnus-article () - (with-demoted-errors - "Error in bug-reference--try-setup-gnus-article: %S" - (when (and bug-reference-mode ;; Only if enabled in article buffers. - (derived-mode-p - 'gnus-article-mode - ;; Apparently, gnus-article-prepare-hook is run in the - ;; summary buffer... - 'gnus-summary-mode) - gnus-article-buffer - gnus-original-article-buffer - (buffer-live-p (get-buffer gnus-article-buffer)) - (buffer-live-p (get-buffer gnus-original-article-buffer))) - (with-current-buffer gnus-article-buffer - (catch 'setup-done - ;; Copy over the values from the summary buffer. - (when (and gnus-summary-buffer - (buffer-live-p gnus-summary-buffer)) - (setq-local bug-reference-bug-regexp - (with-current-buffer gnus-summary-buffer - bug-reference-bug-regexp)) - (setq-local bug-reference-url-format - (with-current-buffer gnus-summary-buffer - bug-reference-url-format)) - (when (and bug-reference-bug-regexp - bug-reference-url-format) - (throw 'setup-done t))) - ;; If the summary had no values, try setting according to - ;; the values of the From, To, and Cc headers. - (let (header-values) - (with-current-buffer - (get-buffer gnus-original-article-buffer) - (save-excursion - (goto-char (point-min)) - ;; The Newsgroup is omitted because we already matched - ;; based on group name in the summary buffer. - (dolist (field '("list-id" "to" "from" "cc")) - (let ((val (mail-fetch-field field))) - (when val - (push val header-values)))))) - (bug-reference--maybe-setup-from-mail nil header-values))))))) + (when (and bug-reference-mode ;; Only if enabled in article buffers. + (derived-mode-p + 'gnus-article-mode + ;; Apparently, gnus-article-prepare-hook is run in the + ;; summary buffer... + 'gnus-summary-mode) + gnus-article-buffer + gnus-original-article-buffer + (buffer-live-p (get-buffer gnus-article-buffer)) + (buffer-live-p (get-buffer gnus-original-article-buffer))) + (with-current-buffer gnus-article-buffer + (catch 'setup-done + ;; Copy over the values from the summary buffer. + (when (and gnus-summary-buffer + (buffer-live-p gnus-summary-buffer)) + (setq-local bug-reference-bug-regexp + (with-current-buffer gnus-summary-buffer + bug-reference-bug-regexp)) + (setq-local bug-reference-url-format + (with-current-buffer gnus-summary-buffer + bug-reference-url-format)) + (when (and bug-reference-bug-regexp + bug-reference-url-format) + (throw 'setup-done t))) + ;; If the summary had no values, try setting according to + ;; the values of the From, To, and Cc headers. + (let (header-values) + (with-current-buffer + (get-buffer gnus-original-article-buffer) + (save-excursion + (goto-char (point-min)) + ;; The Newsgroup is omitted because we already matched + ;; based on group name in the summary buffer. + (dolist (field '("list-id" "to" "from" "cc")) + (let ((val (mail-fetch-field field))) + (when val + (push val header-values)))))) + (bug-reference-maybe-setup-from-mail nil header-values)))))) (defun bug-reference-try-setup-from-rmail () "Try setting up `bug-reference-mode' from the current rmail mail. @@ -349,19 +347,17 @@ Guesses suitable `bug-reference-bug-regexp' and file's name against GROUP-REGEXP and the values of List-Id, To, From, and Cc against HEADER-REGEXP in `bug-reference-setup-from-mail-alist'." - (with-demoted-errors - "Error in bug-reference-try-setup-from-rmail: %S" - (when (and bug-reference-mode - (derived-mode-p 'rmail-mode)) - (let (header-values) - (save-excursion - (goto-char (point-min)) - (dolist (field '("list-id" "to" "from" "cc")) - (let ((val (mail-fetch-field field))) - (when val - (push val header-values))))) - (bug-reference--maybe-setup-from-mail - (buffer-file-name) header-values))))) + (when (and bug-reference-mode + (derived-mode-p 'rmail-mode)) + (let (header-values) + (save-excursion + (goto-char (point-min)) + (dolist (field '("list-id" "to" "from" "cc")) + (let ((val (mail-fetch-field field))) + (when val + (push val header-values))))) + (bug-reference-maybe-setup-from-mail + (buffer-file-name) header-values)))) (defvar bug-reference-setup-from-irc-alist `((,(concat "#" (regexp-opt '("emacs" "gnus" "org-mode" "rcirc" @@ -386,7 +382,7 @@ If all given entries match, BUG-REGEXP is set as `bug-reference-bug-regexp' and URL-FORMAT is set as `bug-reference-url-format'.") -(defun bug-reference--maybe-setup-from-irc (channel network) +(defun bug-reference-maybe-setup-from-irc (channel network) "Set up according to IRC CHANNEL or NETWORK. CHANNEL is an IRC channel name (or generally a target, i.e., it could also be a user name) and NETWORK is that channel's network @@ -422,7 +418,7 @@ corresponding BUG-REGEXP and URL-FORMAT are set." Test each configuration in `bug-reference-setup-from-irc-alist' and set it if applicable." (when (derived-mode-p 'rcirc-mode) - (bug-reference--maybe-setup-from-irc + (bug-reference-maybe-setup-from-irc rcirc-target (and rcirc-server-buffer (buffer-live-p rcirc-server-buffer) @@ -437,7 +433,7 @@ and set it if applicable." Test each configuration in `bug-reference-setup-from-irc-alist' and set it if applicable." (when (derived-mode-p 'erc-mode) - (bug-reference--maybe-setup-from-irc + (bug-reference-maybe-setup-from-irc (erc-format-target) (erc-network-name)))) commit 048dc9441e77e5147ddf3c2ab64ddc3ba6fa0f3a Merge: 35182fff40 30e5d93ee1 Author: Glenn Morris Date: Sat May 22 09:19:01 2021 -0700 Merge from origin/emacs-27 30e5d93ee1 (origin/emacs-27) Improve documentation of display tables 8804ac857b * src/buffer.c (syms_of_buffer) : Doc fix. (Bu... commit 35182fff407ce9e6180e50e627914d63c4f3504c Author: Glenn Morris Date: Sat May 22 09:17:56 2021 -0700 * doc/emacs/maintaining.texi (Bug Reference): Fix cross refs. "First argument to cross-reference may not be empty." (makeinfo 4). diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 8b0f65d967..d20081137a 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -3144,8 +3144,8 @@ mailreader @ref{Gnus} and @ref{Rmail} are supported. @item Setup for IRC channels configurable by the variable @code{bug-reference-setup-from-irc-alist}. The built-in IRC clients -Rcirc, @xref{,,,Rcirc, Rcirc}, and ERC, @xref{,,,ERC, ERC}, are -supported. +Rcirc, @xref{Top, Rcirc,, rcirc, The Rcirc Manual}, and ERC, +@xref{Top, ERC,, erc, The ERC Manual}, are supported. @end enumerate For almost all of those modes, it's enough to simply enable commit 4db69b32b835a833168982b0f11a43d7f62ba8b2 Author: Michael Albinus Date: Sat May 22 17:51:07 2021 +0200 Fix bug#48476 * lisp/net/tramp-archive.el (tramp-archive-autoload-file-name-handler): Add implementation. * lisp/net/tramp-integration.el (tramp-rename-files) (tramp-rename-these-files): Declare them. * lisp/net/tramp.el (tramp-autoload-file-name-handler): Load tramp-archive.el if needed. (Bug#48476) * test/lisp/net/tramp-archive-tests.el (tramp-archive-test45-auto-load): Extend test. Use #' syntax for function symbols. diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 61c40ffdea..a37009402c 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -345,8 +345,12 @@ arguments to pass to the OPERATION." (tramp-archive-run-real-handler operation args))))))) ;;;###autoload -(defalias - 'tramp-archive-autoload-file-name-handler #'tramp-autoload-file-name-handler) +(progn (defun tramp-archive-autoload-file-name-handler (operation &rest args) + "Load Tramp archive file name handler, and perform OPERATION." + (if tramp-archive-enabled + (let ((tramp-archive-autoload t)) + tramp-archive-autoload ; Silence byte compiler. + (apply #'tramp-autoload-file-name-handler operation args))))) ;;;###autoload (progn (defun tramp-register-archive-file-name-handler () diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 2fcb7b11e8..fdde7fbe44 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -237,8 +237,7 @@ Return VALUE." ;;;###tramp-autoload (defun tramp-flush-file-properties (key file) "Remove all properties of FILE in the cache context of KEY." - (let* ((file (tramp-run-real-handler - #'directory-file-name (list file))) + (let* ((file (tramp-run-real-handler #'directory-file-name (list file))) (truename (tramp-get-file-property key file "file-truename" nil))) ;; Unify localname. Remove hop from `tramp-file-name' structure. (setq file (tramp-compat-file-name-unquote file) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index c4ec1121da..f1d24dc0c4 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1089,7 +1089,7 @@ file names." 'copy filename newname ok-if-already-exists keep-date preserve-uid-gid preserve-extended-attributes) (tramp-run-real-handler - 'copy-file + #'copy-file (list filename newname ok-if-already-exists keep-date preserve-uid-gid preserve-extended-attributes)))) diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index 2931b4f0cc..17264193fd 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -42,6 +42,8 @@ (declare-function tramp-dissect-file-name "tramp") (declare-function tramp-file-name-equal-p "tramp") (declare-function tramp-tramp-file-p "tramp") +(declare-function tramp-rename-files "tramp-cmds") +(declare-function tramp-rename-these-files "tramp-cmds") (defvar eshell-path-env) (defvar ido-read-file-name-non-ido) (defvar info-lookup-alist) @@ -184,14 +186,14 @@ NAME must be equal to `tramp-current-connection'." ;;; Integration of ido.el: (with-eval-after-load 'ido - (add-to-list 'ido-read-file-name-non-ido 'tramp-rename-files) - (add-to-list 'ido-read-file-name-non-ido 'tramp-these-rename-files) + (add-to-list 'ido-read-file-name-non-ido #'tramp-rename-files) + (add-to-list 'ido-read-file-name-non-ido #'tramp-rename-these-files) (add-hook 'tramp-integration-unload-hook (lambda () (setq ido-read-file-name-non-ido - (delq 'tramp-these-rename-files ido-read-file-name-non-ido) + (delq #'tramp-rename-these-files ido-read-file-name-non-ido) ido-read-file-name-non-ido - (delq 'tramp-rename-files ido-read-file-name-non-ido))))) + (delq #'tramp-rename-files ido-read-file-name-non-ido))))) ;;; Integration of ivy.el: @@ -199,17 +201,17 @@ NAME must be equal to `tramp-current-connection'." (add-to-list 'ivy-completing-read-handlers-alist '(tramp-rename-files . completing-read-default)) (add-to-list 'ivy-completing-read-handlers-alist - '(tramp-these-rename-files . completing-read-default)) + '(tramp-rename-these-files . completing-read-default)) (add-hook 'tramp-integration-unload-hook (lambda () (setq ivy-completing-read-handlers-alist (delete - (assq 'tramp-these-rename-files ivy-completing-read-handlers-alist) + (assq #'tramp-rename-these-files ivy-completing-read-handlers-alist) ivy-completing-read-handlers-alist) ivy-completing-read-handlers-alist (delete - (assq 'tramp-rename-files ivy-completing-read-handlers-alist) + (assq #'tramp-rename-files ivy-completing-read-handlers-alist) ivy-completing-read-handlers-alist))))) ;;; Integration of info-look.el: diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index f24d0effe7..29ed944b8b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1843,7 +1843,7 @@ ID-FORMAT valid values are `string' and `integer'." 'copy filename newname ok-if-already-exists keep-date preserve-uid-gid preserve-extended-attributes) (tramp-run-real-handler - 'copy-file + #'copy-file (list filename newname ok-if-already-exists keep-date preserve-uid-gid preserve-extended-attributes)))) @@ -1884,7 +1884,7 @@ ID-FORMAT valid values are `string' and `integer'." ;; We must do it file-wise. (tramp-run-real-handler - 'copy-directory + #'copy-directory (list dirname newname keep-date parents copy-contents))) ;; When newname did exist, we have wrong cached values. diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 66737e61da..d6417094ba 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -650,7 +650,7 @@ component is used as the target of the symlink." 'rename filename newname ok-if-already-exists 'keep-date 'preserve-uid-gid) (tramp-run-real-handler - 'rename-file (list filename newname ok-if-already-exists)))) + #'rename-file (list filename newname ok-if-already-exists)))) (defun tramp-sudoedit-handle-set-file-acl (filename acl-string) "Like `set-file-acl' for Tramp files." diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 62df2890cb..4fd7a322d4 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2631,6 +2631,8 @@ Falls back to normal file name handler if no Tramp file name handler exists." ;; might be an older, incompatible version active. We try to ;; overload this. (let ((default-directory temporary-file-directory)) + (when (bound-and-true-p tramp-archive-autoload) + (load "tramp-archive" 'noerror 'nomessage)) (load "tramp" 'noerror 'nomessage))) (apply operation args))) @@ -2642,7 +2644,7 @@ Falls back to normal file name handler if no Tramp file name handler exists." "Add Tramp file name handlers to `file-name-handler-alist' during autoload." (add-to-list 'file-name-handler-alist (cons tramp-autoload-file-name-regexp - 'tramp-autoload-file-name-handler)) + #'tramp-autoload-file-name-handler)) (put #'tramp-autoload-file-name-handler 'safe-magic t))) ;;;###autoload (tramp-register-autoload-file-name-handlers) @@ -2854,7 +2856,7 @@ not in completion mode." result1 (ignore-errors (tramp-run-real-handler - 'file-name-all-completions (list filename directory)))))) + #'file-name-all-completions (list filename directory)))))) ;; Method, host name and user name completion for a file. (defun tramp-completion-handle-file-name-completion @@ -3275,7 +3277,7 @@ User is always nil." (tramp-compat-file-missing (tramp-dissect-file-name directory) directory)) ;; We must do it file-wise. (tramp-run-real-handler - 'copy-directory + #'copy-directory (list directory newname keep-date parents copy-contents))) (defun tramp-handle-directory-file-name (directory) diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 6a6b56f4a1..773bc8f459 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el @@ -887,27 +887,35 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." ;; tramp-archive is neither loaded at Emacs startup, nor when ;; loading a file like "/mock::foo" (which loads Tramp). - (let ((default-directory (expand-file-name temporary-file-directory)) - (code + (let ((code "(progn \ - (message \"tramp-archive loaded: %%s %%s\" \ - (featurep 'tramp) (featurep 'tramp-archive)) \ + (message \"tramp-archive loaded: %%s\" \ + (featurep 'tramp-archive)) \ (file-attributes %S \"/\") \ - (message \"tramp-archive loaded: %%s %%s\" \ - (featurep 'tramp) (featurep 'tramp-archive)))")) - (dolist (file `("/mock::foo" ,(concat tramp-archive-test-archive "foo"))) - (should - (string-match - (format - "tramp-archive loaded: nil nil[[:ascii:]]+tramp-archive loaded: t %s" - (tramp-archive-file-name-p file)) - (shell-command-to-string - (format - "%s -batch -Q -L %s --eval %s" - (shell-quote-argument - (expand-file-name invocation-name invocation-directory)) - (mapconcat #'shell-quote-argument load-path " -L ") - (shell-quote-argument (format code file))))))))) + (message \"tramp-archive loaded: %%s\" \ + (featurep 'tramp-archive)))")) + (dolist (default-directory + `(,temporary-file-directory + ;; Starting Emacs in a directory which has + ;; `tramp-archive-file-name-regexp' syntax is + ;; supported only with Emacs > 27.2 (sigh!). + ;; (Bug#48476) + ,(file-name-as-directory tramp-archive-test-directory))) + (dolist (file `("/mock::foo" ,(concat tramp-archive-test-archive "foo"))) + (should + (string-match + (format + "tramp-archive loaded: %s[[:ascii:]]+tramp-archive loaded: %s" + (tramp-archive-file-name-p default-directory) + (or (tramp-archive-file-name-p default-directory) + (tramp-archive-file-name-p file))) + (shell-command-to-string + (format + "%s -batch -Q -L %s --eval %s" + (shell-quote-argument + (expand-file-name invocation-name invocation-directory)) + (mapconcat #'shell-quote-argument load-path " -L ") + (shell-quote-argument (format code file)))))))))) (ert-deftest tramp-archive-test45-delay-load () "Check that `tramp-archive' is loaded lazily, only when needed." commit 84e207c81187ff46fb94775ccb24d9b76b80db9c Author: Stefan Monnier Date: Sat May 22 10:21:59 2021 -0400 * lisp/emacs-lisp/subr-x.el (if-let*, if-let): Use looser Edebug spec This makes the same spec work both for `if-let` and `when-let`. (when-let*, and-let*, when-let): Simplify accordingly. diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 72406df0ff..1c13c398dd 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -127,7 +127,7 @@ This is like `if-let' but doesn't handle a VARLIST of the form \(SYMBOL SOMETHING) specially." (declare (indent 2) (debug ((&rest [&or symbolp (symbolp form) (form)]) - form body))) + body))) (if varlist `(let* ,(setq varlist (internal--build-bindings varlist)) (if ,(caar (last varlist)) @@ -139,18 +139,14 @@ This is like `if-let' but doesn't handle a VARLIST of the form "Bind variables according to VARLIST and conditionally evaluate BODY. This is like `when-let' but doesn't handle a VARLIST of the form \(SYMBOL SOMETHING) specially." - (declare (indent 1) - (debug ((&rest [&or symbolp (symbolp form) (form)]) - body))) + (declare (indent 1) (debug if-let*)) (list 'if-let* varlist (macroexp-progn body))) (defmacro and-let* (varlist &rest body) "Bind variables according to VARLIST and conditionally evaluate BODY. Like `when-let*', except if BODY is empty and all the bindings are non-nil, then the result is non-nil." - (declare (indent 1) - (debug ((&rest [&or symbolp (symbolp form) (form)]) - body))) + (declare (indent 1) (debug if-let*)) (let (res) (if varlist `(let* ,(setq varlist (internal--build-bindings varlist)) @@ -178,7 +174,7 @@ with an old syntax that accepted only one binding." (declare (indent 2) (debug ([&or (symbolp form) ; must be first, Bug#48489 (&rest [&or symbolp (symbolp form) (form)])] - form body))) + body))) (when (and (<= (length spec) 2) (not (listp (car spec)))) ;; Adjust the single binding case @@ -192,10 +188,7 @@ Evaluate each binding in turn, stopping if a binding value is nil. If all are non-nil, return the value of the last form in BODY. The variable list SPEC is the same as in `if-let'." - (declare (indent 1) - (debug ([&or (symbolp form) ; must be first, Bug#48489 - (&rest [&or symbolp (symbolp form) (form)])] - body))) + (declare (indent 1) (debug if-let)) (list 'if-let spec (macroexp-progn body))) (defsubst hash-table-empty-p (hash-table) commit 43fd13770a8ac8452669e4de3281e9189cb36c5a Author: Basil L. Contovounesios Date: Sat May 22 13:22:29 2021 +0100 Fix native-comp-async-report-warnings-errors :type * doc/lispref/compile.texi (Native-Compilation Variables): Document 'silent' alternative of native-comp-async-report-warnings-errors. * lisp/emacs-lisp/comp.el (native-comp-async-report-warnings-errors): Fix quoting in :type expression (bug#48586). diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index ee31b17af7..f48f4f47e8 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -1028,7 +1028,10 @@ execution unit. @defopt native-comp-async-report-warnings-errors If this variable's value is non-@code{nil}, warnings and errors from asynchronous native-compilation subprocesses are reported in the main -Emacs session. The default is @code{t}. +Emacs session in a buffer named @file{*Warnings*}. The default value +@code{t} means display the resulting buffer. To log warnings without +popping up the @file{*Warnings*} buffer, set this variable to +@code{silent}. @end defopt @defopt native-comp-async-query-on-exit diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 8c638312b0..b09739cb92 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -154,7 +154,7 @@ buffer." :type '(choice (const :tag "Do not report warnings" nil) (const :tag "Report and display warnings" t) - (const :tag "Report but do not display warnings" 'silent)) + (const :tag "Report but do not display warnings" silent)) :version "28.1") (defcustom native-comp-async-query-on-exit nil commit 33a52cb45832d4041b6f0db78ee289ba9aca0f64 Author: Philipp Stephani Date: Sat May 22 13:29:50 2021 +0200 Give 'when-let' and 'when-let*' their own Edebug specification. The Edebug specification of 'if-let' and 'if-let*' doesn't work if the body is empty. While that's a pathological case, it's not wrong per se, and could arguably happen due to macro expansion. * lisp/emacs-lisp/subr-x.el (when-let*, when-let): Don't reuse Edebug specification from 'if-let*' and 'if-let'. diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index fb890509ad..72406df0ff 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -139,7 +139,9 @@ This is like `if-let' but doesn't handle a VARLIST of the form "Bind variables according to VARLIST and conditionally evaluate BODY. This is like `when-let' but doesn't handle a VARLIST of the form \(SYMBOL SOMETHING) specially." - (declare (indent 1) (debug if-let*)) + (declare (indent 1) + (debug ((&rest [&or symbolp (symbolp form) (form)]) + body))) (list 'if-let* varlist (macroexp-progn body))) (defmacro and-let* (varlist &rest body) @@ -190,7 +192,10 @@ Evaluate each binding in turn, stopping if a binding value is nil. If all are non-nil, return the value of the last form in BODY. The variable list SPEC is the same as in `if-let'." - (declare (indent 1) (debug if-let)) + (declare (indent 1) + (debug ([&or (symbolp form) ; must be first, Bug#48489 + (&rest [&or symbolp (symbolp form) (form)])] + body))) (list 'if-let spec (macroexp-progn body))) (defsubst hash-table-empty-p (hash-table) commit 91fa95bde0619b4f3bc7d93d06c7c75998b1588d Author: Philipp Stephani Date: Sat May 22 13:17:00 2021 +0200 * lisp/emacs-lisp/cl-macs.el (cl-loop): Add missing 'when' to spec diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 283c5e4a74..a59d42e673 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -941,7 +941,8 @@ For more details, see Info node `(cl)Loop Facility'. "above" "below" "by" "in" "on" "=" "across" "repeat" "while" "until" "always" "never" "thereis" "collect" "append" "nconc" "sum" - "count" "maximize" "minimize" "if" "unless" + "count" "maximize" "minimize" + "if" "when" "unless" "return"] form] ["using" (symbolp symbolp)] commit 30e5d93ee1b938c207c4f5ec015ba2633cf423cd (refs/remotes/origin/emacs-27) Author: Eli Zaretskii Date: Fri May 21 09:51:17 2021 +0300 Improve documentation of display tables * doc/lispref/display.texi (Display Tables): Add a cross-reference to the next section. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index fed1762e30..5290a04337 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -7481,7 +7481,7 @@ Chars}. The above display conventions apply even when there is a display table, for any character whose entry in the active display table is @code{nil}. Thus, when you set up a display table, you need only -specify the characters for which you want special behavior. +specify the characters for which you want special display behavior. The following variables affect how certain characters are displayed on the screen. Since they change the number of columns the characters @@ -7515,7 +7515,8 @@ command @code{tab-to-tab-stop}. @xref{Indent Tabs}. (@pxref{Char-Tables}), with @code{display-table} as its subtype, which is used to override the usual character display conventions. This section describes how to make, inspect, and assign elements to a -display table object. +display table object. The next section (@pxref{Active Display Table}) +describes the various standard display tables and their precedence. @defun make-display-table This creates and returns a display table. The table initially has commit 8804ac857b3290852d8889e274186b20e906afdc Author: Eli Zaretskii Date: Fri May 21 09:37:47 2021 +0300 * src/buffer.c (syms_of_buffer) : Doc fix. (Bug#48539) diff --git a/src/buffer.c b/src/buffer.c index 60a45731d1..0772688361 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5647,10 +5647,10 @@ inserts one or more TAB characters, this variable will affect the indentation step as well, even if `indent-tabs-mode' is non-nil. */); DEFVAR_PER_BUFFER ("ctl-arrow", &BVAR (current_buffer, ctl_arrow), Qnil, - doc: /* Non-nil means display control chars with uparrow. -A value of nil means use backslash and octal digits. -This variable does not apply to characters whose display is specified -in the current display table (if there is one). */); + doc: /* Non-nil means display control chars with uparrow `^'. +A value of nil means use backslash `\\' and octal digits. +This variable does not apply to characters whose display is specified in +the current display table (if there is one; see `standard-display-table'). */); DEFVAR_PER_BUFFER ("enable-multibyte-characters", &BVAR (current_buffer, enable_multibyte_characters),