Buffers to skip the next buffer when splitting a window on emacs

I am a new Emacs user and learned how to split a window vertically and cyclically move buffers in each panel.

However, after opening a new file in one panel, the next buffer does not iterate over this file in another panel, but only after it has appeared once in a new area. This can be reproduced as follows:

Open 2 files A and B in a new emacs session.

Split windows vertically using "split-window-right".

'next-buffer' cycles through A and B to PaneLeft and PaneRight.

Open the C file in PaneLeft.

'next-buffer' cycles through A, B, C in PaneLeft.

Make sure C is focused in PaneLeft, then switch to PaneRight. "next-buffer" only cycles through A and B in PaneRight. It skips C, perhaps because C is already displayed in PaneLeft.

Go back to PaneLeft and make sure that A or B are focused in PaneLeft.

Return to PaneRight, the next-buffer now cycles through A, B, and C, regardless of what is visible in PaneLeft.

Is this intended behavior? How do I make it work the way I thought?

Note. I run without any custom extensions, and my .emacs are pretty empty.

+4
source share
1 answer

To control this behavior, there is a switch-to-visible-buffer variable. From the GNU Emacs 24.2 documentation:

 switch-to-visible-buffer is a variable defined in `window.el'. Its value is t Documentation: If non-nil, allow switching to an already visible buffer. If this variable is non-nil, `switch-to-prev-buffer' and `switch-to-next-buffer' may switch to an already visible buffer provided the buffer was shown in the argument window before. If this variable is nil, `switch-to-prev-buffer' and `switch-to-next-buffer' always try to avoid switching to a buffer that is already visible in another window on the same frame. You can customize this variable. This variable was introduced, or its default value was changed, in version 24.1 of Emacs. 

If this does not work, as it should work, there is probably an error.

+2
source

All Articles