commit 279a7d950ffff1b4f4a420848502a018b3998ee1 (HEAD, refs/remotes/origin/master) Author: Stefan Kangas Date: Fri Jan 3 07:50:07 2025 +0100 Improve temporary file handling in browse-url * lisp/net/browse-url.el (browse-url-delete-temp-file): Don't add to kill-buffer-hook on top level. (browse-url--temp-file-setup): New macro to set 'kill-buffer-hook' buffer-locally to above function when creating a temporary file. Use stricter permissions to protect user privacy on multi-user systems. (browse-url-of-file, browse-url-of-buffer): Use above new macro. (browse-url-delete-temp-file): Simplify calling convention by removing unused argument. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 8d733deaddd..cf927d76b2b 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -731,6 +731,13 @@ instead." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Browse current buffer +(defmacro browse-url--temp-file-setup (&rest body) + (declare (indent defun)) + `(progn + (add-hook 'kill-buffer-hook #'browse-url-delete-temp-file nil t) + (with-file-modes #o600 + ,@body))) + ;;;###autoload (defun browse-url-of-file (&optional file) "Use a web browser to display FILE. @@ -750,8 +757,9 @@ interactively. Turn the filename into a URL with function (t (message "%s modified since last save" file)))))) (when (and (file-remote-p file) (not browse-url-temp-file-name)) - (setq browse-url-temp-file-name (file-local-copy file) - file browse-url-temp-file-name)) + (browse-url--temp-file-setup + (setq browse-url-temp-file-name (file-local-copy file) + file browse-url-temp-file-name))) (browse-url (browse-url-file-url file)) (run-hooks 'browse-url-of-file-hook)) @@ -812,25 +820,24 @@ narrowed." ;; This can happen when we're looking at a file from a ;; zip file buffer, for instance. (not (file-exists-p file-name))) - (unless browse-url-temp-file-name - (setq browse-url-temp-file-name - (convert-standard-filename - (make-temp-file - (expand-file-name "burl" browse-url-temp-dir) - nil ".html")))) - (setq file-name browse-url-temp-file-name) - (write-region (point-min) (point-max) file-name nil 'no-message)) + (browse-url--temp-file-setup + (unless browse-url-temp-file-name + (setq browse-url-temp-file-name + (convert-standard-filename + (make-temp-file + (expand-file-name "burl" browse-url-temp-dir) + nil ".html")))) + (setq file-name browse-url-temp-file-name) + (write-region (point-min) (point-max) file-name nil 'no-message))) (browse-url-of-file file-name)))) (defun browse-url-delete-temp-file (&optional temp-file-name) - "Delete `browse-url-temp-file-name' from the file system. -If optional arg TEMP-FILE-NAME is non-nil, delete it instead." + "Delete `browse-url-temp-file-name' from the file system." + (declare (advertised-calling-convention () "31.1")) (let ((file-name (or temp-file-name browse-url-temp-file-name))) (if (and file-name (file-exists-p file-name)) (delete-file file-name)))) -(add-hook 'kill-buffer-hook #'browse-url-delete-temp-file) - (declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep)) commit b683280f87bb039a7fcf41d03cf1766e980fa378 Author: Po Lu Date: Fri Jan 3 13:04:05 2025 +0800 ; * exec/configure.ac (config-mips.m4): Fix typo. diff --git a/exec/configure.ac b/exec/configure.ac index 86e716690c1..d91049b8d7b 100644 --- a/exec/configure.ac +++ b/exec/configure.ac @@ -559,7 +559,7 @@ AC_SUBST([FIND_DELETE]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile]) AS_IF([test "x$is_mips" = xyes], - [AC_CONFIG_FILES ([config-mips.m4])]) + [AC_CONFIG_FILES([config-mips.m4])]) AC_SUBST([AUTO_DEPEND]) AC_SUBST([LOADERFLAGS]) commit 597161fe1e4a62bd8a2c7b80b7219529ec5bc16d Author: Stefan Kangas Date: Fri Jan 3 04:08:44 2025 +0100 Remove gnudoit support from browse-url.el * lisp/net/browse-url.el (browse-url-gnudoit-program) (browse-url-gnudoit-args, browse-url-w3-gnudoit): Remove support for gnudoit, obsolete since Emacs 25.1. diff --git a/etc/NEWS b/etc/NEWS index dd912306757..f7e9f283709 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -327,12 +327,6 @@ a web browser to load them. For example, it could be used like this: For better integration with the Qutebrowser, set 'browse-url(-secondary)-browser-function' to 'browse-url-qutebrowser'. -*** Support for the Conkeror web browser has been removed. -It has been obsolete since Emacs 28.1. - -*** Support for gnome-moz-remote has been removed. -It has been obsolete since Emacs 25.1. - *** New GTK-native launch mode For better Wayland support, the pgtk toolkit exposes a new 'x-gtk-launch-uri' browse-url handler and uses it by default when URLs @@ -340,6 +334,10 @@ are browsed from a PGTK frame. For other frames, we fall back to the default URL launch function. This change allows us to properly raise browser windows under Wayland using the xdg_activation_v1 protocol. +*** Removed support for some obsolete web browsers. +Conkeror (obsolete since Emacs 28.1), gnome-moz-remote (obsolete since +Emacs 25.1), and gnudoit (obsolete since Emacs 25.1). + ** CL-Lib +++ diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 1c8019f6152..8d733deaddd 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -467,17 +467,6 @@ This might, for instance, be a separate color version of xterm." These might set its size, for instance." :type '(repeat (string :tag "Argument"))) -(defcustom browse-url-gnudoit-program "gnudoit" - "The name of the `gnudoit' program used by `browse-url-w3-gnudoit'." - :type 'string) -(make-obsolete-variable 'browse-url-gnudoit-program nil "29.1") - -(defcustom browse-url-gnudoit-args '("-q") - "A list of strings defining options for `browse-url-gnudoit-program'. -These might set the port, for instance." - :type '(repeat (string :tag "Argument"))) -(make-obsolete-variable 'browse-url-gnudoit-args nil "29.1") - (defcustom browse-url-generic-program nil "The name of the browser program used by `browse-url-generic'." :type '(choice string (const :tag "None" nil))) @@ -1503,21 +1492,6 @@ used instead of `browse-url-new-window-flag'." (function-put 'browse-url-w3 'browse-url-browser-kind 'internal) -;;;###autoload -(defun browse-url-w3-gnudoit (url &optional _new-window) - "Ask another Emacs running emacsclient to load the URL using the W3 browser. -The `browse-url-gnudoit-program' program is used with options given by -`browse-url-gnudoit-args'. Default to the URL around or before point." - (declare (obsolete nil "25.1")) - (interactive (browse-url-interactive-arg "W3 URL: ")) - (apply #'start-process (concat "gnudoit:" url) nil - browse-url-gnudoit-program - (append browse-url-gnudoit-args - (list (concat "(w3-fetch \"" url "\")") - "(raise-frame)")))) - -(function-put 'browse-url-w3-gnudoit 'browse-url-browser-kind 'internal) - ;; --- Lynx in an xterm --- ;;;###autoload commit 004a48b3d46af169cbc1c9a690de7ad71483862c Author: Stefan Kangas Date: Fri Jan 3 03:12:37 2025 +0100 Re-enable caching for 'M-x man' completion on macOS On macOS, getting the completion results when you type 'M-x man RET' can take up to several seconds, even on a reasonably modern MacBook Pro, probably due to the lack of man-db and the need to process the output. Caching of "man -k ^" completion results was added in 2009 due to perceived slowness on some systems, but was unfortunately effectively disabled again in 2013. Let's re-enable it on macOS. * lisp/man.el (Man-cache-completion-results-flag): New variable set to t by default on macOS, and nil elsewhere. (man): Cache completion results when above new variable is t. diff --git a/lisp/man.el b/lisp/man.el index b255d50250b..f8067182546 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -135,6 +135,11 @@ the manpage buffer." "Non-nil means make up the manpage with fonts." :type 'boolean) +(defvar Man-cache-completion-results-flag (eq system-type 'darwin) + "Non-nil means cache completion results for `man'. +This is non-nil by default on macOS, because getting and filtering +\"man -k ^\" results is slower there than on GNU/Linux.") + (defvar Man-ansi-color-basic-faces-vector [nil Man-overstrike nil Man-underline Man-underline nil nil Man-reverse] "The value used here for `ansi-color-basic-faces-vector'.") @@ -1120,13 +1125,17 @@ for the current invocation." ;; ("man -k" is case-insensitive similarly, so the ;; table has everything available to complete) (completion-ignore-case t) - Man-completion-cache ;Don't cache across calls. - (input (completing-read - (format-prompt "Manual entry" - (and (not (equal default-entry "")) - default-entry)) - 'Man-completion-table - nil nil nil 'Man-topic-history default-entry))) + (input + (cl-flet ((read () + (completing-read + (format-prompt "Manual entry" + (and (not (equal default-entry "")) + default-entry)) + #'Man-completion-table + nil nil nil 'Man-topic-history default-entry))) + (if Man-cache-completion-results-flag + (read) + (let ((Man-completion-cache)) (read)))))) (if (string= input "") (error "No man args given") input)))) commit 58c95e9bab21b313661503f0499f14e1e0ad038d Author: Stefan Kangas Date: Thu Jan 2 21:33:52 2025 +0100 New defgroup man-faces * lisp/man.el: Delete redundant option :group specifiers. (man-imenu-title): New defgroup. (Man-overstrike, Man-underline, Man-reverse): Add faces to above new defgroup. diff --git a/lisp/man.el b/lisp/man.el index 576c24c74c0..b255d50250b 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -102,7 +102,6 @@ When this is non-nil, call the \"man\" program synchronously (rather than asynchronously, which is the default behavior)." :type 'boolean - :group 'man :version "30.1") (defcustom Man-support-remote-systems nil @@ -125,8 +124,7 @@ commands appear in the association list. The final output is placed in the manpage buffer." :type '(repeat (list (string :tag "Command String") (repeat :inline t - (string :tag "Phrase String")))) - :group 'man) + (string :tag "Phrase String"))))) (defvar Man-uses-untabify-flag t "Non-nil means use `untabify' instead of `Man-untabify-command'.") @@ -135,26 +133,7 @@ the manpage buffer." (defcustom Man-fontify-manpage-flag t "Non-nil means make up the manpage with fonts." - :type 'boolean - :group 'man) - -(defface Man-overstrike - '((t (:inherit bold))) - "Face to use when fontifying overstrike." - :group 'man - :version "24.3") - -(defface Man-underline - '((t (:inherit underline))) - "Face to use when fontifying underlining." - :group 'man - :version "24.3") - -(defface Man-reverse - '((t (:inherit highlight))) - "Face to use when fontifying reverse video." - :group 'man - :version "24.3") + :type 'boolean) (defvar Man-ansi-color-basic-faces-vector [nil Man-overstrike nil Man-underline Man-underline nil nil Man-reverse] @@ -191,8 +170,7 @@ meek -- make no indication that the manpage is ready Any other value of `Man-notify-method' is equivalent to `meek'." :type '(radio (const newframe) (const pushy) (const bully) (const aggressive) (const friendly) (const thrifty) - (const polite) (const quiet) (const meek)) - :group 'man) + (const polite) (const quiet) (const meek))) (defcustom Man-width nil "Number of columns for which manual pages should be formatted. @@ -201,8 +179,7 @@ If non-nil, use the width of the frame where the manpage is displayed. The value also can be a positive integer for a fixed width." :type '(choice (const :tag "Window width" nil) (const :tag "Frame width" t) - (integer :tag "Fixed width" :value 65)) - :group 'man) + (integer :tag "Fixed width" :value 65))) (defcustom Man-width-max 80 "Maximum number of columns allowed for the width of manual pages. @@ -213,15 +190,13 @@ it will be automatically reduced to the width defined by this variable. When nil, there is no limit on maximum width." :type '(choice (const :tag "No limit" nil) (integer :tag "Max width" :value 80)) - :version "27.1" - :group 'man) + :version "27.1") (defcustom Man-frame-parameters nil "Frame parameter list for creating a new frame for a manual page." :type '(repeat (cons :format "%v" (symbol :tag "Parameter") - (sexp :tag "Value"))) - :group 'man) + (sexp :tag "Value")))) (defcustom Man-downcase-section-letters-flag t "Non-nil means letters in sections are converted to lower case. @@ -230,13 +205,11 @@ example \"man 2V chmod\", but they are often displayed in the manpage with the upper case letter. When this variable is t, the section letter (e.g., \"2V\") is converted to lowercase (e.g., \"2v\") before being sent to the man background process." - :type 'boolean - :group 'man) + :type 'boolean) (defcustom Man-circular-pages-flag t "Non-nil means the manpage list is treated as circular for traversal." - :type 'boolean - :group 'man) + :type 'boolean) (defcustom Man-section-translations-alist (list @@ -251,8 +224,7 @@ their references which Un*x `man' does not recognize. This association list is used to translate those sections, when found, to the associated section number." :type '(repeat (cons (string :tag "Bogus Section") - (string :tag "Real Section"))) - :group 'man) + (string :tag "Real Section")))) ;; FIXME see comments at ffap-c-path. (defcustom Man-header-file-path @@ -268,8 +240,7 @@ the associated section number." (append base (list (expand-file-name arch "/usr/include"))))) "C Header file search path used in Man." :version "24.1" ; add multiarch - :type '(repeat string) - :group 'man) + :type '(repeat string)) (defcustom Man-name-local-regexp (concat "^" (regexp-opt '("NOM" "NAME")) "$") "Regexp that matches the text that precedes the command's name. @@ -279,28 +250,23 @@ Used in `bookmark-set' to get the default bookmark name." (defcustom manual-program "man" "Program used by `man' to produce man pages." - :type 'string - :group 'man) + :type 'string) (defcustom Man-untabify-command "pr" "Program used by `man' for untabifying." - :type 'string - :group 'man) + :type 'string) (defcustom Man-untabify-command-args (list "-t" "-e") "List of arguments to be passed to `Man-untabify-command' (which see)." - :type '(repeat string) - :group 'man) + :type '(repeat string)) (defcustom Man-sed-command "sed" "Program used by `man' to process sed scripts." - :type 'string - :group 'man) + :type 'string) (defcustom Man-awk-command "awk" "Program used by `man' to process awk scripts." - :type 'string - :group 'man) + :type 'string) ;; This is for people who have UTF-8 encoded man pages in non-UTF-8 ;; locales, or who use Cygwin 'man' command from a native MS-Windows @@ -309,18 +275,15 @@ Used in `bookmark-set' to get the default bookmark name." "Coding-system to decode output from the commands run by `man'. If this is nil, `man' will use `locale-coding-system'." :type 'coding-system - :group 'man :version "26.1") (defcustom Man-mode-hook nil "Hook run when Man mode is enabled." - :type 'hook - :group 'man) + :type 'hook) (defcustom Man-cooked-hook nil "Hook run after removing backspaces but before `Man-mode' processing." - :type 'hook - :group 'man) + :type 'hook) (defvar Man-name-regexp "[-[:alnum:]_­+[@][-[:alnum:]_.:­+]*" "Regular expression describing the name of a manpage (without section).") @@ -399,8 +362,7 @@ This regexp should not start with a `^' character.") "Switches passed to the man command, as a single string. For example, the -a switch lets you see all the manpages for a specified subject, if your `man' program supports it." - :type 'string - :group 'man) + :type 'string) (defvar Man-specified-section-option (if (string-match "-solaris[0-9.]*$" system-configuration) @@ -417,9 +379,34 @@ Otherwise, the value is whatever the function (defcustom man-imenu-title "Contents" "The title to use if man adds a Contents menu to the menubar." :version "24.4" - :type 'string + :type 'string) + + +;; faces + +(defgroup man-faces nil + "Man mode faces, used by \\[man]." + :prefix "Man-" :group 'man) +(defface Man-overstrike + '((t (:inherit bold))) + "Face to use when fontifying overstrike." + :group 'man-faces + :version "24.3") + +(defface Man-underline + '((t (:inherit underline))) + "Face to use when fontifying underlining." + :group 'man-faces + :version "24.3") + +(defface Man-reverse + '((t (:inherit highlight))) + "Face to use when fontifying reverse video." + :group 'man-faces + :version "24.3") + ;; other variables and keymap initializations (defvar-local Man-original-frame nil) commit ca79916179ffb5ddc801e1ccb12c5ff72f6516d8 Author: Stefan Kangas Date: Thu Jan 2 20:19:24 2025 +0100 Respect 'manual-program' variable * lisp/man.el (Man-man-k-flags): Respect 'manual-program' variable. diff --git a/lisp/man.el b/lisp/man.el index 58a0234bc83..576c24c74c0 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -978,14 +978,15 @@ foo(sec)[, bar(sec) [, ...]] [other stuff] - description" ;; seems like the safest choice, but `man -k apropos' seems almost as safe ;; and usually returns a much shorter output. (with-temp-buffer - (with-demoted-errors "%S" (call-process "man" nil t nil "-k" "apropos")) + (with-demoted-errors "%S" + (call-process manual-program nil t nil "-k" "apropos")) (let ((lines (count-lines (point-min) (point-max))) (completions (Man-parse-man-k))) (if (>= (length completions) lines) '("-k") ;; "-k" seems to return sane results: look no further! (erase-buffer) ;; Try "-k -l" (bug#73656). - (with-demoted-errors "%S" (call-process "man" nil t nil + (with-demoted-errors "%S" (call-process manual-program nil t nil "-k" "-l" "apropos")) (let ((lines (count-lines (point-min) (point-max))) (completions (Man-parse-man-k))) commit 8f81c2b02ff98a69c7c5025881063ae85ee5b1d3 Author: Stefan Monnier Date: Thu Jan 2 14:58:10 2025 -0500 (describe-variable): Fix bug#73872 * lisp/help-fns.el (describe-variable): Put a `syntax-table` property on the printed value for better navigation. Remove `set-syntax-table` since `lisp-data-mode` already did it. (describe-variable): Remove `set-syntax-table`, not needed any more. * lisp/help-mode.el (help-mode-syntax-table): `;` shouldn't start a comment. (help-make-xrefs): Use `with-syntax-table`. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 6c67c5c36be..9324cf85454 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1445,21 +1445,29 @@ it is displayed along with the global value." (format-message "`%s'" rep) rep))) (start (point))) - (if (< (+ (length print-rep) (point) (- line-beg)) 68) - (insert " " print-rep) - (terpri) - (let ((buf (current-buffer))) - (with-temp-buffer - (lisp-data-mode) - (set-syntax-table emacs-lisp-mode-syntax-table) - (insert print-rep) - (pp-buffer) - (font-lock-ensure) - (let ((pp-buffer (current-buffer))) - (with-current-buffer buf - (insert-buffer-substring pp-buffer))))) - ;; Remove trailing newline. - (and (= (char-before) ?\n) (delete-char -1))) + (let (beg) + (if (< (+ (length print-rep) (point) (- line-beg)) 68) + (progn + (setq beg (1+ (point))) + (insert " " print-rep)) + (terpri) + (setq beg (point)) + (let ((buf (current-buffer))) + (with-temp-buffer + (lisp-data-mode) + (insert print-rep) + (pp-buffer) + (font-lock-ensure) + (let ((pp-buffer (current-buffer))) + (with-current-buffer buf + (insert-buffer-substring pp-buffer)))))) + ;; Remove trailing newline. + (and (= (char-before) ?\n) (delete-char -1)) + ;; Put a `syntax-table' property on the data, as + ;; a kind of poor man's multi-major-mode support here. + (put-text-property beg (point) + 'syntax-table + lisp-data-mode-syntax-table)) (help-fns--editable-variable start (point) variable val buffer) (let* ((sv (get variable 'standard-value)) @@ -1523,10 +1531,6 @@ it is displayed along with the global value." ;; If the value is large, move it to the end. (with-current-buffer standard-output (when (> (count-lines (point-min) (point-max)) 10) - ;; Note that setting the syntax table like below - ;; makes forward-sexp move over a `'s' at the end - ;; of a symbol. - (set-syntax-table emacs-lisp-mode-syntax-table) (goto-char val-start-pos) (when (looking-at "value is") (replace-match "")) (save-excursion diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 2c1ea9feeaf..f57ec02da4e 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -143,6 +143,8 @@ The format is (FUNCTION ARGS...).") ;; break when a quoted string contains punctuation. (modify-syntax-entry ?‘ "(’ " table) (modify-syntax-entry ?’ ")‘ " table) + ;; `;' doesn't start a comment. + (modify-syntax-entry ?\; "." table) table) "Syntax table used in `help-mode'.") @@ -587,99 +589,95 @@ that." ;; Skip the first bit, which has already been buttonized. (forward-paragraph) (let ((old-modified (buffer-modified-p))) - (let ((stab (syntax-table)) - (case-fold-search t) + (let ((case-fold-search t) (inhibit-read-only t)) - (set-syntax-table help-mode-syntax-table) - ;; The following should probably be abstracted out. - (unwind-protect - (progn - ;; Info references + (with-syntax-table help-mode-syntax-table + ;; The following should probably be abstracted out. + ;; Info references + (save-excursion + (while (re-search-forward help-xref-info-regexp nil t) + (let ((data (match-string 2))) + (save-match-data + (unless (string-match "^([^)]+)" data) + (setq data (concat "(emacs)" data))) + (setq data ;; possible newlines if para filled + (replace-regexp-in-string "[ \t\n]+" " " data t t))) + (help-xref-button 2 'help-info data)))) + ;; Man references + (save-excursion + (while (re-search-forward help-xref-man-regexp nil t) + (help-xref-button 1 'help-man (match-string 1)))) + ;; Customization groups. + (save-excursion + (while (re-search-forward + help-xref-customization-group-regexp nil t) + (help-xref-button 1 'help-customization-group + (intern (match-string 1))))) + ;; URLs + (save-excursion + (while (re-search-forward help-xref-url-regexp nil t) + (let ((data (match-string 1))) + (help-xref-button 1 'help-url data)))) + ;; Mule related keywords. Do this before trying + ;; `help-xref-symbol-regexp' because some of Mule + ;; keywords have variable or function definitions. + (if help-xref-mule-regexp (save-excursion - (while (re-search-forward help-xref-info-regexp nil t) - (let ((data (match-string 2))) - (save-match-data - (unless (string-match "^([^)]+)" data) - (setq data (concat "(emacs)" data))) - (setq data ;; possible newlines if para filled - (replace-regexp-in-string "[ \t\n]+" " " data t t))) - (help-xref-button 2 'help-info data)))) - ;; Man references - (save-excursion - (while (re-search-forward help-xref-man-regexp nil t) - (help-xref-button 1 'help-man (match-string 1)))) - ;; Customization groups. - (save-excursion - (while (re-search-forward - help-xref-customization-group-regexp nil t) - (help-xref-button 1 'help-customization-group - (intern (match-string 1))))) - ;; URLs - (save-excursion - (while (re-search-forward help-xref-url-regexp nil t) - (let ((data (match-string 1))) - (help-xref-button 1 'help-url data)))) - ;; Mule related keywords. Do this before trying - ;; `help-xref-symbol-regexp' because some of Mule - ;; keywords have variable or function definitions. - (if help-xref-mule-regexp - (save-excursion - (while (re-search-forward help-xref-mule-regexp nil t) - (let* ((data (match-string 7)) - (sym (intern-soft data))) - (cond - ((match-string 3) ; coding system - (and sym (coding-system-p sym) - (help-xref-button 6 'help-coding-system sym))) - ((match-string 4) ; input method - (and (assoc data input-method-alist) - (help-xref-button 7 'help-input-method data))) - ((or (match-string 5) (match-string 6)) ; charset - (and sym (charsetp sym) - (help-xref-button 7 'help-character-set sym))) - ((assoc data input-method-alist) - (help-xref-button 7 'help-input-method data)) - ((and sym (coding-system-p sym)) - (help-xref-button 7 'help-coding-system sym)) - ((and sym (charsetp sym)) - (help-xref-button 7 'help-character-set sym))))))) - ;; Quoted symbols - (save-excursion - (while (re-search-forward help-xref-symbol-regexp nil t) - (when-let* ((sym (intern-soft (match-string 9)))) - (if (match-string 8) - (delete-region (match-beginning 8) - (match-end 8)) - (cond - ((match-string 3) ; `variable' &c - (and (or (boundp sym) ; `variable' doesn't ensure - ; it's actually bound - (get sym 'variable-documentation)) - (help-xref-button 9 'help-variable sym))) - ((match-string 4) ; `function' &c - (and (fboundp sym) ; similarly - (help-xref-button 9 'help-function sym))) - ((match-string 5) ; `face' - (and (facep sym) - (help-xref-button 9 'help-face sym))) - ((match-string 6)) ; nothing for `symbol' - ((match-string 7) - (help-xref-button 9 'help-function-def sym)) - ((cl-some (lambda (x) (funcall (nth 1 x) sym)) - describe-symbol-backends) - (help-xref-button 9 'help-symbol sym))))))) - ;; An obvious case of a key substitution: - (save-excursion - (while (re-search-forward - ;; Assume command name is only word and symbol - ;; characters to get things like `use M-x foo->bar'. - ;; Command required to end with word constituent - ;; to avoid `.' at end of a sentence. - "\\bar'. + ;; Command required to end with word constituent + ;; to avoid `.' at end of a sentence. + "\\ Date: Thu Jan 2 11:29:26 2025 -0800 admin/merge-gnulib now warns if module lists change From suggestions by Eli Zaretski and Stefan Kangas in: https://lists.gnu.org/r/emacs-devel/2025-01/msg00036.html https://lists.gnu.org/r/emacs-devel/2025-01/msg00037.html * admin/merge-gnulib: For style consistency, prefer ‘[ EXPR ]’ to ‘test EXPR’ and prefer -e to -f. Fix bug that forgot to clean lib directory if it’s ./lib. Check for lib/gnulib.mk.in, which we used directly, not ‘configure’. (LC_ALL): Set to C. (autogen): New function, to make it clearer to user when commands are operating in some other directory. (get_module_list): New function. (old_modules, new_modules): New vars. If they differ, issue a warning. diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 458a2c325e3..2eab5ab8b9c 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -23,6 +23,9 @@ # written by Paul Eggert +# It is unclear whether module list sorting depends on locale; play it safe. +export LC_ALL=C + GNULIB_URL=https://git.savannah.gnu.org/git/gnulib.git GNULIB_MODULES=' @@ -92,22 +95,38 @@ case $src in exit 1 ;; esac -test -x "$src"autogen.sh || { +[ -x "$src"autogen.sh ] || { printf '%s\n' >&2 "$0: '${src:-.}' is not an Emacs source directory." exit 1 } -test -d "$gnulib_srcdir" || +[ -d "$gnulib_srcdir" ] || git clone -- "$GNULIB_URL" "$gnulib_srcdir" || exit -test -x "$gnulib_srcdir"/gnulib-tool || { +[ -x "$gnulib_srcdir"/gnulib-tool ] || { printf '%s\n' >&2 "$0: '$gnulib_srcdir' is not a Gnulib source directory." exit 1 } +autogen() { + if [ "$src" ]; then + printf "$0: entering $src ..." && + (cd "$src" && ./autogen.sh) && + printf "$0: leaving $src ..." + else + ./autogen.sh + fi +} + # gnulib-tool has problems with a bare checkout (Bug#32452#65). -test -f configure || ./autogen.sh || exit +# Also, we need gnulib.mk.in to get the old module list. +[ -e "$src"lib/gnulib.mk.in ] || autogen || exit + +get_module_list() { + sed -n 's/## begin gnulib module //p' "$src"lib/gnulib.mk.in +} +old_modules=$(get_module_list) || exit avoided_flags= for module in $AVOIDED_MODULES; do @@ -115,8 +134,8 @@ for module in $AVOIDED_MODULES; do done # Clean the lib directory as well. -if [ -e "$src"/lib/Makefile ]; then - make -C "$src"/lib maintainer-clean +if [ -e "$src"lib/Makefile ]; then + make -C "$src"lib maintainer-clean || exit fi "$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS \ @@ -140,5 +159,11 @@ cp -- "$gnulib_srcdir"/lib/af_alg.h \ "$src"lib && cp -- "$gnulib_srcdir"/m4/codeset.m4 \ "$src"m4 && -{ test -z "$src" || cd "$src"; } && -./autogen.sh +autogen && +new_modules=$(get_module_list) || exit + +test "$old_modules" = "$new_modules" || + printf >&2 '%s\n' \ + "$0: warning: module list changed; fix ../nt/gnulib-cfg.mk ..." \ + "$0: warning: ... or notify emacs-devel for w32 adaption." \ + "$0: warning: For more, run 'git diff ${src}lib/gnulib.mk.in'." commit fba3c7ff3f68f05d32541440e0a22ec667c0ad66 Author: Stefan Monnier Date: Thu Jan 2 14:29:49 2025 -0500 Prefer `%S` format over `%s` for non strings * lisp/reveal.el (reveal-open-new-overlays, reveal-close-old-overlays): * lisp/gnus/nnimap.el (nnimap-header-parameters) (nnimap-make-process-buffer): * lisp/gnus/nntp.el (nntp-make-process-buffer): * lisp/progmodes/flymake.el (flymake--disable-backend): * lisp/simple.el (next-error-internal): Prefer `%S` format over `%s` for non strings. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 2ad45935b19..b9c6586c03f 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -221,13 +221,13 @@ during splitting, which may be slow." (push "BODYSTRUCTURE" params) (push (format (if (nnimap-ver4-p) - "BODY.PEEK[HEADER.FIELDS %s]" - "RFC822.HEADER.LINES %s") + "BODY.PEEK[HEADER.FIELDS %S]" + "RFC822.HEADER.LINES %S") (append '(Subject From Date Message-Id References In-Reply-To Xref) nnmail-extra-headers)) params) - (format "%s" (nreverse params)))) + (format "(%s)" (mapconcat #'identity (nreverse params) " ")))) (defvar nnimap--max-retrieve-headers 200) @@ -386,7 +386,7 @@ during splitting, which may be slow." (defun nnimap-make-process-buffer (buffer) (with-current-buffer - (generate-new-buffer (format " *nnimap %s %s %s*" + (generate-new-buffer (format " *nnimap %s %s %S*" nnimap-address nnimap-server-port buffer)) (mm-disable-multibyte) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index a086421b049..aaa80e035ea 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -1189,7 +1189,7 @@ If SEND-IF-FORCE, only send authinfo to the server if the "Create a new, fresh buffer usable for nntp process connections." (with-current-buffer (generate-new-buffer - (format " *server %s %s %s*" + (format " *server %s %s %S*" nntp-address nntp-port-number buffer)) (gnus-add-buffer) (mm-disable-multibyte) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index ef4a7b25e2a..fa999dde142 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1236,7 +1236,7 @@ If MESSAGE-PREFIX, echo a message using that prefix." (defun flymake--disable-backend (backend &optional explanation) "Disable BACKEND because EXPLANATION. If it is running also stop it." - (flymake-log :warning "Disabling backend %s because %s" backend explanation) + (flymake-log :warning "Disabling backend %s because %S" backend explanation) (flymake--with-backend-state backend state (setf (flymake--state-running state) nil (flymake--state-disabled state) explanation diff --git a/lisp/reveal.el b/lisp/reveal.el index 44331c2abcd..46d5c94fd58 100644 --- a/lisp/reveal.el +++ b/lisp/reveal.el @@ -145,7 +145,7 @@ Each element has the form (WINDOW . OVERLAY).") (setq repeat t) (condition-case err (funcall open ol nil) - (error (message "!!Reveal-show (funcall %s %s nil): %s !!" + (error (message "!!Reveal-show (funcall %S %S nil): %S !!" open ol err) ;; Let's default to a meaningful behavior to avoid ;; getting stuck in an infinite loop. @@ -189,7 +189,7 @@ Each element has the form (WINDOW . OVERLAY).") open) (condition-case err (funcall open ol t) - (error (message "!!Reveal-hide (funcall %s %s t): %s !!" + (error (message "!!Reveal-hide (funcall %S %S t): %S !!" open ol err))) (overlay-put ol 'invisible inv)) ;; Remove the overlay from the list of open spots. diff --git a/lisp/simple.el b/lisp/simple.el index c47ea8660f9..b0490bb36d4 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -393,7 +393,7 @@ To control which errors are matched, customize the variable (next-error-found buffer (current-buffer)) (when (or next-error-verbose (not (eq prev next-error-last-buffer))) - (message "Current locus from %s" next-error-last-buffer))))) + (message "Current locus from %S" next-error-last-buffer))))) (defun next-error-quit-window (from-buffer to-buffer) "Quit window of FROM-BUFFER when the prefix arg is 0. commit 2a5725b99a7b8034ac51b603c1bd9c8099e4adb0 Author: Roland Winkler Date: Thu Jan 2 09:11:04 2025 -0600 Fix NEWS entries for BibTeX mode. diff --git a/etc/NEWS b/etc/NEWS index 2179cf3389d..dd912306757 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -771,20 +771,21 @@ toggle. ** BibTeX mode --- -*** New user variables facilitate customization. -Mew user variables 'bibtex-BibTeX-aux-entry-alist', -'bibtex-biblatex-aux-entry-alist', 'bibtex-BibTeX-aux-opt-alist', -and 'bibtex-biblatex-aux-opt-alist' facilitate the customization of -BibTeX and biblatex entries. These variables now support the definition -of aliases that inherit the definition of another entry. +*** New user options facilitate customization of BibTeX and biblatex entries. +Entry definitions via the user options 'bibtex-BibTeX-aux-entry-alist', +'bibtex-biblatex-aux-entry-alist', 'bibtex-BibTeX-aux-opt-alist', and +'bibtex-biblatex-aux-opt-alist' take precedence over +'bibtex-BibTeX-entry-alist' and 'bibtex-biblatex-entry-alist'. +These user options now support the definition of aliases that inherit +the definition of another entry. --- -*** The user variable 'bibtex-user-optional-fields' has been renamed -to 'bibtex-aux-opt-alist'. The old name is an obsolete alias. +*** 'bibtex-user-optional-fields' has been renamed to 'bibtex-aux-opt-alist'. +The old name is an obsolete alias. --- -*** The user variable 'bibtex-include-OPTkey' is now obsolete and -its default is nil. Use 'bibtex-aux-opt-alist' instead. +*** 'bibtex-include-OPTkey' is now obsolete and its default is nil. +Use 'bibtex-aux-opt-alist' instead. --- *** New user option 'bibtex-entry-ask-for-key'. commit 1bc8412ecbf58a16efc4e9ddb0d46ef25ce7c14f Author: Po Lu Date: Thu Jan 2 20:29:12 2025 +0800 ; Fix the MS-DOS build * msdos/sedlibmk.inp: Adapt to new GNulib module names. diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 61d8519f062..589508f3d31 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -470,7 +470,7 @@ OMIT_GNULIB_MODULE_allocator = true\ OMIT_GNULIB_MODULE_at-internal = true\ OMIT_GNULIB_MODULE_careadlinkat = true\ OMIT_GNULIB_MODULE_cloexec = true\ -OMIT_GNULIB_MODULE_dirent = true\ +OMIT_GNULIB_MODULE_dirent-h = true\ OMIT_GNULIB_MODULE_dirfd = true\ OMIT_GNULIB_MODULE_dup2 = true\ OMIT_GNULIB_MODULE_errno = true\ @@ -486,7 +486,7 @@ OMIT_GNULIB_MODULE_getdtablesize = true\ OMIT_GNULIB_MODULE_getgroups = true\ OMIT_GNULIB_MODULE_gettimeofday = true\ OMIT_GNULIB_MODULE_group-member = true\ -OMIT_GNULIB_MODULE_inttypes-incomplete = true\ +OMIT_GNULIB_MODULE_inttypes-h-incomplete = true\ OMIT_GNULIB_MODULE_localtime-buffer = true\ OMIT_GNULIB_MODULE_lstat = true\ OMIT_GNULIB_MODULE_math = true\ @@ -502,8 +502,8 @@ OMIT_GNULIB_MODULE_stpcpy = true\ OMIT_GNULIB_MODULE_strtoimax = true\ OMIT_GNULIB_MODULE_strtoll = true\ OMIT_GNULIB_MODULE_symlink = true\ -OMIT_GNULIB_MODULE_sys_select = true\ -OMIT_GNULIB_MODULE_sys_time = true\ +OMIT_GNULIB_MODULE_sys_select-h = true\ +OMIT_GNULIB_MODULE_sys_time-h = true\ OMIT_GNULIB_MODULE_boot-time = true\ OMIT_GNULIB_MODULE_crypto\/md5 = true /^arg-nonnull\.h:/,/^[ ][ ]*mv /c\ commit be9577d4a1e0308a066f50140662a1f04b7a6c16 Author: Po Lu Date: Thu Jan 2 20:26:43 2025 +0800 Fix volatile Android build * exec/Makefile.in (config-mips.m4): Call config.status in builddir. diff --git a/exec/Makefile.in b/exec/Makefile.in index f1b6d0307a4..08dcdd66851 100644 --- a/exec/Makefile.in +++ b/exec/Makefile.in @@ -94,7 +94,7 @@ ifeq ($(is_mips),yes) # Set up dependencies for config-mips.m4. config-mips.m4: config-mips.m4.in - cd $(srcdir) && ./config.status $@ + cd $(builddir) && ./config.status $@ $(LOADOBJS): config-mips.m4 else .s.o: