emacs-devel
[Top][All Lists]
Advanced

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

Re: Allow controlling the effect of visibility on buffer switching


From: Stefan Monnier
Subject: Re: Allow controlling the effect of visibility on buffer switching
Date: Sat, 29 Jan 2022 19:31:06 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Po Lu [2022-01-29 17:37:40] wrote:
> Thuna <thuna.cing@gmail.com> writes:
>> It is extremely unlikely for someone to know what their last non-visible
>> buffer is, especially after accounting for other frames and windows.
>
> I find it sufficient to take a quick glance at the frame I'm currently
> working on.  Further more, multiple frame workflows are reasonably rare,
> and even more so the workflows where some frames aren't visible at any
> given time.

FWIW, I also dislike the current behavior: I can't remember the last
time that I used `C-x b`s default and was glad that it wasn't one
of the already displayed buffers: for my use cases, `C-x b`s default is
only ever right when the last buffer is not visible.

> And please don't change the behaviour of `switch-to-buffer' in such a
> drastic manner.  People are used to it as it is.

I think this discussion would benefit from a more constructive argument
than habit.  Can you describe use cases where `C-x b`s current default
is indeed the one the user wants yet it is not the last buffer (because
the last buffer is already visible elsewhere)?

My analysis of the situation is the following:

- Users in group A arrange to (almost always) have one one window
  displaying a given buffer.  In that case, they probably won't want to
  `C-x b` to an already visible buffer (which suggests the current code
  is right for them) *BUT* it also means that the "last buffer" is most
  likely not visible either (since it would mean that this last buffer
  was (back then) visible in two windows).
  So for those users, either behavior will usually give the same result.

- Users in group B OTOH do take advantage of Emacs's (maybe not unique,
  but somewhat unusual) ability to display the same buffer is several
  windows at the same time.  For them it's just as likely they'll want
  to use `C-x b` to display an already displayed buffer as any other.
  For these users, the current behavior may be harmful since it just
  makes it harder for them to predict what `C-x b`s default will be.


        Stefan




reply via email to

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