Answers:
我认为您希望cursor(point)和可见区域的行为应类似于notepad,gedit和其他现代编辑器:能够独立于点位置更改可见区域,并在移动点后立即将可见区域返回到点位置。但是emacs还有另一个概念:可见区域始终遵循点的位置,反之亦然。
另请参阅/programming/9616623/ctrl-up-down-style-scrolling-in-emacs
Previous answer shows special idiom: if you want to move the visible area (with the point together) far from current position and then to return the point in exactly the previous position you should have a habit to use mark-ring. There always is a way through mark ring to current working position: many commands, like isearch-forward, beginning-of-buffer, ace-jump-mode automatically save previous position in mark ring and you shouldn't use C-<SPC> C-<SPC> before, but only C-u C-<SPC> for jumping back. Scrolling commands, like scroll-up or mwheel-scroll, don't automatically save previous position by default because it may produce too many excessive marks.
您可以在几个地方使用命令clone-indirect-buffer或view-buffer-other-window独立使用缓冲区。并使用命令recenter-top-bottom(C-l)连续将点保持在可见区域的中心。
highlight-symbol-mode。我将光标放在一个变量上,它突出显示了所有发生的事件。当我开始滚动时,光标离开变量,所有高光都丢失了。如果Emacs在滚动方面至少表现得像其他当代编辑器那样好,那它将更好。
以下对我有用:
(custom-set-variables
'(scroll-conservatively 1000)
'(scroll-margin 3)
)
C-u C-<SPC>似乎没有用。我不知道这是什么问题cua-mode。我尝试使用-q选项运行Emacs ,但没有任何改变。有任何想法吗?