emacs-devel
[Top][All Lists]
Advanced

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

Re: Include buffer-move.el


From: Leo
Subject: Re: Include buffer-move.el
Date: Wed, 15 Aug 2007 11:23:43 +0100
User-agent: Gnus/5.110007 Emacs/23.0.0 (20070727) Fedora 7 (gnu/linux)

On 2007-08-15 08:01 +0100, Mathias Dahl wrote:
>> I think we should indeed add this functionality to windmove.el.
>
> A similar function was discussed a while ago in gnu.emacs.help
> (subject "rotate split windows") and a simple solution developed:
>
> http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/5197a0895413ee6c/443d6b1f25e0c585?lnk=gst&q=rotate+buffer&rnum=2#443d6b1f25e0c585
>
> The difference is that the buffers are rotated, so you cannot do
> exactly what buffer-move seems to do. I thought I should mention it
> however in case people like that better.

I copied the code here for convenience.

  (defun rotate-window-buffers ()                                               
                                  
    (interactive)                                                               
                                  
    (let* ((ws (window-list))                                                   
                                  
           (bs (mapcar 'window-buffer ws))                                      
                                  
           (ps (mapcar 'window-point ws))                                       
                                  
           (w (pop ws)))                                                        
                                  
      (dolist (v (append ws `(,w)))                                             
                                  
        (set-window-buffer v (pop bs))                                          
                                  
        (set-window-point v (pop ps)))))

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

         Gnus is one component of the Emacs operating system.





reply via email to

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