[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e45ad6b: Merge from origin/emacs-27
From: |
Michael Albinus |
Subject: |
master e45ad6b: Merge from origin/emacs-27 |
Date: |
Wed, 25 Nov 2020 06:18:46 -0500 (EST) |
branch: master
commit e45ad6b08e1e6639dfcca28c1a496df5b676f985
Merge: fe5ffb7 6442cdc
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
Merge from origin/emacs-27
6442cdc0e4 Revert extra focus redirection in do_switch_frame (Bug#24803)
fc4379f1ae Minor cleanup of tramp-tests.el on MS Windows
dea3d6aa18 Fix handling of defcustom :local tag
---
lisp/custom.el | 10 +++++++---
src/frame.c | 10 +++++++---
test/lisp/custom-tests.el | 38 ++++++++++++++++++++++++++++++++++++++
test/lisp/net/tramp-tests.el | 4 +++-
4 files changed, 55 insertions(+), 7 deletions(-)
diff --git a/lisp/custom.el b/lisp/custom.el
index 3f1e8ca..0b2b325 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -157,7 +157,9 @@ set to nil, as the value is no longer rogue."
(if (keywordp doc)
(error "Doc string is missing"))
(let ((initialize #'custom-initialize-reset)
- (requests nil))
+ (requests nil)
+ ;; Whether automatically buffer-local.
+ buffer-local)
(unless (memq :group args)
(custom-add-to-group (custom-current-group) symbol 'custom-variable))
(while args
@@ -183,7 +185,7 @@ set to nil, as the value is no longer rogue."
(put symbol 'safe-local-variable value))
((eq keyword :local)
(when (memq value '(t permanent))
- (make-variable-buffer-local symbol))
+ (setq buffer-local t))
(when (eq value 'permanent)
(put symbol 'permanent-local t)))
((eq keyword :type)
@@ -205,7 +207,9 @@ set to nil, as the value is no longer rogue."
(put symbol 'custom-requests requests)
;; Do the actual initialization.
(unless custom-dont-initialize
- (funcall initialize symbol default)))
+ (funcall initialize symbol default))
+ (when buffer-local
+ (make-variable-buffer-local symbol)))
(run-hooks 'custom-define-hook)
symbol)
diff --git a/src/frame.c b/src/frame.c
index 512aaf5..b33c521 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1426,11 +1426,15 @@ do_switch_frame (Lisp_Object frame, int track, int
for_deletion, Lisp_Object nor
if (FRAMEP (gfocus))
{
focus = FRAME_FOCUS_FRAME (XFRAME (gfocus));
- if ((FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
+ if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
/* Redirect frame focus also when FRAME has its minibuffer
- window on the selected frame (see Bug#24500). */
+ window on the selected frame (see Bug#24500).
+
+ Don't do that: It causes redirection problem with a
+ separate minibuffer frame (Bug#24803) and problems
+ when updating the cursor on such frames.
|| (NILP (focus)
- && EQ (FRAME_MINIBUF_WINDOW (f), sf->selected_window)))
+ && EQ (FRAME_MINIBUF_WINDOW (f), sf->selected_window))) */
Fredirect_frame_focus (gfocus, frame);
}
}
diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el
index 7691f16..232e3be 100644
--- a/test/lisp/custom-tests.el
+++ b/test/lisp/custom-tests.el
@@ -165,4 +165,42 @@
(enable-theme 'custom--test)
(should (equal settings (get 'custom--test 'theme-settings)))))
+(defcustom custom--test-local-option 'initial
+ "Buffer-local user option for testing."
+ :group 'emacs
+ :type '(choice (const initial) (const changed))
+ :local t)
+
+(defcustom custom--test-permanent-option 'initial
+ "Permanently local user option for testing."
+ :group 'emacs
+ :type '(choice (const initial) (const changed))
+ :local 'permanent)
+
+(ert-deftest custom-test-local-option ()
+ "Test :local user options."
+ ;; Initial default values.
+ (should (eq custom--test-local-option 'initial))
+ (should (eq custom--test-permanent-option 'initial))
+ (should (eq (default-value 'custom--test-local-option) 'initial))
+ (should (eq (default-value 'custom--test-permanent-option) 'initial))
+ (let ((obuf (current-buffer)))
+ (with-temp-buffer
+ ;; Changed buffer-local values.
+ (setq custom--test-local-option 'changed)
+ (setq custom--test-permanent-option 'changed)
+ (should (eq custom--test-local-option 'changed))
+ (should (eq custom--test-permanent-option 'changed))
+ (should (eq (default-value 'custom--test-local-option) 'initial))
+ (should (eq (default-value 'custom--test-permanent-option) 'initial))
+ (with-current-buffer obuf
+ (should (eq custom--test-local-option 'initial))
+ (should (eq custom--test-permanent-option 'initial)))
+ ;; Permanent variable remains unchanged.
+ (kill-all-local-variables)
+ (should (eq custom--test-local-option 'initial))
+ (should (eq custom--test-permanent-option 'changed))
+ (should (eq (default-value 'custom--test-local-option) 'initial))
+ (should (eq (default-value 'custom--test-permanent-option) 'initial)))))
+
;;; custom-tests.el ends here
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 00d08ea..b2e8cc1 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4466,7 +4466,9 @@ This tests also `make-symbolic-link', `file-truename' and
`add-name-to-file'."
(setq proc (start-file-process "test4" (current-buffer) nil))
(should (processp proc))
(should (equal (process-status proc) 'run))
- (should (stringp (process-tty-name proc)))))
+ ;; On MS Windows, `process-tty-name' returns nil.
+ (unless (tramp--test-windows-nt)
+ (should (stringp (process-tty-name proc))))))
;; Cleanup.
(ignore-errors (delete-process proc))))))