From 04cad5e8eac6fee415c0951d673e8a27534e727d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 2 Mar 2019 10:32:06 +0200 Subject: 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(-) (limited to 'lisp') 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)) -- cgit v1.2.1 From f872b65b2f6b83f3cee2eb0e80cb296d1de99505 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 2 Mar 2019 10:42:29 +0200 Subject: 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. --- lisp/international/mule.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp') 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 -- cgit v1.2.1 From 099ef446c2c1014727cfe98268fe468eb2e8828b Mon Sep 17 00:00:00 2001 From: Basil L. Contovounesios Date: Tue, 5 Mar 2019 20:24:41 +0000 Subject: 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. --- lisp/gnus/gnus-art.el | 4 ++-- lisp/gnus/message.el | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') 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") -- cgit v1.2.1 From dbf1837940b090151b389235c1fc3617aef48234 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 6 Mar 2019 14:45:05 +0100 Subject: * lisp/window.el (fit-frame-to-buffer): Make doc-string more accurate. --- lisp/window.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lisp') 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 -- cgit v1.2.1 From 2848623420e0478ae5ffda8d79af9fde0128dfbe Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 7 Mar 2019 17:16:43 +0200 Subject: 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(-) (limited to 'lisp') 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 -- cgit v1.2.1 From f1bddc78230625dfd4087a0f3ae4d4f592e10672 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 8 Mar 2019 11:45:55 +0200 Subject: * lisp/frame.el (make-frame-command): Doc fix. (Bug#34715) --- lisp/frame.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp') 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) -- cgit v1.2.1 From f0be0f1bed9949fab2773d352917a6a610045795 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 8 Mar 2019 12:21:29 +0200 Subject: 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) --- lisp/window.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp') 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." -- cgit v1.2.1 From 60b5c1090d4b378146597418627049ae574856e6 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 8 Mar 2019 19:04:35 +0100 Subject: 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(-) (limited to 'lisp') 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 -- cgit v1.2.1 From 82d4b9872fe848db8645b4ed3c11944f28bcdb79 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 9 Mar 2019 12:51:33 +0200 Subject: 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(-) (limited to 'lisp') 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))))) -- cgit v1.2.1