emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/window.el,v


From: Martin Rudalics
Subject: [Emacs-diffs] Changes to emacs/lisp/window.el,v
Date: Thu, 11 Sep 2008 06:35:55 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Martin Rudalics <m061211>       08/09/11 06:35:55

Index: window.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/window.el,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -b -r1.151 -r1.152
--- window.el   10 Sep 2008 23:43:54 -0000      1.151
+++ window.el   11 Sep 2008 06:35:55 -0000      1.152
@@ -1029,6 +1029,9 @@
 already visible in the selected window, and ignore
 `same-window-regexps' and `same-window-buffer-names'.
 
+If the window to show BUFFER-OR-NAME is not on the selected
+frame, raise that window's frame and give it input focus.
+
 This function returns the buffer it switched to.  This uses the
 function `display-buffer' as a subroutine; see the documentation
 of `display-buffer' for additional customization information.
@@ -1043,9 +1046,21 @@
            (or (get-buffer buffer-or-name)
                (let ((buf (get-buffer-create buffer-or-name)))
                  (set-buffer-major-mode buf)
-                 buf)))))
+                 buf))))
+       (old-window (selected-window))
+       (old-frame (selected-frame))
+       new-window new-frame)
     (set-buffer buffer)
-    (select-window (display-buffer buffer other-window) norecord)
+    (setq new-window (display-buffer buffer other-window) norecord)
+    (unless (eq new-window old-window)
+      ;; `display-buffer' has chosen another window.
+      (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))
+      ;; Make sure the window chosen by `display-buffer' gets selected.
+      (select-window new-window))
     buffer))
 
 ;; I think this should be the default; I think people will prefer it--rms.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]