]> code.delx.au - gnu-emacs/commitdiff
To fixes wrt window selection and buffer list.
authorMartin Rudalics <rudalics@gmx.at>
Sat, 16 Jul 2011 13:02:51 +0000 (15:02 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Sat, 16 Jul 2011 13:02:51 +0000 (15:02 +0200)
* 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.

lisp/ChangeLog
lisp/frame.el
lisp/window.el

index 5efd11e542bc0f262732da7f868178f761cba9a8..d22a6f081cdd79015afcb23943b29caefe9b449d 100644 (file)
@@ -1,3 +1,11 @@
+2011-07-16  Martin Rudalics  <rudalics@gmx.at>
+
+       * 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  <rgm@gnu.org>
 
        * subr.el (read-char-choice): Allow quitting.  (Bug#9001)
index d6f82750347991052f97533c3210a98890b259ae..8fea4f051478bf6cdf5d1ae9cdb7dd6c2e80bac4 100644 (file)
@@ -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))
index 4f21bb053972a8f3f7ac9309339dbf2a66a5d95d..b4b900287e145ceba4db9f0ee2d9c1f369f09bd4 100644 (file)
@@ -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)