From a89fabe96396b2197cffc5a9e694004e1c691fa9 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 26 Feb 2019 11:57:53 +0000 Subject: [PATCH 01/15] Update example major mode code in Elisp manual * doc/lispref/modes.texi (Example Major Modes): Update code examples to reflect current state of lisp/textmodes/text-mode.el and lisp/emacs-lisp/lisp-mode.el. (bug#34671) --- doc/lispref/modes.texi | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 13430243298..919816f3dee 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1217,6 +1217,7 @@ the conventions listed above: (modify-syntax-entry ?\\ ". " st) ;; Add 'p' so M-c on 'hello' leads to 'Hello', not 'hello'. (modify-syntax-entry ?' "w p" st) + @dots{} st) "Syntax table used while in `text-mode'.") @end group @@ -1226,6 +1227,7 @@ the conventions listed above: (defvar text-mode-map (let ((map (make-sparse-keymap))) (define-key map "\e\t" 'ispell-complete-word) + @dots{} map) "Keymap for `text-mode'. Many other modes, such as `mail-mode', `outline-mode' and @@ -1269,11 +1271,11 @@ illustrate how these modes are written. @smallexample @group ;; @r{Create mode-specific table variables.} -(defvar lisp-mode-abbrev-table nil) -(define-abbrev-table 'lisp-mode-abbrev-table ()) +(define-abbrev-table 'lisp-mode-abbrev-table () + "Abbrev table for Lisp mode.") (defvar lisp-mode-syntax-table - (let ((table (copy-syntax-table emacs-lisp-mode-syntax-table))) + (let ((table (make-syntax-table lisp--mode-syntax-table))) (modify-syntax-entry ?\[ "_ " table) (modify-syntax-entry ?\] "_ " table) (modify-syntax-entry ?# "' 14" table) @@ -1288,10 +1290,9 @@ each calls the following function to set various variables: @smallexample @group -(defun lisp-mode-variables (&optional syntax keywords-case-insensitive) +(defun lisp-mode-variables (&optional syntax keywords-case-insensitive elisp) (when syntax (set-syntax-table lisp-mode-syntax-table)) - (setq local-abbrev-table lisp-mode-abbrev-table) @dots{} @end group @end smallexample @@ -1302,8 +1303,7 @@ variable to handle Lisp comments: @smallexample @group - (make-local-variable 'comment-start) - (setq comment-start ";") + (setq-local comment-start ";") @dots{} @end group @end smallexample @@ -1317,6 +1317,7 @@ common. The following code sets up the common commands: @group (defvar lisp-mode-shared-map (let ((map (make-sparse-keymap))) + (set-keymap-parent map prog-mode-map) (define-key map "\e\C-q" 'indent-sexp) (define-key map "\177" 'backward-delete-char-untabify) map) @@ -1331,7 +1332,7 @@ And here is the code to set up the keymap for Lisp mode: @group (defvar lisp-mode-map (let ((map (make-sparse-keymap)) - (menu-map (make-sparse-keymap "Lisp"))) + (menu-map (make-sparse-keymap "Lisp"))) (set-keymap-parent map lisp-mode-shared-map) (define-key map "\e\C-x" 'lisp-eval-defun) (define-key map "\C-c\C-z" 'run-lisp) @@ -1355,17 +1356,13 @@ Blank lines separate paragraphs. Semicolons start comments. \\@{lisp-mode-map@} Note that `run-lisp' may be used either to start an inferior Lisp job -or to switch back to an existing one. +or to switch back to an existing one." @end group - @group -Entry to this mode calls the value of `lisp-mode-hook' -if that value is non-nil." (lisp-mode-variables nil t) - (set (make-local-variable 'find-tag-default-function) - 'lisp-find-tag-default) - (set (make-local-variable 'comment-start-skip) - "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") + (setq-local find-tag-default-function 'lisp-find-tag-default) + (setq-local comment-start-skip + "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") (setq imenu-case-fold-search t)) @end group @end smallexample From 04cad5e8eac6fee415c0951d673e8a27534e727d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 2 Mar 2019 10:32:06 +0200 Subject: [PATCH 02/15] Fix visiting XML files with non-Unix EOL format * lisp/international/mule.el (sgml-xml-auto-coding-function) (sgml-html-meta-auto-coding-function): Don't use 'buffer-file-coding-system' if the buffer is unibyte. (Bug#34704) --- lisp/international/mule.el | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lisp/international/mule.el b/lisp/international/mule.el index b47fd4ca69c..58fdd28243a 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -2500,10 +2500,17 @@ This function is intended to be added to `auto-coding-functions'." (let ((sym-type (coding-system-type sym)) (bfcs-type (coding-system-type buffer-file-coding-system))) - ;; 'charset' will signal an error in - ;; coding-system-equal, since it isn't a - ;; coding-system. So test that up front. - (if (and (not (equal sym-type 'charset)) + ;; If the buffer is unibyte, its encoding is + ;; immaterial (it is just the default value of + ;; buffer-file-coding-system), so we ignore it. + ;; This situation happens when this function is + ;; called as part of visiting a file, as opposed + ;; to when saving a buffer to a file. + (if (and enable-multibyte-characters + ;; 'charset' will signal an error in + ;; coding-system-equal, since it isn't a + ;; coding-system. So test that up front. + (not (equal sym-type 'charset)) (coding-system-equal 'utf-8 sym-type) (coding-system-equal 'utf-8 bfcs-type)) buffer-file-coding-system @@ -2555,7 +2562,8 @@ This function is intended to be added to `auto-coding-functions'." (let ((sym-type (coding-system-type sym)) (bfcs-type (coding-system-type buffer-file-coding-system))) - (if (and (coding-system-equal 'utf-8 sym-type) + (if (and enable-multibyte-characters + (coding-system-equal 'utf-8 sym-type) (coding-system-equal 'utf-8 bfcs-type)) buffer-file-coding-system sym)) From f872b65b2f6b83f3cee2eb0e80cb296d1de99505 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 2 Mar 2019 10:42:29 +0200 Subject: [PATCH 03/15] Improve documentation of 'auto-coding-functions' * doc/lispref/nonascii.texi (Default Coding Systems): Clarify that the functions in 'auto-coding-functions' are called both for decoding and for encoding. * lisp/international/mule.el (auto-coding-functions): Doc fix. --- doc/lispref/nonascii.texi | 15 ++++++++++----- lisp/international/mule.el | 7 +++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index 66d12033d82..d58041b279b 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi @@ -1632,11 +1632,16 @@ coding system for a file based on its undecoded contents. Each function in this list should be written to look at text in the current buffer, but should not modify it in any way. The buffer will -contain undecoded text of parts of the file. Each function should -take one argument, @var{size}, which tells it how many characters to -look at, starting from point. If the function succeeds in determining -a coding system for the file, it should return that coding system. -Otherwise, it should return @code{nil}. +contain the text of parts of the file. Each function should take one +argument, @var{size}, which tells it how many characters to look at, +starting from point. If the function succeeds in determining a coding +system for the file, it should return that coding system. Otherwise, +it should return @code{nil}. + +The functions in this list could be called either when the file is +visited and Emacs wants to decode its contents, and/or when the file's +buffer is about to be saved and Emacs wants to determine how to encode +its contents. If a file has a @samp{coding:} tag, that takes precedence, so these functions won't be called. diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 58fdd28243a..cc0658dc3f4 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1851,9 +1851,12 @@ or nil." Each function in this list should be written to operate on the current buffer, but should not modify it in any way. The buffer -will contain undecoded text of parts of the file. Each function +will contain the text of parts of the file. Each function should take one argument, SIZE, which says how many characters -\(starting from point) it should look at. +\(starting from point) it should look at. The function might be +called both when the file is visited and Emacs wants to decode +its contents, and when the file's buffer is about to be saved +and Emacs wants to determine how to encode its contents. If one of these functions succeeds in determining a coding system, it should return that coding system. Otherwise, it From 52fd40068e0f8b41bd29eaec1334299eb86d0bff Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 4 Mar 2019 19:49:47 +0200 Subject: [PATCH 04/15] Minor improvement of documentation of '(when CONDITION . SPEC)' * doc/lispref/display.texi (Other Display Specs): Add a caveat to using the '(when CONDITION . SPEC)' display specs. --- doc/lispref/display.texi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 921d58a1f3a..7892c15b462 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -4853,6 +4853,16 @@ and the buffer position where the @code{display} property was found, respectively. Both positions can be different when @code{object} is a string. +Note that @var{condition} will only be evaluated when redisplay +examines the text where this display spec is located, so this feature +is best suited for conditions that are relatively stable, i.e.@: +yield, for each particular buffer position, the same results on every +evaluation. If the results change for the same text location, e.g., +if the result depends on the position of point, then the conditional +specification might not do what you want, because redisplay examines +only those parts of buffer text where it has reasons to assume that +something changed since the last display cycle. + @node Display Margins @subsection Displaying in the Margins @cindex display margins From 099ef446c2c1014727cfe98268fe468eb2e8828b Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 5 Mar 2019 20:24:41 +0000 Subject: [PATCH 05/15] Minor spelling and grammar fixes (bug#34756) doc/misc/cc-mode.texi (Style Variables, Customizing Indentation): doc/misc/ede.texi (Extending EDE, ede-project-placeholder) (ede-target, ede-proj-target, ede-compilation-program, ede-compiler) (ede-linker): Remove apostrophe from possessive "it's". doc/lispintro/emacs-lisp-intro.texi (Find a File): doc/misc/gnus-faq.texi (FAQ 2-2): Write "an other" as a single word. doc/misc/gnus.texi (Article Buttons): lisp/gnus/gnus-art.el (gnus-button-mid-or-mail-heuristic-alist) (gnus-button-mid-or-mail-heuristic): Write singular number of Message-IDs, rather than plural. lisp/gnus/message.el (message-user-fqdn): Capitalize initialism. --- doc/lispintro/emacs-lisp-intro.texi | 2 +- doc/misc/cc-mode.texi | 4 ++-- doc/misc/ede.texi | 16 ++++++++-------- doc/misc/gnus-faq.texi | 2 +- doc/misc/gnus.texi | 2 +- lisp/gnus/gnus-art.el | 4 ++-- lisp/gnus/message.el | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 3305f5b3add..c4b19a4e50a 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -14824,7 +14824,7 @@ According to its documentation as shown by @kbd{C-h f} (the @code{describe-function} command), the @code{find-file-noselect} function reads the named file into a buffer and returns the buffer. (Its most recent version includes an optional @var{wildcards} argument, -too, as well as another to read a file literally and an other you +too, as well as another to read a file literally and another to suppress warning messages. These optional arguments are irrelevant.) However, the @code{find-file-noselect} function does not select the diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 1a77a64e01c..47ae83ab396 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -2548,7 +2548,7 @@ Basics}). @item The style variable @code{c-offsets-alist} (@pxref{c-offsets-alist}) is an association list with an element for each syntactic symbol. It's -handled a little differently from the other style variables. It's +handled a little differently from the other style variables. Its default global binding is the empty list @code{nil}, rather than @code{set-from-style}. Before the style system is initialized, you can add individual elements to @code{c-offsets-alist} by calling @@ -5286,7 +5286,7 @@ The simplest and most used kind of ``offset'' setting in @defopt c-basic-offset @vindex basic-offset @r{(c-)} This style variable holds the basic offset between indentation levels. -It's factory default is 4, but all the built-in styles set it +Its factory default is 4, but all the built-in styles set it themselves, to some value between 2 (for @code{gnu} style) and 8 (for @code{bsd}, @code{linux}, and @code{python} styles). @end defopt diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi index 513461d0e0f..4edb53d9533 100644 --- a/doc/misc/ede.texi +++ b/doc/misc/ede.texi @@ -1038,7 +1038,7 @@ details on using @eieio{} to extending classes, and writing methods. If you intend to extend @ede{}, it is most likely that a new target type is needed in one of the existing project types. The rest of this chapter -will discuss extending the @code{ede-project} class, and it's targets. +will discuss extending the @code{ede-project} class, and its targets. See @file{project-am.el} for basic details on adding targets to it. For the @code{ede-project} type, the core target class is called @@ -1477,7 +1477,7 @@ Get the inode of the directory project @var{PROJ} is in. @end deffn @deffn Method ede-project-root :AFTER this -If a project knows it's root, return it here. +If a project knows its root, return it here. Allows for one-project-object-for-a-tree type systems. @end deffn @@ -1486,7 +1486,7 @@ Find a subproject of @var{PROJ} that corresponds to @var{DIR}. @end deffn @deffn Method ede-project-root-directory :AFTER this &optional file -If a project knows it's root, return it here. +If a project knows its root, return it here. Allows for one-project-object-for-a-tree type systems. Optional @var{FILE} is the file to test. It is ignored in preference of the anchor file for the project. @@ -2516,7 +2516,7 @@ In sources for @var{THIS}, change version numbers to @var{VERSION}. @end deffn @deffn Method project-delete-target :AFTER ot -Delete the current target @var{OT} from it's parent project. +Delete the current target @var{OT} from its parent project. @end deffn @deffn Method ede-target-sourcecode :AFTER this @@ -2715,7 +2715,7 @@ Converts all symbols into the objects to be used. @end deffn @deffn Method project-delete-target :AFTER this -Delete the current target @var{THIS} from it's parent project. +Delete the current target @var{THIS} from its parent project. @end deffn @deffn Method ede-proj-makefile-target-name :AFTER this @@ -4013,7 +4013,7 @@ Type: @code{list} The commands used to execute this compiler. The object which uses this compiler will place these commands after -it's rule definition. +its rule definition. @item :autoconf Type: @code{list} @* @@ -4125,7 +4125,7 @@ Type: @code{list} The commands used to execute this compiler. The object which uses this compiler will place these commands after -it's rule definition. +its rule definition. @item :objectextention Type: @code{string} @@ -4265,7 +4265,7 @@ Type: @code{list} The commands used to execute this compiler. The object which uses this compiler will place these commands after -it's rule definition. +its rule definition. @item :objectextention Type: @code{string} diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index 55010d4e430..d4be7b1f0ce 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -284,7 +284,7 @@ what's this? @subsubheading Answer You get the message described in the q/a pair above while -starting Gnus, right? It's an other symptom for the same +starting Gnus, right? It's another symptom for the same problem, so read the answer above. @node FAQ 2-3 diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index a0c57329433..4ee80eacb2e 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -9394,7 +9394,7 @@ function must return @code{mid}, @code{mail}, @code{invalid} or @item gnus-button-mid-or-mail-heuristic @findex gnus-button-mid-or-mail-heuristic Function that guesses whether its argument is a message ID or a mail -address. Returns @code{mid} if it's a message IDs, @code{mail} if +address. Returns @code{mid} if it's a message ID, @code{mail} if it's a mail address, @code{ask} if unsure and @code{invalid} if the string is invalid. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 9cd5a1f6435..4eb6249490e 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -7504,7 +7504,7 @@ must return `mid', `mail', `invalid' or `ask'." (2.0 . "^[A-Z][a-z][A-Z][a-z][a-z][^a-z]")) ;; ^[A-Z][a-z]{4,4} "An alist of (RATE . REGEXP) pairs for `gnus-button-mid-or-mail-heuristic'. -A negative RATE indicates a message IDs, whereas a positive indicates a mail +A negative RATE indicates a message ID, whereas a positive indicates a mail address. The REGEXP is processed with `case-fold-search' set to nil." :version "22.1" :group 'gnus-article-buttons @@ -7513,7 +7513,7 @@ address. The REGEXP is processed with `case-fold-search' set to nil." (defun gnus-button-mid-or-mail-heuristic (mid-or-mail) "Guess whether MID-OR-MAIL is a message ID or a mail address. -Returns `mid' if MID-OR-MAIL is a message IDs, `mail' if it's a mail +Returns `mid' if MID-OR-MAIL is a message ID, `mail' if it's a mail address, `ask' if unsure and `invalid' if the string is invalid." (let ((case-fold-search nil) (list gnus-button-mid-or-mail-heuristic-alist) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 0d166fb8ce0..d260bdb2a2c 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1741,7 +1741,7 @@ no, only reply back to the author." :type 'boolean) (defcustom message-user-fqdn nil - "Domain part of Message-Ids." + "Domain part of Message-IDs." :version "22.1" :group 'message-headers :link '(custom-manual "(message)News Headers") From dbf1837940b090151b389235c1fc3617aef48234 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 6 Mar 2019 14:45:05 +0100 Subject: [PATCH 06/15] * lisp/window.el (fit-frame-to-buffer): Make doc-string more accurate. --- lisp/window.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index 4b30609681c..8c04e010678 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8026,10 +8026,13 @@ Return 0 otherwise." (defun fit-frame-to-buffer (&optional frame max-height min-height max-width min-width only) "Adjust size of FRAME to display the contents of its buffer exactly. FRAME can be any live frame and defaults to the selected one. -Fit only if FRAME's root window is live. MAX-HEIGHT, MIN-HEIGHT, -MAX-WIDTH and MIN-WIDTH specify bounds on the new total size of -FRAME's root window. MIN-HEIGHT and MIN-WIDTH default to the values of -`window-min-height' and `window-min-width' respectively. +Fit only if FRAME's root window is live. + +MAX-HEIGHT, MIN-HEIGHT, MAX-WIDTH and MIN-WIDTH specify bounds on +the new total size of FRAME's root window. MIN-HEIGHT and +MIN-WIDTH default to the values of `window-min-height' and +`window-min-width' respectively. These arguments are specified +in the canonical character width and height of FRAME. If the optional argument ONLY is `vertically', resize the frame vertically only. If ONLY is `horizontally', resize the frame From 2848623420e0478ae5ffda8d79af9fde0128dfbe Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 7 Mar 2019 17:16:43 +0200 Subject: [PATCH 07/15] Avoid undefined behavior in gdb-mi.el * lisp/progmodes/gdb-mi.el (gdb-send): Don't call match-string if this is not a control command. (Bug#34769) --- lisp/progmodes/gdb-mi.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index b63f82b7222..69eb29c5eb1 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1849,7 +1849,7 @@ commands to be prefixed by \"-interpreter-exec console\".") ;; Python and Guile commands that have an argument don't enter the ;; recursive reading loop. (let* ((control-command-p (string-match gdb-control-commands-regexp string)) - (command-arg (match-string 3 string)) + (command-arg (and control-command-p (match-string 3 string))) (python-or-guile-p (string-match gdb-python-guile-commands-regexp string))) (if (and control-command-p From f1bddc78230625dfd4087a0f3ae4d4f592e10672 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 8 Mar 2019 11:45:55 +0200 Subject: [PATCH 08/15] * lisp/frame.el (make-frame-command): Doc fix. (Bug#34715) --- lisp/frame.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/frame.el b/lisp/frame.el index 545d2665365..9438b4a72ed 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -597,7 +597,9 @@ If DISPLAY is nil, that stands for the selected frame's display." (defun make-frame-command () "Make a new frame, on the same terminal as the selected frame. If the terminal is a text-only terminal, this also selects the -new frame." +new frame. + +When called from Lisp, returns the new frame." (interactive) (if (display-graphic-p) (make-frame) From f0be0f1bed9949fab2773d352917a6a610045795 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 8 Mar 2019 12:21:29 +0200 Subject: [PATCH 09/15] Improve documentation of 'delete-windows-on' * doc/emacs/windows.texi (Change Window): Document 'delete-windows-on'. * lisp/window.el (delete-windows-on): Doc fix. (Bug#34749) --- doc/emacs/windows.texi | 7 +++++++ lisp/window.el | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 27077ff9ec1..c4c724e6bc2 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -255,6 +255,8 @@ Delete all windows in the selected frame except the selected window Delete the selected window and kill the buffer that was showing in it (@code{kill-buffer-and-window}). The last character in this key sequence is a zero. +@item M-x delete-windows-on @key{RET} @var{buffer} @key{RET} +Delete windows showing the specified @var{buffer}. @item C-x ^ Make selected window taller (@code{enlarge-window}). @item C-x @} @@ -290,6 +292,11 @@ selected window. whole frame. (This command cannot be used while the minibuffer window is active; attempting to do so signals an error.) + @kbd{M-x delete-windows-on} deletes windows that show a specific +buffer. It prompts for the buffer, defaulting to the current buffer. +With prefix argument of zero, @kbd{C-u 0}, this command deletes +windows only on the current display's frames. + @cindex resize window @cindex resizing windows @kindex C-x ^ diff --git a/lisp/window.el b/lisp/window.el index 8c04e010678..907b3d038fc 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4684,6 +4684,8 @@ displayed there." BUFFER-OR-NAME may be a buffer or the name of an existing buffer and defaults to the current buffer. +Interactively, prompt for the buffer. + The following non-nil values of the optional argument FRAME have special meanings: @@ -4700,6 +4702,10 @@ have special meanings: Any other value of FRAME means consider all windows on all frames. +Interactively, FRAME is the prefix argument, so you can +use \\[universal-argument] 0 to specify all windows only on +the current terminal's frames. + When a window showing BUFFER-OR-NAME is dedicated and the only window of its frame, that frame is deleted when there are other frames left." From 60b5c1090d4b378146597418627049ae574856e6 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 8 Mar 2019 19:04:35 +0100 Subject: [PATCH 10/15] Provide more details in doc-string of 'delete-windows-on' (Bug#34749) * lisp/window.el (delete-windows-on): Provide more details in doc-string (Bug#34749). --- lisp/window.el | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index 907b3d038fc..58e22a2306a 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4706,9 +4706,21 @@ Interactively, FRAME is the prefix argument, so you can use \\[universal-argument] 0 to specify all windows only on the current terminal's frames. -When a window showing BUFFER-OR-NAME is dedicated and the only -window of its frame, that frame is deleted when there are other -frames left." +If a frame's root window shows the buffer specified by +BUFFER-OR-NAME and is dedicated to that buffer and that frame +does not host the active minibuffer window and there is at least +one other frame on that frame's terminal, delete that frame. +Otherwise, do not delete a frame's root window if it shows the +buffer specified by BUFFER-OR-NAME and do not delete any frame's +main window showing that buffer either. Rather, in any such +case, call `switch-to-prev-buffer' to show another buffer in that +window and make sure the window is no more dedicated to its +buffer. + +If the buffer specified by BUFFER-OR-NAME is shown in a +minibuffer window, do nothing for that window. For any window +that does not show that buffer, remove the buffer from that +window's lists of previous and next buffers." (interactive "BDelete windows on (buffer):\nP") (let ((buffer (window-normalize-buffer buffer-or-name)) ;; Handle the "inverted" meaning of the FRAME argument wrt other From 464ee80eac364e5febca88a7ded46cdd9c3a4f10 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 8 Mar 2019 19:10:27 +0100 Subject: [PATCH 11/15] Warn against recursive invocations of 'buffer-list-update-hook' (Bug#34765) * src/buffer.c (Vbuffer_list_update_hook): * doc/lispref/buffers.texi (Buffer List): Warn against recursive invocations of 'buffer-list-update-hook' (Bug#34765). --- doc/lispref/buffers.texi | 4 ++++ src/buffer.c | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index d97a095f686..6ad1fb1824a 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -940,6 +940,10 @@ This is a normal hook run whenever the buffer list changes. Functions (@pxref{Creating Buffers}), @code{rename-buffer} (@pxref{Buffer Names}), @code{kill-buffer} (@pxref{Killing Buffers}), @code{bury-buffer} (see above) and @code{select-window} (@pxref{Selecting Windows}). + +Functions run by this hook should avoid calling @code{select-window} +with a nil @var{norecord} argument or @code{with-temp-buffer} since +either may lead to infinite recursion. @end defvar @node Creating Buffers diff --git a/src/buffer.c b/src/buffer.c index 4ab5d4efe30..12620f0d4aa 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -6236,9 +6236,11 @@ The function `kill-all-local-variables' runs this before doing anything else. * DEFVAR_LISP ("buffer-list-update-hook", Vbuffer_list_update_hook, doc: /* Hook run when the buffer list changes. -Functions running this hook are, `get-buffer-create', -`make-indirect-buffer', `rename-buffer', `kill-buffer', -`bury-buffer-internal' and `select-window'. */); +Functions (implicitly) running this hook are `get-buffer-create', +`make-indirect-buffer', `rename-buffer', `kill-buffer', `bury-buffer' +and `select-window'. Functions run by this hook should avoid calling +`select-window' with a nil NORECORD argument or `with-temp-buffer' +since either may lead to infinite recursion. */); Vbuffer_list_update_hook = Qnil; DEFSYM (Qbuffer_list_update_hook, "buffer-list-update-hook"); From a38da0d4e532c7a8ce8f20ee5e95a50fce162469 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Fri, 8 Mar 2019 18:07:48 +0000 Subject: [PATCH 12/15] cc-mode.texi: Work around makeinfo alignment bug. Fix problem with ss index * doc/misc/cc-mode.texi (top level): Using txicommandconditionals to differentiate between the C and perl versions of Texinfo, create an "ss index" unless we are both using the C Texinfo and are building the .dvi output format. (Config Basics): Work around a perl Texinfo alignment bug by writing a separate version of an item list structure for this version, simplifying it considerably. --- doc/misc/cc-mode.texi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 47ae83ab396..0c77cc0ee61 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -148,7 +148,17 @@ CC Mode @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @comment Define an index for syntactic symbols. +@c Version for Texinfo <= 4.x +@ifclear txicommandconditionals +@ifnottex @c In texi2dvi, the @defindex would create an empty cc-mode.ss + @c For Info, unlike tex, @syncodeindex needs a matching @defindex. @defindex ss +@end ifnottex +@end ifclear +@c Version for Texinfo >= 5.x +@ifset txicommandconditionals +@defindex ss +@end ifset @comment Combine key, syntactic symbol and concept indices into one. @syncodeindex ss cp @@ -2282,6 +2292,8 @@ method, ``Top-level commands or the customization interface''. If you make conflicting settings in several of these ways, the way that takes precedence is the one that appears latest in this list: +@c Version of list for Texinfo <= 4.x +@ifclear txicommandconditionals @itemize @w{} @item @table @asis @@ -2292,6 +2304,18 @@ that takes precedence is the one that appears latest in this list: @itemx File Local Variable setting @end table @end itemize +@end ifclear +@c Version of list for Texinfo >= 5.x +@ifset txicommandconditionals +@itemize @asis +@item Style +@item File Style@footnote{In earlier versions of @ccmode{}, a File Style setting took precedence over any other setting apart from a File Local Variable setting.} +@item Top-level command or ``customization interface'' +@item Hook +@item File Local Variable setting +@end itemize +@end ifset + Here is a summary of the different ways of writing your configuration settings: From a3b193516f991ceaf79d33c6158dd7ef060c7bce Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 9 Mar 2019 09:47:07 +0100 Subject: [PATCH 13/15] Mention empty strings in file name expansion, emacs lisp reference * doc/lispref/files.texi (Files, File Name Expansion): Mention also empty strings. --- doc/lispref/files.texi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 403a21b3365..380e0543ddd 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -16,7 +16,7 @@ described in @ref{Backups and Auto-Saving}. names. A file name is a string. Most of these functions expand file name arguments using the function @code{expand-file-name}, so that @file{~} is handled correctly, as are relative file names (including -@file{../}). @xref{File Name Expansion}. +@file{../} and the empty string). @xref{File Name Expansion}. In addition, certain @dfn{magic} file names are handled specially. For example, when a remote file name is specified, Emacs accesses the @@ -2409,6 +2409,17 @@ This is for the sake of filesystems that have the concept of a superroot above the root directory @file{/}. On other filesystems, @file{/../} is interpreted exactly the same as @file{/}. +Expanding @file{.} or the empty string returns the default directory: + +@example +@group +(expand-file-name "." "/usr/spool/") + @result{} "/usr/spool" +(expand-file-name "" "/usr/spool/") + @result{} "/usr/spool" +@end group +@end example + Note that @code{expand-file-name} does @emph{not} expand environment variables; only @code{substitute-in-file-name} does that: From 82d4b9872fe848db8645b4ed3c11944f28bcdb79 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 9 Mar 2019 12:51:33 +0200 Subject: [PATCH 14/15] Avoid errors in Auto Revert mode * lisp/autorevert.el (auto-revert-buffers): Cancel auto-revert-timer only if it is non-nil. This avoids errors on first invocation of Auto-Revert mode. --- lisp/autorevert.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/autorevert.el b/lisp/autorevert.el index d1b8f94a8e2..242344fe9d1 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -813,7 +813,8 @@ the timer when no buffers need to be checked." ;; Check if we should cancel the timer. (when (and (not global-auto-revert-mode) (null auto-revert-buffer-list)) - (cancel-timer auto-revert-timer) + (if (timerp auto-revert-timer) + (cancel-timer auto-revert-timer)) (setq auto-revert-timer nil))))) From 0589de55c465627c16314519568f22daa62ff654 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 9 Mar 2019 13:20:28 +0200 Subject: [PATCH 15/15] Fix markup of fake keys in the ELisp manual * doc/lispref/keymaps.texi (Menu Bar, Tool Bar): Fix markup of fake keys. (Bug#34785) --- doc/lispref/keymaps.texi | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index ccc75a9c7af..d839be0e932 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -2502,7 +2502,7 @@ can do it this way: Emacs usually shows a @dfn{menu bar} at the top of each frame. @xref{Menu Bars,,,emacs, The GNU Emacs Manual}. Menu bar items are -subcommands of the fake function key @code{menu-bar}, as defined +subcommands of the fake function key @key{MENU-BAR}, as defined in the active keymaps. To add an item to the menu bar, invent a fake function key of your @@ -2554,9 +2554,10 @@ bar item: @end example @noindent -Here, @code{edit} is the fake function key used by the global map for -the @samp{Edit} menu bar item. The main reason to suppress a global -menu bar item is to regain space for mode-specific items. +Here, @code{edit} is the symbol produced by a fake function key, it is +used by the global map for the @samp{Edit} menu bar item. The main +reason to suppress a global menu bar item is to regain space for +mode-specific items. @defvar menu-bar-final-items Normally the menu bar shows global items followed by items defined by the @@ -2601,7 +2602,7 @@ If the value is @code{grow-only}, the tool bar expands automatically, but does not contract automatically. The tool bar contents are controlled by a menu keymap attached to a -fake function key called @code{tool-bar} (much like the way the menu +fake function key called @key{TOOL-BAR} (much like the way the menu bar is controlled). So you define a tool bar item using @code{define-key}, like this: