1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

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
This commit is contained in:
Michael Albinus 2020-11-25 12:18:23 +01:00
commit e45ad6b08e
4 changed files with 55 additions and 7 deletions

View File

@ -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)

View File

@ -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);
}
}

View File

@ -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

View File

@ -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))))))