4

当我在 GNU Emacs (24) 中打开的文件(缓冲区)的行数少于当前窗口(框架)中可以显示的行数时,我可以 - 默认情况下 - 使用滚动条向下滚动并让顶行消失( “过度滚动”)。

我怎样才能关闭它,所以当整个缓冲区显示在框架中时我不能滚动?

我可以在 Emacs 源代码中修补 gtkutil.c,但更优雅的解决方案会很好。

4

3 回答 3

1

现在可以通过设置变量来修改滚动条的行为scroll-bar-adjust-thumb-portionnil为了我的目的),这里是文档:

scroll-bar-adjust-thumb-portion is a variable defined in `C source code'.
Its value is nil
Original value was t

Documentation:
Adjust thumb for overscrolling for Gtk+ and MOTIF.
Non-nil means adjust the thumb in the scroll bar so it can be dragged downwards
even if the end of the buffer is shown (i.e. overscrolling).
Set to nil if you want the thumb to be at the bottom when the end of the buffer
is shown.  Also, the thumb fills the whole scroll bar when the entire buffer
is visible.  In this case you can not overscroll.

[...] version 24.4 of Emacs.

随此提交引入:r111506

于 2013-10-14T22:26:56.547 回答
0

AFAIK,您目前无法做到这一点(当然,您也许可以将其拼凑起来)。正确地做这件事可能会耗费 CPU 时间,但更重要的是,实现这个“特性”似乎比让人们习惯它并发现它毕竟不是问题要付出更多的努力。所以还没有人费心为它写补丁。

于 2012-05-28T15:59:53.820 回答
-1

您需要添加

(setq next-line-add-newlines nil)

到你的初始化文件。

于 2012-05-27T17:46:25.630 回答