summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/custom.el10
-rw-r--r--src/frame.c10
-rw-r--r--test/lisp/custom-tests.el38
-rw-r--r--test/lisp/net/tramp-tests.el4
4 files changed, 55 insertions, 7 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index 3f1e8cacb28..0b2b325bdaf 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 512aaf5f45c..b33c521fb67 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 7691f167738..232e3bed439 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 00d08ea6f67..b2e8cc19459 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))))))