commit f28c20905591670bf8a0bd6c86ebe4d8003b193b (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Sun Apr 7 10:10:52 2019 +0200 Fix typo in tramp.texi * doc/misc/tramp.texi (Change file name syntax) (Frequently Asked Questions): '.' or ',' must follow xref. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 771ff1c08e..e376fc7495 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2671,7 +2671,7 @@ name syntax. Its value changes after every call of this variable in external packages, a call of @code{file-remote-p} is much more appropriate. @ifinfo -@pxref{Magic File Names, , , elisp} +@pxref{Magic File Names, , , elisp}. @end ifinfo @end defvar @end ifset @@ -3720,7 +3720,7 @@ Set @code{file-precious-flag} to @code{t} for files accessed by @value{tramp} so the file contents are checked using checksum by first saving to a temporary file. @ifinfo -@pxref{Saving Buffers, , , elisp} +@pxref{Saving Buffers, , , elisp}. @end ifinfo @lisp commit 7e1ad6360e625c61e6b6898996269dd0606a7153 Author: Michael Albinus Date: Sun Apr 7 10:10:30 2019 +0200 * lisp/net/tramp.el (tramp-parse-group): Rename third arg to SKIP-CHARS. (tramp-parse-sconfig-group): Fix thinko. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 0fc2d33d22..32963ac543 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2801,14 +2801,14 @@ for all methods. Resulting data are derived from default settings." :port method :require '(:port) :max most-positive-fixnum)))) ;; Generic function. -(defun tramp-parse-group (regexp match-level skip-regexp) +(defun tramp-parse-group (regexp match-level skip-chars) "Return a (user host) tuple allowed to access. User is always nil." (let (result) (when (re-search-forward regexp (point-at-eol) t) (setq result (list nil (match-string match-level)))) (or - (> (skip-chars-forward skip-regexp) 0) + (> (skip-chars-forward skip-chars) 0) (forward-line 1)) result)) @@ -2864,7 +2864,7 @@ User is always nil." (tramp-parse-group (concat "\\(?:^[ \t]*Host\\)" "\\|" "\\(?:^.+\\)" "\\|" "\\(" tramp-host-regexp "\\)") - 1 "[ \t]+")) + 1 " \t")) ;; Generic function. (defun tramp-parse-shostkeys-sknownhosts (dirname regexp) commit 0c16bb5a39b38c48374bc3ad4ca99208ff329d46 Author: Alexander Gramiak Date: Tue Apr 2 11:14:18 2019 -0600 * lisp/frame.el (display-planes): Use logb over truncate + log Suggested by Basil L. Contovounesios: https://lists.gnu.org/archive/html/bug-gnu-emacs/2019-03/msg01052.html diff --git a/lisp/frame.el b/lisp/frame.el index aa14e87d7b..b39891cd14 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2093,7 +2093,7 @@ If DISPLAY is omitted or nil, it defaults to the selected frame's display." ((eq frame-type 'pc) 4) (t - (truncate (log (length (tty-color-alist)) 2)))))) + (logb (length (tty-color-alist))))))) (declare-function x-display-color-cells "xfns.c" (&optional terminal)) commit b68405405e5ee4ce7326e6ef32afbde48bafd7fe Author: Alexander Gramiak Date: Wed Apr 3 14:06:45 2019 -0600 Introduce new defcustom for terminal CUA rectangle commands This allows a user to set a non-meta modifier for their terminal should his/her terminal support it. See bug#35058 for background on this change. * lisp/emulation/cua-base.el (cua-rectangle-terminal-modifier-key): New defcustom. * lisp/emulation/cua-base.el (cua--shift-control-x-prefix): Use new defcustom. diff --git a/etc/NEWS b/etc/NEWS index be4543c016..c7456c681a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1252,6 +1252,13 @@ near the current column in Tabulated Lists (see variables +++ *** 'text-mode-variant' is now obsolete, use 'derived-mode-p' instead. +** CUA mode + +--- +*** New defcustom 'cua-rectangle-terminal-modifier-key'. +This defcustom allows for the customization of the modifier key used +in a terminal frame. + * New Modes and Packages in Emacs 27.1 diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index 302ef12386..105e1ab43d 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -427,7 +427,7 @@ and after the region marked by the rectangle to search." (defcustom cua-rectangle-modifier-key 'meta "Modifier key used for rectangle commands bindings. -On non-window systems, always use the meta modifier. +On non-window systems, use `cua-rectangle-terminal-modifier-key'. Must be set prior to enabling CUA." :type '(choice (const :tag "Meta key" meta) (const :tag "Alt key" alt) @@ -435,6 +435,16 @@ Must be set prior to enabling CUA." (const :tag "Super key" super)) :group 'cua) +(defcustom cua-rectangle-terminal-modifier-key 'meta + "Modifier key used for rectangle commands bindings in terminals. +Must be set prior to enabling CUA." + :type '(choice (const :tag "Meta key" meta) + (const :tag "Alt key" alt) + (const :tag "Hyper key" hyper) + (const :tag "Super key" super)) + :group 'cua + :version "27.1") + (defcustom cua-enable-rectangle-auto-help t "If non-nil, automatically show help for region, rectangle and global mark." :type 'boolean @@ -1237,10 +1247,9 @@ If ARG is the atom `-', scroll upward by nearly full screen." (defun cua--init-keymaps () ;; Cache actual rectangle modifier key. (setq cua--rectangle-modifier-key - (if (and cua-rectangle-modifier-key - (memq window-system '(x))) - cua-rectangle-modifier-key - 'meta)) + (if (eq (framep (selected-frame)) t) + cua-rectangle-terminal-modifier-key + cua-rectangle-modifier-key)) ;; C-return always toggles rectangle mark (define-key cua-global-keymap cua-rectangle-mark-key 'cua-set-rectangle-mark) (unless (eq cua--rectangle-modifier-key 'meta) commit cffc04c48dfed59ab9d958b9b64948d5fa491fbe Author: Alexander Gramiak Date: Wed Apr 3 14:03:28 2019 -0600 Define and use new procedure display-symbol-keys-p * lisp/frame.el (display-symbol-keys-p): Define. * lisp/simple.el (normal-erase-is-backspace-setup-frame): Use eq instead of memq. (normal-erase-is-backspace-mode): Use display-symbol-keys-p. diff --git a/etc/NEWS b/etc/NEWS index 26c761ae01..be4543c016 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1230,6 +1230,12 @@ the 128...255 range, as expected. This allows to create and parent immediately a minibuffer-only child frame when making a frame. +--- +*** New predicates 'display-blink-cursor-p' and 'display-symbol-keys-p'. +These predicates are to be preferred over 'display-graphic-p' when +testing for blinking cursor capability and the capability to have +symbols (e.g., [return], [tab], [backspace]) as keys respectively. + ** Tabulated List mode +++ diff --git a/lisp/frame.el b/lisp/frame.el index cc8ca49b3b..aa14e87d7b 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1927,6 +1927,16 @@ frame's display)." (t nil)))) +(defun display-symbol-keys-p (&optional display) + "Return non-nil if DISPLAY supports symbol names as keys. +This means that, for example, DISPLAY can differentiate between +the keybinding RET and [return]." + (let ((frame-type (framep-on-display display))) + (or (memq frame-type '(x w32 ns pc)) + ;; MS-DOS and MS-Windows terminals have built-in support for + ;; function (symbol) keys + (memq system-type '(ms-dos windows-nt))))) + (declare-function x-display-screens "xfns.c" (&optional terminal)) (defun display-screens (&optional display) diff --git a/lisp/simple.el b/lisp/simple.el index 306df96766..857e0fc001 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8690,7 +8690,7 @@ call `normal-erase-is-backspace-mode' (which see) instead." (and (not noninteractive) (or (memq system-type '(ms-dos windows-nt)) (memq window-system '(w32 ns)) - (and (memq window-system '(x)) + (and (eq window-system 'x) (fboundp 'x-backspace-delete-keys-p) (x-backspace-delete-keys-p)) ;; If the terminal Emacs is running on has erase char @@ -8701,6 +8701,8 @@ call `normal-erase-is-backspace-mode' (which see) instead." normal-erase-is-backspace) 1 0))))) +(declare-function display-symbol-keys-p "frame" (&optional display)) + (define-minor-mode normal-erase-is-backspace-mode "Toggle the Erase and Delete mode of the Backspace and Delete keys. @@ -8736,8 +8738,7 @@ See also `normal-erase-is-backspace'." (let ((enabled (eq 1 (terminal-parameter nil 'normal-erase-is-backspace)))) - (cond ((or (memq window-system '(x w32 ns pc)) - (memq system-type '(ms-dos windows-nt))) + (cond ((display-symbol-keys-p) (let ((bindings '(([M-delete] [M-backspace]) ([C-M-delete] [C-M-backspace]) commit c6ea522de62d6064d5be9dd1ddf69dceb6506780 Author: Alexander Gramiak Date: Wed Apr 3 14:03:42 2019 -0600 Define and use new alias display-blink-cursor-p display-graphic-p is not used in this case because it may be possible in the future for terminals to allow control over cursor blinking. For details, see bug#35058. * lisp/frame.el (blink-cursor-mode): Use display-blink-cursor-p. diff --git a/lisp/frame.el b/lisp/frame.el index acf6a46716..cc8ca49b3b 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1905,6 +1905,7 @@ frame's display)." (fboundp 'image-mask-p) (fboundp 'image-size))) +(defalias 'display-blink-cursor-p 'display-graphic-p) (defalias 'display-multi-frame-p 'display-graphic-p) (defalias 'display-multi-font-p 'display-graphic-p) @@ -2545,7 +2546,7 @@ terminals, cursor blinking is controlled by the terminal." :init-value (not (or noninteractive no-blinking-cursor (eq system-type 'ms-dos) - (not (memq window-system '(x w32 ns))))) + (not (display-blink-cursor-p)))) :initialize 'custom-initialize-delay :group 'cursor :global t commit 8f6e4798459a881b0a1602a1a0e30f0b73d49d22 Author: Alexander Gramiak Date: Wed Apr 3 13:57:16 2019 -0600 Use display-graphic-p and display-multi-frame-p in more cases * lisp/disp-table.el: * lisp/faces.el: * lisp/frame.el: * lisp/info.el (Info-fontify-node): * lisp/window.el (handle-select-window): Use display-graphic-p and display-multi-frame-p instead of explicit memq calls. diff --git a/lisp/disp-table.el b/lisp/disp-table.el index 476c0cb986..4a59750677 100644 --- a/lisp/disp-table.el +++ b/lisp/disp-table.el @@ -175,8 +175,8 @@ in the default way after this call." (defun standard-display-g1 (c sc) "Display character C as character SC in the g1 character set. This function assumes that your terminal uses the SO/SI characters; -it is meaningless for an X frame." - (if (memq window-system '(x w32 ns)) +it is meaningless for a graphical frame." + (if (display-graphic-p) (error "Cannot use string glyphs in a windowing system")) (or standard-display-table (setq standard-display-table (make-display-table))) @@ -186,9 +186,9 @@ it is meaningless for an X frame." ;;;###autoload (defun standard-display-graphic (c gc) "Display character C as character GC in graphics character set. -This function assumes VT100-compatible escapes; it is meaningless for an -X frame." - (if (memq window-system '(x w32 ns)) +This function assumes VT100-compatible escapes; it is meaningless +for a graphical frame." + (if (display-graphic-p) (error "Cannot use string glyphs in a windowing system")) (or standard-display-table (setq standard-display-table (make-display-table))) @@ -276,7 +276,7 @@ in `.emacs'." (progn (standard-display-default (unibyte-char-to-multibyte 160) (unibyte-char-to-multibyte 255)) - (unless (or (memq window-system '(x w32 ns))) + (unless (display-graphic-p) (and (terminal-coding-system) (set-terminal-coding-system nil)))) @@ -289,7 +289,7 @@ in `.emacs'." ;; unless some other has been specified. (if (equal current-language-environment "English") (set-language-environment "latin-1")) - (unless (or noninteractive (memq window-system '(x w32 ns))) + (unless (or noninteractive (display-graphic-p)) ;; Send those codes literally to a character-based terminal. ;; If we are using single-byte characters, ;; it doesn't matter which coding system we use. diff --git a/lisp/faces.el b/lisp/faces.el index ab6c384c80..fa526c3506 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -55,6 +55,7 @@ This means to treat a terminal of type TYPE as if it were of type ALIAS." :group 'terminals :version "25.1") +(declare-function display-graphic-p "frame" (&optional display)) (declare-function xw-defined-colors "term/common-win" (&optional frame)) (defvar help-xref-stack-item) @@ -1239,7 +1240,7 @@ of a global face. Value is the new attribute value." ;; explicitly in VALID, using color approximation code ;; in tty-colors.el. (when (and (memq attribute '(:foreground :background)) - (not (memq (window-system frame) '(x w32 ns))) + (not (display-graphic-p frame)) (not (member new-value '("unspecified" "unspecified-fg" "unspecified-bg")))) @@ -1833,7 +1834,7 @@ The argument FRAME specifies which frame to try. The value may be different for frames on different display types. If FRAME doesn't support colors, the value is nil. If FRAME is nil, that stands for the selected frame." - (if (memq (framep (or frame (selected-frame))) '(x w32 ns)) + (if (display-graphic-p frame) (xw-defined-colors frame) (mapcar 'car (tty-color-alist frame)))) (defalias 'x-defined-colors 'defined-colors) @@ -1877,7 +1878,7 @@ or one of the strings \"unspecified-fg\" or \"unspecified-bg\". If FRAME is omitted or nil, use the selected frame." (unless (member color '(unspecified "unspecified-bg" "unspecified-fg")) - (if (member (framep (or frame (selected-frame))) '(x w32 ns)) + (if (display-graphic-p frame) (xw-color-defined-p color frame) (numberp (tty-color-translate color frame))))) (defalias 'x-color-defined-p 'color-defined-p) @@ -1903,7 +1904,7 @@ return value is nil." (cond ((member color '(unspecified "unspecified-fg" "unspecified-bg")) nil) - ((memq (framep (or frame (selected-frame))) '(x w32 ns)) + ((display-graphic-p frame) (xw-color-values color frame)) (t (tty-color-values color frame)))) @@ -1917,7 +1918,7 @@ return value is nil." The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display." - (if (memq (framep-on-display display) '(x w32 ns)) + (if (display-graphic-p display) (xw-display-color-p display) (tty-display-color-p display))) (defalias 'x-display-color-p 'display-color-p) @@ -1928,12 +1929,9 @@ If omitted or nil, that stands for the selected frame's display." "Return non-nil if frames on DISPLAY can display shades of gray. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display." - (let ((frame-type (framep-on-display display))) - (cond - ((memq frame-type '(x w32 ns)) - (x-display-grayscale-p display)) - (t - (> (tty-color-gray-shades display) 2))))) + (if (display-graphic-p display) + (x-display-grayscale-p display) + (> (tty-color-gray-shades display) 2))) (defun read-color (&optional prompt convert-to-RGB allow-empty-name msg) "Read a color name or RGB triplet. diff --git a/lisp/frame.el b/lisp/frame.el index 6cb1247372..acf6a46716 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -974,7 +974,7 @@ recently selected windows nor the buffer list." (select-frame frame norecord) (raise-frame frame) ;; Ensure, if possible, that FRAME gets input focus. - (when (memq (window-system frame) '(x w32 ns)) + (when (display-multi-frame-p frame) (x-focus-frame frame)) ;; Move mouse cursor if necessary. (cond @@ -1027,16 +1027,15 @@ that variable should be nil." "Do whatever is right to suspend the current frame. Calls `suspend-emacs' if invoked from the controlling tty device, `suspend-tty' from a secondary tty device, and -`iconify-or-deiconify-frame' from an X frame." +`iconify-or-deiconify-frame' from a graphical frame." (interactive) - (let ((type (framep (selected-frame)))) - (cond - ((memq type '(x ns w32)) (iconify-or-deiconify-frame)) - ((eq type t) - (if (controlling-tty-p) - (suspend-emacs) - (suspend-tty))) - (t (suspend-emacs))))) + (cond + ((display-multi-frame-p) (iconify-or-deiconify-frame)) + ((eq (framep (selected-frame)) t) + (if (controlling-tty-p) + (suspend-emacs) + (suspend-tty))) + (t (suspend-emacs)))) (defun make-frame-names-alist () ;; Only consider the frames on the same display. diff --git a/lisp/info.el b/lisp/info.el index f2a064abb6..f3b413a2f9 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4768,7 +4768,7 @@ first line or header line, and for breadcrumb links.") ;; This is a serious problem for trying to handle multiple ;; frame types at once. We want this text to be invisible ;; on frames that can display the font above. - (when (memq (framep (selected-frame)) '(x pc w32 ns)) + (when (display-multi-font-p) (add-text-properties (1- (match-beginning 2)) (match-end 2) '(invisible t front-sticky nil rear-nonsticky t)))))) diff --git a/lisp/window.el b/lisp/window.el index b769be0633..b4f5ac5cc4 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9314,6 +9314,8 @@ is active. This function is run by `mouse-autoselect-window-timer'." ;; autoselection. (mouse-autoselect-window-start mouse-position window))))) +(declare-function display-multi-frame-p "frame" (&optional display)) + (defun handle-select-window (event) "Handle select-window events." (interactive "^e") @@ -9351,7 +9353,7 @@ is active. This function is run by `mouse-autoselect-window-timer'." ;; we might get two windows with an active cursor. (select-window window) (cond - ((or (not (memq (window-system frame) '(x w32 ns))) + ((or (not (display-multi-frame-p)) (not focus-follows-mouse) ;; Focus FRAME if it's either a child frame or an ancestor ;; of the frame switched from. commit 08235af38c92e95d8ec9d268916d8910ea50ab2d Author: Basil L. Contovounesios Date: Sun Apr 7 03:36:47 2019 +0100 Distinguish buttons from widgets (bug#34506) * lisp/button.el (button-at): * lisp/wid-edit.el (widget-at): Avoid returning a false positive when looking for a button and finding a widget, or vice versa. * test/lisp/button-tests.el: * test/lisp/wid-edit-tests.el: New files. diff --git a/lisp/button.el b/lisp/button.el index c46f3d9a52..921e84dfa6 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -382,10 +382,12 @@ Also see `make-text-button'." If the button at POS is a text property button, the return value is a marker pointing to POS." (let ((button (get-char-property pos 'button))) - (if (or (overlayp button) (null button)) - button - ;; Must be a text-property button; return a marker pointing to it. - (copy-marker pos t)))) + (and button (get-char-property pos 'category) + (if (overlayp button) + button + ;; Must be a text-property button; + ;; return a marker pointing to it. + (copy-marker pos t))))) (defun next-button (pos &optional count-current) "Return the next button after position POS in the current buffer. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 52c0b5b74d..b9f98cdc4c 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1163,8 +1163,9 @@ When not inside a field, signal an error." (defun widget-at (&optional pos) "The button or field at POS (default, point)." - (or (get-char-property (or pos (point)) 'button) - (widget-field-at pos))) + (let ((widget (or (get-char-property (or pos (point)) 'button) + (widget-field-at pos)))) + (and (widgetp widget) widget))) ;;;###autoload (defun widget-setup () diff --git a/test/lisp/button-tests.el b/test/lisp/button-tests.el new file mode 100644 index 0000000000..d54a992ab8 --- /dev/null +++ b/test/lisp/button-tests.el @@ -0,0 +1,40 @@ +;;; button-tests.el --- tests for button.el -*- lexical-binding: t -*- + +;; Copyright (C) 2019 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'ert) + +(ert-deftest button-at () + "Test `button-at' behavior." + (with-temp-buffer + (should-not (button-at (point))) + (let ((button (insert-text-button "text button")) + (marker (button-at (1- (point))))) + (should (markerp marker)) + (should (= (button-end button) (button-end marker) (point)))) + (let ((button (insert-button "overlay button")) + (overlay (button-at (1- (point))))) + (should (overlayp overlay)) + (should (eq button overlay))) + ;; Buttons and widgets are incompatible (bug#34506). + (widget-create 'link "link widget") + (should-not (button-at (1- (point)))))) + +;;; button-tests.el ends here diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el new file mode 100644 index 0000000000..a4350e715e --- /dev/null +++ b/test/lisp/wid-edit-tests.el @@ -0,0 +1,39 @@ +;;; wid-edit-tests.el --- tests for wid-edit.el -*- lexical-binding: t -*- + +;; Copyright (C) 2019 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'ert) +(require 'wid-edit) + +(ert-deftest widget-at () + "Test `widget-at' behavior." + (with-temp-buffer + (should-not (widget-at)) + (let ((marco (widget-create 'link "link widget")) + (polo (widget-at (1- (point))))) + (should (widgetp polo)) + (should (eq marco polo))) + ;; Buttons and widgets are incompatible (bug#34506). + (insert-text-button "text button") + (should-not (widget-at (1- (point)))) + (insert-button "overlay button") + (should-not (widget-at (1- (point)))))) + +;;; wid-edit-tests.el ends here commit 43f4c7ddd2077b2e786d069bbb9e2de32f23ffb2 Author: Stefan Monnier Date: Sat Apr 6 18:54:31 2019 -0400 * src/buffer.c (Fget_buffer_create): Apply booleans's eta-reduction diff --git a/src/buffer.c b/src/buffer.c index c5d8ee2629..ab47748191 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -584,12 +584,10 @@ even if it is dead. The return value is never nil. */) set_string_intervals (name, NULL); bset_name (b, name); - if (STRINGP (Vcode_conversion_workbuf_name) - && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), - SBYTES (Vcode_conversion_workbuf_name)) == 0) - b->inhibit_buffer_hooks = true; - else - b->inhibit_buffer_hooks = false; + b->inhibit_buffer_hooks + = (STRINGP (Vcode_conversion_workbuf_name) + && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), + SBYTES (Vcode_conversion_workbuf_name)) == 0); bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt); commit 7e4d4c069ce78d4bb82ae72f4b52897eab2b128a Author: Stefan Monnier Date: Sat Apr 6 18:44:24 2019 -0400 * lisp/subr.el (setq-default): Fix thinko Reported by Johan Bockgård diff --git a/lisp/subr.el b/lisp/subr.el index 8d51474b0c..45b3916196 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -138,7 +138,7 @@ This sets each VAR's default value to the corresponding VALUE. The VALUE for the Nth VAR can refer to the new default values of previous VARs. -\(setq-default [VAR VALUE]...)" +\(fn [VAR VALUE]...)" (declare (debug setq)) (let ((exps nil)) (while args commit 19919e0f32717638592c9f480ae970c100dfc91e Author: Glenn Morris Date: Sat Apr 6 12:57:44 2019 -0700 * doc/misc/tramp.texi (Remote processes): '.' or ',' must follow xref. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 264a64b26a..771ff1c08e 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3010,7 +3010,7 @@ Starting with Emacs 26, you could use connection-local variables for setting different values of @code{explicit-shell-file-name} for different remote hosts. @ifinfo -@xref{Connection Variables, , , emacs} +@xref{Connection Variables, , , emacs}. @end ifinfo @lisp commit 91018cec0157f649a0b4b5db7399e683e7089093 Author: Eli Zaretskii Date: Sat Apr 6 17:53:30 2019 +0300 Encode the FILENAME argument of 'file-locked-p' * src/filelock.c (Ffile_locked_p): Encode the file name, before passing it to system APIs. (Bug#35171) diff --git a/src/filelock.c b/src/filelock.c index 5cec199620..baf87b7f63 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -822,6 +822,7 @@ t if it is locked by you, else a string saying which user has locked it. */) USE_SAFE_ALLOCA; filename = Fexpand_file_name (filename, Qnil); + filename = ENCODE_FILE (filename); MAKE_LOCK_NAME (lfname, filename); commit 7dc0a06959ab5ebda2f2cc4ed31a1b66395e2cf9 Author: Basil L. Contovounesios Date: Sat Apr 6 02:41:16 2019 +0100 Don't leave inhibit_buffer_hooks uninitialized * src/buffer.c (Fget_buffer_create): Explicitly initialize inhibit_buffer_hooks. (bug#34847) diff --git a/src/buffer.c b/src/buffer.c index c0f7521c9e..c5d8ee2629 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -588,6 +588,8 @@ even if it is dead. The return value is never nil. */) && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), SBYTES (Vcode_conversion_workbuf_name)) == 0) b->inhibit_buffer_hooks = true; + else + b->inhibit_buffer_hooks = false; bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt); commit 47aae7cfe17c4a803c703ba237cf1c62d246766d Author: Eli Zaretskii Date: Sat Apr 6 16:16:32 2019 +0300 ; * src/w32fns.c (Fw32_read_registry): Doc fix. diff --git a/src/w32fns.c b/src/w32fns.c index 25900c54c8..af82b46305 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -10099,6 +10099,8 @@ It can also be nil, which means try `HKCU', and if that fails, try `HKLM'. KEY and NAME must be strings, and NAME must not include slashes. KEY can use either forward- or back-slashes. +To access the default value of KEY (if it is defined), use NAME +that is an empty string. If the the named KEY or its subkey called NAME don't exist, or cannot be accessed by the current user, the function returns nil. Otherwise, commit bcc6468b39916de6a3756c98e744ed5d0534eb40 Author: Michael Albinus Date: Sat Apr 6 11:36:34 2019 +0200 Fix Bug#34847 * lisp/autorevert.el (auto-revert-remove-current-buffer): Add optional argument BUFFER. (auto-revert-notify-rm-watch): Remove local hook. (auto-revert-buffers): Check `buffer-live-p' in time. (Bug#34847) diff --git a/lisp/autorevert.el b/lisp/autorevert.el index bc7c616ecb..e6dfafca2a 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -343,10 +343,11 @@ This has been reported by a file notification event.") ;; Functions: -(defun auto-revert-remove-current-buffer () - "Remove dead buffer from `auto-revert-buffer-list'." +(defun auto-revert-remove-current-buffer (&optional buffer) + "Remove BUFFER from `auto-revert-buffer-list'. +BUFFER defaults to `current-buffer'." (setq auto-revert-buffer-list - (delq (current-buffer) auto-revert-buffer-list))) + (delq (or buffer (current-buffer)) auto-revert-buffer-list))) ;;;###autoload (define-minor-mode auto-revert-mode @@ -509,7 +510,7 @@ will use an up-to-date value of `auto-revert-interval'" (ignore-errors (file-notify-rm-watch auto-revert-notify-watch-descriptor))))) auto-revert-notify-watch-descriptor-hash-list) - (remove-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch)) + (remove-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch t)) (setq auto-revert-notify-watch-descriptor nil auto-revert-notify-modified-p nil)) @@ -772,10 +773,12 @@ the timer when no buffers need to be checked." (setq bufs (delq nil (mapcar (lambda (buf) - (with-current-buffer buf - (and (or (not (file-remote-p default-directory)) - (file-remote-p default-directory nil t)) - buf))) + (and (buffer-live-p buf) + (with-current-buffer buf + (and + (or (not (file-remote-p default-directory)) + (file-remote-p default-directory nil t)) + buf)))) bufs))) ;; Partition `bufs' into two halves depending on whether or not ;; the buffers are in `auto-revert-remaining-buffers'. The two @@ -792,24 +795,23 @@ the timer when no buffers need to be checked." (not (and auto-revert-stop-on-user-input (input-pending-p)))) (let ((buf (car bufs))) - (with-current-buffer buf - (if (buffer-live-p buf) - (progn - ;; Test if someone has turned off Auto-Revert Mode - ;; in a non-standard way, for example by changing - ;; major mode. - (if (and (not auto-revert-mode) - (not auto-revert-tail-mode) - (memq buf auto-revert-buffer-list)) - (auto-revert-remove-current-buffer)) - (when (auto-revert-active-p) - ;; Enable file notification. - (when (and auto-revert-use-notify - (not auto-revert-notify-watch-descriptor)) - (auto-revert-notify-add-watch)) - (auto-revert-handler))) + (if (not (buffer-live-p buf)) ;; Remove dead buffer from `auto-revert-buffer-list'. - (auto-revert-remove-current-buffer)))) + (auto-revert-remove-current-buffer buf) + (with-current-buffer buf + ;; Test if someone has turned off Auto-Revert Mode + ;; in a non-standard way, for example by changing + ;; major mode. + (if (and (not auto-revert-mode) + (not auto-revert-tail-mode) + (memq buf auto-revert-buffer-list)) + (auto-revert-remove-current-buffer)) + (when (auto-revert-active-p) + ;; Enable file notification. + (when (and auto-revert-use-notify + (not auto-revert-notify-watch-descriptor)) + (auto-revert-notify-add-watch)) + (auto-revert-handler))))) (setq bufs (cdr bufs))) (setq auto-revert-remaining-buffers bufs) ;; Check if we should cancel the timer.