spacemacs icon indicating copy to clipboard operation
spacemacs copied to clipboard

[feature request] Getting Spacemacs to keep from shuffling buffer order

Open stradicat opened this issue 5 years ago • 6 comments

Situation: editing buffers A - B - C - D - E, navigated in a left-to-right fashion with C-x ← and C-x →, then invoking some command like magit, closing the transient overlay and going back to buffers.

Now the buffers are ordered as A - C - E - [some lsp log] - D - [some other log]. It gets a tad annoying after a while, since one has to keep going to C-x b buffer-name instead of just going sideways (some ThinkPads have integrated page keys that trigger C-x ← and C-x →).

For comparison purposes, doom-emacs doesn't exhibit this apparently random reordering.

I haven't found a way to keep the buffer order yet, hence this call for help.

stradicat avatar Apr 10 '20 22:04 stradicat

It looks even more counterintuitive when using centaur-tabs to keep an eye on open buffers for a project. Adjacent buffers show adjacent tabs on the upper border of the current window, yet they're not cycled sequentially.

So far, after experimenting for a couple of weeks, I haven't been able to find any setting that could prevent this behavior, not even centaur-tabs' tab/group order settings, so my gues is that it could be a Spacemacs thing.

stradicat avatar May 09 '20 17:05 stradicat

The issue is still valid.

stradicat avatar May 18 '21 00:05 stradicat

The order of the buffers in this list is based primarily on how recently each buffer has been displayed in a window.

A buffer moves to the front of this list whenever it is chosen for display in a window (see Switching Buffers) or a window displaying it is selected (see Selecting Windows).

https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-List.html

Importantly,

There are no functions available to the Lisp programmer which directly manipulate the buffer list

So I don't how doom could possibly fix the order.

lebensterben avatar May 18 '21 00:05 lebensterben

Also, you need to provide a concrete list of steps to reproduce the behaviour.

lebensterben avatar May 18 '21 00:05 lebensterben

The order of the buffers in this list is based primarily on how recently each buffer has been displayed in a window.

A buffer moves to the front of this list whenever it is chosen for display in a window (see Switching Buffers) or a window displaying it is selected (see Selecting Windows).

https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-List.html

Importantly,

There are no functions available to the Lisp programmer which directly manipulate the buffer list

So I don't how doom could possibly fix the order.

That's exactly why I find it puzzling. Under doom-emacs, the buffer order remains unaltered. Under Spacemacs, it is modified.

stradicat avatar May 20 '21 20:05 stradicat

Also, you need to provide a concrete list of steps to reproduce the behaviour. I can only sum this up as:

  • Situation: editing buffers A - B - C - D - E
  • Navigate between buffers in a left-to-right fashion with C-x ← and C-x →
  • Invoke some command like magit, closing its transient overlay (e.g. to save a commit)
  • Go back to the last edited buffer
  • Navigate again between buffers in a left-to-right fashion with C-x ← and C-x →
  • See that the buffer order has changed.

This is in no way urgent or show-stopping, merely a low-priority annoyance. If there's a way to fix it, it would be nice; if not, no problem.

stradicat avatar May 20 '21 20:05 stradicat

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

github-actions[bot] avatar Mar 30 '24 13:03 github-actions[bot]