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

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

bug#69993: Wrap window buffers while cycling


From: martin rudalics
Subject: bug#69993: Wrap window buffers while cycling
Date: Wed, 10 Apr 2024 10:46:48 +0200
User-agent: Mozilla Thunderbird

>> I think that if we added a 'switch-to-prev-buffer-wrap' option, we would
>> emulate the behavior sketched above regardless of whether it's triggered
>> by 'switch-to-prev-buffer' or 'tab-line-switch-to-prev-tab'.  Currently,
>> 'switch-to-prev-buffer' always wraps while 'tab-line-switch-to-prev-tab'
>> obeys the value of 'tab-line-switch-cycling'.
>
> The users won't understand how currently 'switch-to-prev-buffer' always wraps,
> when going to the previous element at the beginning of a list
> doesn't go to the last element of the tab-line.

Suppose I'm at the first element of a tab list.  With wrapping/cycling
'switch-to-prev-buffer' will select some buffer and that buffer will be
shown as current in the tab list.  With restricting it will be the last
element of the tab list, without restricting it may be a buffer that's
new on the tab list, probably shown at its beginning.  Since
'tab-line-switch-to-prev-tab' restricts by default, it will always
select the last buffer on the tab list.  What am I missing?

>> 'tab-line-switch-cycling' could then be used to override the more
>> general 'switch-to-prev-buffer-wrap' when calling
>> 'tab-line-switch-to-prev-tab'.  Or we could alias
>> 'tab-line-switch-cycling' to 'switch-to-prev-buffer-wrap'.  And we could
>> use the term 'switch-to-prev-buffer-cycle' instead.
>
> I think "cycle" is a wrong name.  Cycling is using
> 'switch-to-prev-buffer'.  But wrapping is going
> from the beginning to the end of the tab-line.

In my understanding, the elements of the tab line are a visual
representation of a "window-local" subset of all buffers.  This subset
is ordered in a way that does not necessarily match the order used by
'switch-to-prev-buffer' - when C-x b-ing to a buffer already on the tab
line, the tab line order does not change while the order of buffers used
by C-x <left> and C-x <right> may change.  Other than that, cycling and
wrapping behave identically wrt their respective sets.

> Mixing wrapping/cycling and restricting is unavoidable:
> you can see how the previous patch reorders prev/next buffers
> to make the order of tabs stay the same after wrapping.

The order of tabs is one thing, that of buffers on the buffer list
another and that of buffers to be visited by 'switch-to-prev-buffer' and
'switch-to-next-buffer' a third one.

martin





reply via email to

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