summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el9
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/window.el b/lisp/window.el
index fb74c439247..8a72c28f894 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4853,12 +4853,11 @@ at the front of the list of recently selected ones."
(old-frame (selected-frame))
(window (display-buffer buffer action))
(frame (window-frame window)))
- (if (eq frame old-frame)
- ;; Make sure new window is selected (Bug#8615), (Bug#6954).
- (select-window window norecord)
- ;; If `display-buffer' has chosen another frame, make sure it
- ;; gets input focus.
+ ;; If we chose another frame, make sure it gets input focus.
+ (unless (eq frame old-frame)
(select-frame-set-input-focus frame norecord))
+ ;; Make sure new window is selected (Bug#8615), (Bug#6954).
+ (select-window window norecord)
buffer))
(defun pop-to-buffer-same-window (buffer &optional norecord)