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

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

Re: Swap windows in a frame


From: Pankaj Jangid
Subject: Re: Swap windows in a frame
Date: Mon, 10 Jan 2022 22:09:03 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

>>>> I have two windows in a frame. Is there a command to swap
>>>> their location?

> (defun swap-windows ()
>   (interactive)
>   (let ((buffer (current-buffer)))
>     (other-window 1)
>     (switch-to-buffer-other-window (current-buffer))
>     (other-window 1)
>     (switch-to-buffer buffer) ))
>

Yes. Thanks for sharing this. Pasting it to my init :-) 




reply via email to

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