emacs - emacs下使用gdb时的缓冲区控制

标签 emacs gdb frames

我在 emacs 下使用 gdb。在调试 session 期间,当 emacs/gdb 跳转到源代码时,我通常会打开另一个框架 (C-x 5 2) 并将其拉到我的第二台显示器上。
当需要打开一个新的源代码文件时(例如程序进入另一个源文件中定义的函数,走栈等...)emacs往往会自动在一个新的源代码文件中打开相应的源代码窗口,但不幸的是在gdb框架中。

我希望它在我打开的新框架中拉出新的源代码,并完全保持 gdb 框架不变。我的问题是:

如何设置 emacs 打开任何新文件,以便该文件显示在新框架中?

我希望我是有道理的。

最佳答案

不是一个简单的答案,但 display-buffer-alist 中的适当条目可以告诉 display-buffer 始终使用您想要的帧作为新缓冲区的目的地。

在 24.1 中,文档是:

display-buffer-alist is a variable defined in `window.el'. Its value is nil

This variable may be risky if used as a file-local variable.

Documentation: Alist of conditional actions for `display-buffer'. This is a list of elements (CONDITION . ACTION), where:

CONDITION is either a regexp matching buffer names, or a function that takes two arguments - a buffer name and the ACTION argument of `display-buffer' - and returns a boolean.

ACTION is a cons cell (FUNCTION . ALIST), where FUNCTION is a
function or a list of functions. Each such function should accept two arguments: a buffer to display and an alist of the same form as ALIST. See `display-buffer' for details.

`display-buffer' scans this alist until it either finds a matching regular expression or the function specified by a condition returns non-nil. In any of these cases, it adds the associated action to the list of actions it will try.

You can customize this variable.

This variable was introduced, or its default value was changed, in version 24.1 of Emacs.

关于emacs - emacs下使用gdb时的缓冲区控制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17654568/

相关文章:

emacs - Emacs 中的眼镜模式

debugging - 如何在 10 秒后暂停程序的执行并获取回溯?

emacs - 在Emacs中,如何在Finder中显示当前文件?

linux - 视觉上改进 emacs

emacs - 将当前条目插入 BBDB

c++ - 使用 opencv 调试代码失败并出现段错误

c - GDB报告(带有列表和框架命令)不列出行号

Nginx - 使用 ALLOW-FROM URI : unknown directive/invalid number of arguments in "add_header" directive 时出现 X-Frame-Options 错误

android - 如何在android上将相机帧编码为mp4

html - 来自 FRAMESET 中链接的 HTTP_REFERER 在不同的计算机上发送不同的值?