我是一个新的Emacs用户,并学习如何垂直拆分窗口并在每个窗格中循环缓冲区.
但是,在一个窗格中打开一个新文件后,next-buffer不会在另一个窗格中循环显示此文件,但只有在新窗格中出现一次后才会循环.这可以复制如下:
Open 2 files A and B in a new emacs session.
Split the windows vertically using ‘split-window-right’.
‘next-buffer’ cycles through A and B in PaneLeft and PaneRight.
Open file C in PaneLeft.
‘next-buffer’ cycles through A, B, C in PaneLeft.
Ensure C is focused in PaneLeft, then switch to PaneRight. ‘next-buffer’ only cycles through A and B in PaneRight. It skips C possibly because C is already visible in PaneLeft.
Switch back to PaneLeft, and ensure A or B is focused in PaneLeft.
Switch back to PaneRight, now ‘next-buffer’ cycles through A, B, and C, regardless of what is visible in PaneLeft.
这是预期的行为吗?我怎么能按照我的意图让它工作?
注意:我运行时没有任何自定义扩展,我的.emacs几乎是空的.
最佳答案 有switch-to-visible-buffer变量来控制这种行为.从GNU Emacs 24.2的文档:
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.
如果这不起作用,它应该工作,可能有一个错误.