aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-09-22 21:42:40 -0400
committerChong Yidong2011-09-22 21:42:40 -0400
commit97adfb975605aa3a56a556fc4bf6a15c8a53792a (patch)
tree0bb27bd4796c55af4b3cab6b248d6fc29a49d6b7
parentd4ef2b502ceec1fce8b839ececcb7e781a237880 (diff)
downloademacs-97adfb975605aa3a56a556fc4bf6a15c8a53792a.tar.gz
emacs-97adfb975605aa3a56a556fc4bf6a15c8a53792a.zip
* window.el (pop-to-buffer): Ensure right window is selected if we chose another frame.
Otherwise, C-x 5 b might not select the right window if reusing a window on another frame.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/window.el9
2 files changed, 9 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cfa2035db91..ceef0b7f9b2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-09-23 Chong Yidong <cyd@stupidchicken.com>
2
3 * window.el (pop-to-buffer): Ensure right window is selected if we
4 chose another frame.
5
12011-09-22 Eli Zaretskii <eliz@gnu.org> 62011-09-22 Eli Zaretskii <eliz@gnu.org>
2 7
3 * simple.el (what-cursor-position): Use get-char-property-change 8 * simple.el (what-cursor-position): Use get-char-property-change
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."
4853 (old-frame (selected-frame)) 4853 (old-frame (selected-frame))
4854 (window (display-buffer buffer action)) 4854 (window (display-buffer buffer action))
4855 (frame (window-frame window))) 4855 (frame (window-frame window)))
4856 (if (eq frame old-frame) 4856 ;; If we chose another frame, make sure it gets input focus.
4857 ;; Make sure new window is selected (Bug#8615), (Bug#6954). 4857 (unless (eq frame old-frame)
4858 (select-window window norecord)
4859 ;; If `display-buffer' has chosen another frame, make sure it
4860 ;; gets input focus.
4861 (select-frame-set-input-focus frame norecord)) 4858 (select-frame-set-input-focus frame norecord))
4859 ;; Make sure new window is selected (Bug#8615), (Bug#6954).
4860 (select-window window norecord)
4862 buffer)) 4861 buffer))
4863 4862
4864(defun pop-to-buffer-same-window (buffer &optional norecord) 4863(defun pop-to-buffer-same-window (buffer &optional norecord)