commit 2a38a2c8757b2fa01d9a846af67546c63122bba3 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Fri Apr 30 10:28:50 2021 +0300 Improve support for 'display-line-numbers-width-start' * lisp/display-line-numbers.el (display-line-numbers-width-start): Allow the value to be a number. (Bug#48095) (display-line-numbers-mode): Handle 'display-line-numbers-width-start' whose value is a number. diff --git a/lisp/display-line-numbers.el b/lisp/display-line-numbers.el index a6fa813afe..72928492bb 100644 --- a/lisp/display-line-numbers.el +++ b/lisp/display-line-numbers.el @@ -56,12 +56,17 @@ See `display-line-numbers' for value options." (defcustom display-line-numbers-width-start nil "If non-nil, count number of lines to use for line number width. -When `display-line-numbers-mode' is turned on, -`display-line-numbers-width' is set to the minimum width necessary -to display all line numbers in the buffer." +When `display-line-numbers-mode' is turned on, if this option is +non-nil, `display-line-numbers-width' is set up front to a width +necessary to display all line numbers in the buffer. If the value +is a positive number, it is interpreted as extra lines to account +for when computing the required width; this should be set to the +number of lines in the tallest window in which you want to prevent +the line-number width from changing." :group 'display-line-numbers - :type 'boolean - :version "26.1") + :type '(choice (boolean :tag "Minimum width for buffer's line count") + (integer :tag "Number of extra lines to account for")) + :version "28.1") (defun display-line-numbers-update-width () "Prevent the line number width from shrinking." @@ -83,7 +88,11 @@ the mode is on, set `display-line-numbers' directly." (when display-line-numbers-width-start (setq display-line-numbers-width (length (number-to-string - (count-lines (point-min) (point-max)))))) + (+ (count-lines (point-min) (point-max)) + (if (and (numberp display-line-numbers-width-start) + (> display-line-numbers-width-start 0)) + display-line-numbers-width-start + 0)))))) (when display-line-numbers-grow-only (add-hook 'pre-command-hook #'display-line-numbers-update-width nil t)) (setq display-line-numbers display-line-numbers-type)) commit 7c901d90e620b4d3651b86c13faf1e81eeb3db10 Author: Stefan Monnier Date: Thu Apr 29 18:11:04 2021 -0400 * src/doc.c (Fsnarf_documentation): Fix bug#48019 Don't presume that `custom-delayed-init-variables` holds a list. diff --git a/src/doc.c b/src/doc.c index 01f4368e3b..e179a12618 100644 --- a/src/doc.c +++ b/src/doc.c @@ -550,7 +550,7 @@ the same file name is found in the `doc-directory'. */) Lisp_Object delayed_init = find_symbol_value (intern ("custom-delayed-init-variables")); - if (EQ (delayed_init, Qunbound)) delayed_init = Qnil; + if (!CONSP (delayed_init)) delayed_init = Qnil; CHECK_STRING (filename); commit 1cf03f290bd02082c2ffa25a9adf27203334d36c Author: Stefan Monnier Date: Thu Apr 29 18:03:51 2021 -0400 * lisp/mail/supercite.el (sc-select-attribution): Fix lexical conversion Mark `citation` and `attribution` as dynamically scoped around `sc-attribs-postselect-hook`, as documented in the function's docstring. diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el index dc1c641052..d545b0c3f1 100644 --- a/lisp/mail/supercite.el +++ b/lisp/mail/supercite.el @@ -1128,6 +1128,8 @@ selection but before querying is performed. During auto-selected citation string and the variable `attribution' is bound to the auto-selected attribution string." (run-hooks 'sc-attribs-preselect-hook) + (with-suppressed-warnings ((lexical citation attribution)) + (defvar citation) (defvar attribution)) (let ((query-p sc-confirm-always-p) attribution citation (attriblist sc-preferred-attribution-list)) commit 39ebc2689b5475c31ff8a825b872be93bbf32602 Author: Andrea Corallo Date: Thu Apr 29 20:56:26 2021 +0200 * Improve `comp-normalize-valset' reproducibility (bug#48021) * lisp/emacs-lisp/comp-cstr.el (comp-normalize-valset): Make it more reproducible. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 73b78a3672..3c5578217a 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -190,13 +190,18 @@ Return them as multiple value." (defun comp-normalize-valset (valset) "Sort and remove duplicates from VALSET then return it." - (cl-remove-duplicates - (cl-sort valset (lambda (x y) - ;; We might want to use `sxhash-eql' for speed but - ;; this is safer to keep tests stable. - (< (sxhash-equal x) - (sxhash-equal y)))) - :test #'eq)) + (cl-sort (cl-remove-duplicates valset :test #'eq) + (lambda (x y) + (cond + ((and (symbolp x) (symbolp y)) + (string< x y)) + ((and (symbolp x) (not (symbolp y))) + t) + ((and (not (symbolp x)) (symbolp y)) + nil) + (t + (< (sxhash-equal x) + (sxhash-equal y))))))) (defun comp-union-valsets (&rest valsets) "Union values present into VALSETS." commit 68bf917896daa10601c3fdff172205e9aa06d155 Author: Glenn Morris Date: Thu Apr 29 11:42:03 2021 -0700 Automatically generate texinfo.el internal autoloads * lisp/textmodes/texinfo.el: Replace manual autoloads. * lisp/textmodes/makeinfo.el (makeinfo-region, makeinfo-buffer) (makeinfo-recenter-compilation-buffer): * lisp/textmodes/texnfo-upd.el (texinfo-make-menu) (texinfo-all-menus-update, texinfo-start-menu-description) (texinfo-indent-menu-description, texinfo-master-menu) (texinfo-update-node, texinfo-every-node-update) (texinfo-sequential-node-update, texinfo-insert-node-lines) (texinfo-multiple-files-update): Add autoload cookies, and set generated-autoload-file. diff --git a/lisp/textmodes/makeinfo.el b/lisp/textmodes/makeinfo.el index 653540ad41..13367a09bc 100644 --- a/lisp/textmodes/makeinfo.el +++ b/lisp/textmodes/makeinfo.el @@ -85,6 +85,7 @@ the proper way to specify those is with the Texinfo commands ;;; The `makeinfo' function definitions +;;;###autoload (defun makeinfo-region (region-beginning region-end) "Make Info file from region of current Texinfo file, and switch to it. @@ -222,6 +223,7 @@ nonsensical results." (match-string 1) "Top"))) +;;;###autoload (defun makeinfo-buffer () "Make Info file from current buffer. @@ -266,6 +268,7 @@ Use the \\[next-error] command to move to the next error (Info-revert-find-node makeinfo-output-file-name makeinfo-output-node-name)))) +;;;###autoload (defun makeinfo-recenter-compilation-buffer (linenum) "Redisplay `*compilation*' buffer so most recent output can be seen. The last line of the buffer is displayed on @@ -286,4 +289,8 @@ line LINE of the window, or centered if LINE is nil." (provide 'makeinfo) +;; Local Variables: +;; generated-autoload-file: "texinfo-loaddefs.el" +;; End: + ;;; makeinfo.el ends here diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 750a33db0a..11d60e1eb0 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -69,202 +69,12 @@ ;;; Autoloads: -(autoload 'makeinfo-region - "makeinfo" - "Make Info file from region of current Texinfo file, and switch to it. - -This command does not offer the `next-error' feature since it would -apply to a temporary file, not the original; use the `makeinfo-buffer' -command to gain use of `next-error'." - t nil) - -(autoload 'makeinfo-buffer - "makeinfo" - "Make Info file from current buffer. - -Use the \\[next-error] command to move to the next error -\(if there are errors)." - t nil) - (autoload 'kill-compilation "compile" "Kill the process made by the \\[compile] command." t nil) -(autoload 'makeinfo-recenter-compilation-buffer - "makeinfo" - "Redisplay `*compilation*' buffer so most recent output can be seen. -The last line of the buffer is displayed on -line LINE of the window, or centered if LINE is nil." - t nil) - -(autoload 'texinfo-update-node - "texnfo-upd" - "Without any prefix argument, update the node in which point is located. -Non-nil argument (prefix, if interactive) means update the nodes in the -marked region. - -The functions for creating or updating nodes and menus, and their -keybindings, are: - - `texinfo-update-node' (&optional region-p) \\[texinfo-update-node] - `texinfo-every-node-update' () \\[texinfo-every-node-update] - `texinfo-sequential-node-update' (&optional region-p) - - `texinfo-make-menu' (&optional region-p) \\[texinfo-make-menu] - `texinfo-all-menus-update' () \\[texinfo-all-menus-update] - `texinfo-master-menu' () - - `texinfo-indent-menu-description' (column &optional region-p) - -The `texinfo-column-for-description' variable specifies the column to -which menu descriptions are indented. Its default value is 32." - t nil) - -(autoload 'texinfo-every-node-update - "texnfo-upd" - "Update every node in a Texinfo file." - t nil) - -(autoload 'texinfo-sequential-node-update - "texnfo-upd" - "Update one node (or many) in a Texinfo file with sequential pointers. - -This function causes the `Next' or `Previous' pointer to point to the -immediately preceding or following node, even if it is at a higher or -lower hierarchical level in the document. Continually pressing `n' or -`p' takes you straight through the file. - -Without any prefix argument, update the node in which point is located. -Non-nil argument (prefix, if interactive) means update the nodes in the -marked region. - -This command makes it awkward to navigate among sections and -subsections; it should be used only for those documents that are meant -to be read like a novel rather than a reference, and for which the -Info `g*' command is inadequate." - t nil) - -(autoload 'texinfo-make-menu - "texnfo-upd" - "Without any prefix argument, make or update a menu. -Make the menu for the section enclosing the node found following point. - -Non-nil argument (prefix, if interactive) means make or update menus -for nodes within or part of the marked region. - -Whenever a menu exists, and is being updated, the descriptions that -are associated with node names in the pre-existing menu are -incorporated into the new menu. Otherwise, the nodes' section titles -are inserted as descriptions." - t nil) - -(autoload 'texinfo-all-menus-update - "texnfo-upd" - "Update every regular menu in a Texinfo file. -Remove pre-existing master menu, if there is one. - -If called with a non-nil argument, this function first updates all the -nodes in the buffer before updating the menus." - t nil) - -(autoload 'texinfo-master-menu - "texnfo-upd" - "Make a master menu for a whole Texinfo file. -Non-nil argument (prefix, if interactive) means first update all -existing nodes and menus. Remove pre-existing master menu, if there is one. - -This function creates a master menu that follows the top node. The -master menu includes every entry from all the other menus. It -replaces any existing ordinary menu that follows the top node. - -If called with a non-nil argument, this function first updates all the -menus in the buffer (incorporating descriptions from pre-existing -menus) before it constructs the master menu. - -The function removes the detailed part of an already existing master -menu. This action depends on the pre-existing master menu using the -standard `texinfo-master-menu-header'. - -The master menu has the following format, which is adapted from the -recommendation in the Texinfo Manual: - - * The first part contains the major nodes in the Texinfo file: the - nodes for the chapters, chapter-like sections, and the major - appendices. This includes the indices, so long as they are in - chapter-like sections, such as unnumbered sections. - - * The second and subsequent parts contain a listing of the other, - lower level menus, in order. This way, an inquirer can go - directly to a particular node if he or she is searching for - specific information. - -Each of the menus in the detailed node listing is introduced by the -title of the section containing the menu." - t nil) - -(autoload 'texinfo-indent-menu-description - "texnfo-upd" - "Indent every description in menu following point to COLUMN. -Non-nil argument (prefix, if interactive) means indent every -description in every menu in the region. Does not indent second and -subsequent lines of a multi-line description." - t nil) - -(autoload 'texinfo-insert-node-lines - "texnfo-upd" - "Insert missing `@node' lines in region of Texinfo file. -Non-nil argument (prefix, if interactive) means also to insert the -section titles as node names; and also to insert the section titles as -node names in pre-existing @node lines that lack names." - t nil) - -(autoload 'texinfo-start-menu-description - "texnfo-upd" - "In this menu entry, insert the node's section title as a description. -Position point at beginning of description ready for editing. -Do not insert a title if the line contains an existing description. - -You will need to edit the inserted text since a useful description -complements the node name rather than repeats it as a title does." - t nil) - -(autoload 'texinfo-multiple-files-update - "texnfo-upd" - "Update first node pointers in each file included in OUTER-FILE; -create or update main menu in the outer file that refers to such nodes. -This does not create or update menus or pointers within the included files. - -With optional MAKE-MASTER-MENU argument (prefix arg, if interactive), -insert a master menu in OUTER-FILE. This does not create or update -menus or pointers within the included files. - -With optional UPDATE-EVERYTHING argument (numeric prefix arg, if -interactive), update all the menus and all the `Next', `Previous', and -`Up' pointers of all the files included in OUTER-FILE before inserting -a master menu in OUTER-FILE. - -The command also updates the `Top' level node pointers of OUTER-FILE. - -Notes: - - * this command does NOT save any files--you must save the - outer file and any modified, included files. - - * except for the `Top' node, this command does NOT handle any - pre-existing nodes in the outer file; hence, indices must be - enclosed in an included file. - -Requirements: - - * each of the included files must contain exactly one highest - hierarchical level node, - * this highest node must be the first node in the included file, - * each highest hierarchical level node must be of the same type. - -Thus, normally, each included file contains one, and only one, -chapter." - t nil) +(require 'texinfo-loaddefs) ;;; Code: diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el index 0300454830..f56f197c50 100644 --- a/lisp/textmodes/texnfo-upd.el +++ b/lisp/textmodes/texnfo-upd.el @@ -275,6 +275,7 @@ The keys are strings specifying the general hierarchical level in the document; the values are regular expressions.") +;;;###autoload (defun texinfo-make-menu (&optional beginning end) "Without any prefix argument, make or update a menu. Make the menu for the section enclosing the node found following point. @@ -351,6 +352,7 @@ at the level specified by LEVEL. Point is left at the end of menu." (texinfo-delete-old-menu beginning first)) (texinfo-insert-menu new-menu-list node-name))) +;;;###autoload (defun texinfo-all-menus-update (&optional update-all-nodes-p) "Update every regular menu in a Texinfo file. Update pre-existing master menu, if there is one. @@ -733,6 +735,7 @@ is the menu entry name, and the cdr of P is the node name." ;;; Starting menu descriptions by inserting titles +;;;###autoload (defun texinfo-start-menu-description () "In this menu entry, insert the node's section title as a description. Position point at beginning of description ready for editing. @@ -817,6 +820,7 @@ complements the node name rather than repeats it as a title does." ;; Since the make-menu functions indent descriptions, these functions ;; are useful primarily for indenting a single menu specially. +;;;###autoload (defun texinfo-indent-menu-description (column &optional region-p) "Indent every description in menu following point to COLUMN. Non-nil argument (prefix, if interactive) means indent every @@ -872,6 +876,7 @@ second and subsequent lines of a multi-line description." ;;; Making the master menu +;;;###autoload (defun texinfo-master-menu (update-all-nodes-menus-p) "Make a master menu for a whole Texinfo file. Remove pre-existing master menu, if there is one. @@ -1266,6 +1271,7 @@ end of that region; it limits the search." ;;; Updating a node +;;;###autoload (defun texinfo-update-node (&optional beginning end) "Without any prefix argument, update the node in which point is located. Interactively, a prefix argument means to operate on the region. @@ -1313,6 +1319,7 @@ which menu descriptions are indented. Its default value is 32." (goto-char (point-max)) (message "Done...nodes updated in region. You may save the buffer.")))))) +;;;###autoload (defun texinfo-every-node-update () "Update every node in a Texinfo file. @@ -1553,6 +1560,7 @@ towards which the pointer is directed, one of `next', `previous', or `up'." ;; (The subsection to which `Next' points will most likely be the first ;; item on the section's menu.) +;;;###autoload (defun texinfo-sequential-node-update (&optional region-p) "Update one node (or many) in a Texinfo file with sequential pointers. @@ -1676,6 +1684,7 @@ or `Up' pointer." ;; before the `@chapter', `@section', and such like lines of a region ;; in a Texinfo file. +;;;###autoload (defun texinfo-insert-node-lines (beginning end &optional title-p) "Insert missing `@node' lines in region of Texinfo file. Non-nil argument (prefix, if interactive) means also to insert the @@ -1989,6 +1998,7 @@ be the files included within it. A main menu must already exist." ;;; The multiple-file update function +;;;###autoload (defun texinfo-multiple-files-update (outer-file &optional make-master-menu update-everything) "Update first node pointers in each file included in OUTER-FILE; @@ -2114,4 +2124,8 @@ chapter." (provide 'texnfo-upd) +;; Local Variables: +;; generated-autoload-file: "texinfo-loaddefs.el" +;; End: + ;;; texnfo-upd.el ends here commit a8aa217bff255aa92eae5207c10df8877b0d137a Author: Michael Albinus Date: Thu Apr 29 15:04:51 2021 +0200 Some Tramp corrections, Bug#48067 * doc/misc/tramp.texi (Frequently Asked Questions): Rephrase GNU ELPA warnings. * lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter): Improve handling of gio warning. (Bug#48067) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index e0f648fbd9..ebfc14d936 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -5100,12 +5100,12 @@ I get an error @samp{tramp-file-name-handler: Invalid function: tramp-compat-with-mutex} @value{tramp} comes with compatibility code for different Emacs -versions. When you see this warning, you don't use the Emacs built-in -version of @value{tramp}. In case you have installed @value{tramp} -from GNU ELPA, see the package README file for instructions how to -recompile it. +versions. When you see such a message (the text might differ), you +don't use the Emacs built-in version of @value{tramp}. In case you +have installed @value{tramp} from GNU ELPA, see the package README +file for instructions how to recompile it. @ifset installchapter -In case you have installed it from its Git repository, @ref{Recompilation}. +@xref{Recompilation}. @end ifset diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 4a3072ee34..b51ba11247 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3708,7 +3708,8 @@ Fall back to normal file name handler if no Tramp handler exists." (remote-prefix (with-current-buffer (process-buffer proc) (file-remote-p default-directory))) - (rest-string (process-get proc 'rest-string))) + (rest-string (process-get proc 'rest-string)) + pos) (when rest-string (tramp-message proc 10 "Previous string:\n%s" rest-string)) (tramp-message proc 6 "%S\n%s" proc string) @@ -3737,22 +3738,23 @@ Fall back to normal file name handler if no Tramp handler exists." ;; some assumptions. ((string-match "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string) + (setq pos (match-end 0)) (cond ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor) ((eq system-type 'cygwin) 'GPollFileMonitor) - (t tramp-cache-undefined))) + (t nil))) ;; TODO: What happens, if several monitor names are reported? ((string-match "\ Supported arguments for GIO_USE_FILE_MONITOR environment variable: \\s-*\\([[:alpha:]]+\\) - 20" string) + (setq pos (match-end 0)) (intern (format "G%sFileMonitor" (capitalize (match-string 1 string))))) - (t (throw 'doesnt-work nil)))) - (setq string (substring string (match-end 0)))) + (t (setq pos (length string)) nil))) + (setq string (substring string pos))) ;; Delete empty lines. - (setq string (tramp-compat-string-replace "\n\n" "\n" string) - string (replace-regexp-in-string "^\n" "" string)) + (setq string (tramp-compat-string-replace "\n\n" "\n" string)) (while (string-match (eval-when-compile @@ -3783,6 +3785,8 @@ Supported arguments for GIO_USE_FILE_MONITOR environment variable: `(file-notify ,object file-notify-callback)))))) ;; Save rest of the string. + (while (string-match "^\n" string) + (setq string (replace-match "" nil nil string))) (when (zerop (length string)) (setq string nil)) (when string (tramp-message proc 10 "Rest string:\n%s" string)) (process-put proc 'rest-string string))) commit 086e29d213ac89020d783af2618d4c53532f471e Author: Stefan Kangas Date: Thu Apr 29 13:32:10 2021 +0200 * lisp/emacs-lisp/shortdoc.el: Doc fixes. diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 86d5130bbe..9b31d68703 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -1252,7 +1252,7 @@ Example: (define-key map (kbd "C-c C-n") 'shortdoc-next-section) (define-key map (kbd "C-c C-p") 'shortdoc-previous-section) map) - "Keymap for `shortdoc-mode'") + "Keymap for `shortdoc-mode'.") (define-derived-mode shortdoc-mode special-mode "shortdoc" "Mode for shortdoc.") @@ -1269,23 +1269,27 @@ Example: (setq ,arg (1- ,arg))))) (defun shortdoc-next (&optional arg) - "Move cursor to next function." + "Move cursor to the next function. +With ARG, do it that many times." (interactive "p") (shortdoc--goto-section arg 'shortdoc-function)) (defun shortdoc-previous (&optional arg) - "Move cursor to previous function." + "Move cursor to the previous function. +With ARG, do it that many times." (interactive "p") (shortdoc--goto-section arg 'shortdoc-function t) (backward-char 1)) (defun shortdoc-next-section (&optional arg) - "Move cursor to next section." + "Move cursor to the next section. +With ARG, do it that many times." (interactive "p") (shortdoc--goto-section arg 'shortdoc-section)) (defun shortdoc-previous-section (&optional arg) - "Move cursor to previous section." + "Move cursor to the previous section. +With ARG, do it that many times." (interactive "p") (shortdoc--goto-section arg 'shortdoc-section t) (forward-line -2))