changeset 69600:73654dd795d4

(display-buffer-other-frame): New command. (ctl-x-4-map): Bind C-x 5 C-o to it.
author Richard M. Stallman <rms@gnu.org>
date Mon, 20 Mar 2006 15:05:19 +0000
parents 0b906e4eb64e
children 7f4f3a2e288b
files lisp/files.el
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Mon Mar 20 07:52:03 2006 +0000
+++ b/lisp/files.el	Mon Mar 20 15:05:19 2006 +0000
@@ -990,6 +990,20 @@
     (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.
+This uses the function `display-buffer' as a subroutine; see its
+documentation for additional customization information."
+  (interactive "BDisplay buffer in other frame: ")
+  (let ((pop-up-frames t)
+	same-window-buffer-names same-window-regexps
+        (old-window (selected-window))
+	new-window)
+    (setq new-window (display-buffer buffer t))
+    (lower-frame (window-frame new-window))
+    (make-frame-invisible (window-frame old-window))
+    (make-frame-visible (window-frame old-window))))
+
 (defvar find-file-default nil
   "Used within `find-file-read-args'.")
 
@@ -5137,6 +5151,7 @@
 (define-key ctl-x-5-map "f" 'find-file-other-frame)
 (define-key ctl-x-5-map "\C-f" 'find-file-other-frame)
 (define-key ctl-x-5-map "r" 'find-file-read-only-other-frame)
+(define-key ctl-x-4-map "\C-o" 'display-buffer-other-frame)
 
 ;; arch-tag: bc68d3ea-19ca-468b-aac6-3a4a7766101f
 ;;; files.el ends here