From: Martin Rudalics Date: Sat, 16 Jul 2011 13:02:51 +0000 (+0200) Subject: To fixes wrt window selection and buffer list. X-Git-Tag: emacs-pretest-24.0.90~104^2~233 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/be39b8cc93dca884ea46ec92f008a1bd2f27d53e?ds=sidebyside To fixes wrt window selection and buffer list. * frame.el (select-frame-set-input-focus): New argument NORECORD. * window.el (pop-to-buffer): Select window used even if it was selected before, see discussion of (Bug#8615), (Bug#6954). Pass argument NORECORD on to select-frame-set-input-focus. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5efd11e542..d22a6f081c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2011-07-16 Martin Rudalics + + * frame.el (select-frame-set-input-focus): New argument + NORECORD. + * window.el (pop-to-buffer): Select window used even if it was + selected before, see discussion of (Bug#8615), (Bug#6954). Pass + argument NORECORD on to select-frame-set-input-focus. + 2011-07-15 Glenn Morris * subr.el (read-char-choice): Allow quitting. (Bug#9001) diff --git a/lisp/frame.el b/lisp/frame.el index d6f8275034..8fea4f0514 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -747,12 +747,15 @@ the user during startup." (declare-function x-focus-frame "xfns.c" (frame)) -(defun select-frame-set-input-focus (frame) +(defun select-frame-set-input-focus (frame &optional norecord) "Select FRAME, raise it, and set input focus, if possible. If `mouse-autoselect-window' is non-nil, also move mouse pointer to FRAME's selected window. Otherwise, if `focus-follows-mouse' -is non-nil, move mouse cursor to FRAME." - (select-frame frame) +is non-nil, move mouse cursor to FRAME. + +Optional argument NORECORD means to neither change the order of +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)) diff --git a/lisp/window.el b/lisp/window.el index 4f21bb0539..b4b900287e 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -3272,7 +3272,7 @@ window." (defun split-window-side-by-side (&optional size) "Split selected window into two windows side by side. The selected window becomes the left one and gets SIZE columns. -SIZE negative means the right window gets -SIZE lines. +SIZE negative means the right window gets -SIZE columns. SIZE includes the width of the window's scroll bar; if there are no scroll bars, it includes the width of the divider column to @@ -5836,15 +5836,13 @@ additional information." new-window new-frame) (set-buffer buffer) (setq new-window (display-buffer buffer specifiers label)) - (unless (eq new-window old-window) - ;; `display-buffer' has chosen another window, select it. - (select-window new-window norecord) - (setq new-frame (window-frame new-window)) - (unless (eq new-frame old-frame) - ;; `display-buffer' has chosen another frame, make sure it gets - ;; input focus and is risen. - (select-frame-set-input-focus new-frame))) - + (setq new-frame (window-frame new-window)) + (if (eq old-frame new-frame) + ;; Make sure new-window gets selected (Bug#8615), (Bug#6954). + (select-window new-window norecord) + ;; `display-buffer' has chosen another frame, make sure it gets + ;; input focus and is risen. + (select-frame-set-input-focus new-frame norecord)) buffer)) (defsubst pop-to-buffer-same-window (&optional buffer-or-name norecord label)