[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: How to detach buffer?
From: |
Drew Adams |
Subject: |
RE: How to detach buffer? |
Date: |
Fri, 4 Jan 2008 08:09:47 -0800 |
> is it possible to detach a buffer from a multi-window frame? Talking elisp
>
> (defun detach-buffer ()
> (interactive)
> (let ((buf (current-buffer)))
> (delete-window)
> (select-frame (make-frame))
> (set-window-buffer (selected-window) buf)
> )
> )
>
> So even the question seems answered i actually like to know if i
> reinvent the wheel. ie is a function like my detach-buffer already
> available?
`mouse-tear-off-window'. I bind it to `C-mouse-1' on the mode line:
(global-set-key [mode-line C-mouse-1]
'mouse-tear-off-window)
And here is a version of it that only deletes the window if it is not the
only one in the frame. IOW, if the frame has a sole window, then
`mouse-tear-off-window' clones the frame.
http://www.emacswiki.org/cgi-bin/wiki/mouse%2b.el