+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)
(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))
(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
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)