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: Sun, 31 Mar 2024 10:32:30 +0200
User-agent: Mozilla Thunderbird

>> - I do like the idea of having an option to constrain buffers switched
>>    to via C-x <left> and C-x <right> to those shown in that window
>>    before.
>>
>> - I do like the idea of having an option controlling whether C-x <left>
>>    and C-x <right> should wrap to the last/first buffer (regardless of
>>    whether buffers switched to appeared in the window before or not).
>>
>> - I agree that the orders of tabs shown by 'tab-line-mode' should not
>>    change when a buffer that already appeared in a window is shown again
>>    in that window - the window's buffer is already highlighted
>>    appropriately in the tab line in that case.
>
> When you say that a buffer is shown again in that window,
> do you mean showing the buffer with C-x <left> and C-x <right>
> or with C-x b?

The Elisp manual says about 'switch-to-prev-buffer'

     The previous buffer is usually the buffer shown before the buffer
     currently shown in WINDOW.  However, a buffer that has been buried
     or killed, or has been already shown by a recent invocation of
     ‘switch-to-prev-buffer’, does not qualify as previous buffer.

and about 'switch-to-next-buffer'

     This command switches to the next buffer in WINDOW, thus undoing
     the effect of the last ‘switch-to-prev-buffer’ command in WINDOW.
     The argument WINDOW must be a live window and defaults to the
     selected one.

Admittedly, "recent" is not very precise.  The idea is, among others,
that an intervening C-x b will make "recent invocations" appear as if
they never happened.

>> But this last requirement of 'tab-line-mode' should not affect the order
>> of buffers in a window's list of previous and next buffers.
>
> When the tab-line will show the same order of prev/next buffers
> after C-x <left> and C-x <right> or even after C-x b, does this
> mean the order of prev/next buffers is not affected?

No.  All of these affect the order, albeit in distinct ways.  I think
the following is problematic:

  (defun tab-line-switch-to-prev-tab (&optional event)
    "Switch to the previous tab's buffer.
  Its effect is the same as using the `previous-buffer' command
  (\\[previous-buffer])."

If the "previous tab" does not show the buffer 'switch-to-prev-buffer'
would switch to, then the doc is wrong.  I'm not sure whether
'tab-line-tabs-window-buffers' can guarantee that this chooses the same
buffer 'switch-to-prev-buffer' would switch to, though.  If it doesn't,
then the effect should be that of C-x b switching to a buffer earlier
shown in that window.  BTW, burying a buffer removes it from the tab
line but does not prevent 'switch-to-prev-buffer' from switching to it -
it just makes it very unlikely IIRC.

martin

reply via email to

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