changeset 79611:3ae8c65e837d

(switch-to-buffer-other-frame): Return the buffer switched to.
author Andreas Schwab <schwab@suse.de>
date Sun, 23 Dec 2007 16:08:30 +0000
parents b482d54e2dd2
children a590ed3a83f6
files lisp/files.el
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Sun Dec 23 06:10:04 2007 +0000
+++ b/lisp/files.el	Sun Dec 23 16:08:30 2007 +0000
@@ -1010,14 +1010,16 @@
   "Switch to buffer BUFFER in another frame.
 Optional second arg NORECORD non-nil means
 do not put this buffer at the front of the list of recently selected ones.
+This function returns the buffer it switched to.
 
 This uses the function `display-buffer' as a subroutine; see its
 documentation for additional customization information."
   (interactive "BSwitch to buffer in other frame: ")
   (let ((pop-up-frames t)
 	same-window-buffer-names same-window-regexps)
-    (pop-to-buffer buffer t norecord)
-    (raise-frame (window-frame (selected-window)))))
+    (prog1
+	(pop-to-buffer buffer t norecord)
+      (raise-frame (window-frame (selected-window))))))
 
 (defun display-buffer-other-frame (buffer)
   "Switch to buffer BUFFER in another frame.