help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[h-e-w] Re: split-window-recent


From: Klaus Berndl
Subject: [h-e-w] Re: split-window-recent
Date: 19 May 2003 17:23:58 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

On Fri, 16 May 2003, Nascif Abousalh-Neto wrote:

>  
>  
>  Hi all,         I use the following command bound to C-x 2 (according to my
>  notes the code was created by Colin Walters, thanks!)
>  
>  (defun split-window-recent ()
>    "Split the current window, and show the next most recently used
>  buffer in the newly created window."
>    (interactive)
>    (split-window)
>    (let ((nextbuf (caddr (buffer-list))))
>      (when nextbuf
>        (show-buffer (next-window (selected-window))
>                     nextbuf))))
>  
>  It is quite nice 90% of the time, but every now and then it selects the
>  minibuffer buffer into the new window - which is clearly an annoyance. I
>  would like to test if the "nextbuf" buffer is the minibuffer, but there
>  seems to be no "minibuffer-p" or equivalent test predicate (on GNU Emacs
>  21.2).

Ok, here comes a new version of split-window-recent which is IMHO more cleaner
and does also what you want:

(defun split-window-recent ()
  (interactive)
  (split-window)
  (show-buffer (next-window (selected-window))
               (other-buffer)))

Is this what you want?
Klaus


>  
>  Any ideas?
>  TIA,
>          Nascif
-- 
Klaus Berndl                    mailto: address@hidden
sd&m AG                         http://www.sdm.de
software design & management    
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220





reply via email to

[Prev in Thread] Current Thread [Next in Thread]