From a769e627ec3990b2d85cc919756f79939acc67e0 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 23 Dec 2007 16:07:54 +0000 Subject: [PATCH] (switch-to-buffer-other-frame): Return the buffer switched to. --- lisp/ChangeLog | 5 +++++ lisp/files.el | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 365f904a556..3318099623a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-12-23 Andreas Schwab + + * files.el (switch-to-buffer-other-frame): Return the buffer + switched to. + 2007-12-23 Michael Albinus Sync with Tramp 2.1.12. diff --git a/lisp/files.el b/lisp/files.el index 0aec833445d..e475f4350ba 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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. -- 2.39.2