]> git.eshelyaron.com Git - emacs.git/commitdiff
(switch-to-buffer-other-frame): Return the buffer
authorAndreas Schwab <schwab@suse.de>
Sun, 23 Dec 2007 16:07:54 +0000 (16:07 +0000)
committerAndreas Schwab <schwab@suse.de>
Sun, 23 Dec 2007 16:07:54 +0000 (16:07 +0000)
switched to.

lisp/ChangeLog
lisp/files.el

index 365f904a556db0d8ee4749dac8750573c6069f25..3318099623a74c84b8e3c789487704a1ee954714 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-23  Andreas Schwab  <schwab@suse.de>
+
+       * files.el (switch-to-buffer-other-frame): Return the buffer
+       switched to.
+
 2007-12-23  Michael Albinus  <michael.albinus@gmx.de>
 
        Sync with Tramp 2.1.12.
index 0aec833445d22c9552e08b52c77abe3738934e25..e475f4350baa7de2645af882011d601384ff8b03 100644 (file)
@@ -1050,14 +1050,16 @@ documentation for additional customization information."
   "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.