在 Emacs 中使用 gdb 会破坏水平滚动
我使用的Emacs版本: GNU Emacs 22.2.1(i386-redhat-linux-gnu,GTK+ 版本 2.12.9)
从 emacs 调用 gdb 会破坏 emacs 窗口中的水平滚动。我通过输入 Mx gdb 来调用 gdb,然后接受默认值(仅在末尾添加二进制文件的名称,例如): gdb --annotate=3 unittest
在调用调试器后的某个时刻(不是立即),自动水平滚动不再起作用。
通过自动水平滚动,我的意思是预期的行为是:跟随光标,在必要时向左或向右移动视口。例如:当光标位于长行的末尾(例如第 200 列)时,窗口的查看区域会向右移动,使得第 200 列可见。如果我然后按“Home”并且光标跳到行首 - 窗口也会跟随它,我可以看到缓冲区的最左边的列。
将我的整个 .emacs 文件粘贴到此处可能是一个坏主意,所以我只是搜索与 hscroll 相关的条目:
(custom-set-variables
'(column-number-mode t)
'(cua-mode t nil (cua-base))
'(hscroll-global-mode t nil (hscroll))
'(hscroll-margin 5)
'(hscroll-mode-name " ")
'(hscroll-snap-threshold 30)
'(indent-tabs-mode nil)
...
...但如果有人认为需要,我可以将其附加在此处或通过电子邮件发送...
希望有人知道如何解决此问题因为这真的很痛苦 - 每次我使用调试器时我都需要重新启动 emacs...我很确定这个问题在版本 20 中不存在...
Emacs version I am using:
GNU Emacs 22.2.1 (i386-redhat-linux-gnu, GTK+ Version 2.12.9)
Invoking gdb from emacs breaks the horizontal scrolling in emacs windows. I invoke gdb by entering M-x gdb and then accept the default (only adding name of my binary at the end, e.g.):
gdb --annotate=3 unittest
At some point after the debugger is invoked (not immediately), the automatic horizontal scrolling no longer works.
By automatic horizontal scrolling I mean that the expected behaviour is: follow the cursor, shifting the viewport left or right when necessary. For example: when the cursor is positioned at the end of a long line (say column 200) the viewing area of the window is moved to the right, such that column 200 is visible. If I then press 'Home' and the cursor jumps to beginning of line - the window also follows it and I can see the left-most column of the buffer.
Pasting my entire .emacs file here is probably a bad idea so I just searched for entries related to hscroll:
(custom-set-variables
'(column-number-mode t)
'(cua-mode t nil (cua-base))
'(hscroll-global-mode t nil (hscroll))
'(hscroll-margin 5)
'(hscroll-mode-name " ")
'(hscroll-snap-threshold 30)
'(indent-tabs-mode nil)
...
... but I can attach it here or email it if anyone thinks it is needed...
Hope someone knows how to fix this as coz it's a real pain - every time I use the debugger I need to restart emacs... I am pretty sure this problem was not present in version 20....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论