emacs-devel
[Top][All Lists]
Advanced

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

Re: switch-to-buffer: for interactive use only


From: Stefan Monnier
Subject: Re: switch-to-buffer: for interactive use only
Date: Fri, 08 Jul 2011 23:09:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> Fair enough.  So, I propose the following:
> - Make switch-to-buffer basically do
>   (pop-to-buffer buffer-or-name 'same-window norecord label)

OK.  So mostly revert to Emacs-23 behavior.

> - Make pop-to-buffer-same-window an alias for switch-to-buffer.
>   (This means to add an optional LABEL arg to switch-to-buffer, for
>   consistency with pop-to-buffer-same-window.)

We may as well get rid of pop-to-buffer-same-window (those who want to
provide a LABEL can use pop-to-buffer instead).

> - For those places that intend the "act on the selected window"
>   behavior---which is the minority---change the code to call
>   (set-window-buffer (selected-window) buffer), instead of
>   switch-to-buffer.

Note that (set-window-buffer (selected-window) buffer) isn't quite good
enough, since set-window-buffer will be happy to change the buffer of
a mini-window, whereas callers of switch-to-buffer that want to operate
on the selected window should signal an error in that case.
I think adding a `selected-window-only' argument to switch-to-buffer is
a better solution so callers don't need to worry about such details of
set-window-buffer.


        Stefan



reply via email to

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