如何使 Emacs 始终在左侧窗口中打开 .c 文件,而在右侧窗口中打开 .h 文件?

发布于 2024-07-29 02:57:26 字数 273 浏览 9 评论 0原文

我在编写C代码时总是打开三个窗口,如下所示:

       |
       |  2 
1      |_____
       |
       |  3
       |

窗口1用于代码编写,窗口2用于cscope,窗口3用于头文件快速引用。

当我按 cscope 窗口显示源代码时,我希望 Emacs 始终在窗口 1 中显示 .c 文件,而在窗口 3 中显示 .h 文件,有什么可能的解决方案吗?

非常感谢您的回复。

I always open three windows when writing C code like this:

       |
       |  2 
1      |_____
       |
       |  3
       |

Window 1 is used for code writing, window 2 is used for cscope, and window 3 is used for header file quick reference.

When I press in cscope window to show source, I want Emacs to display .c files always in window 1 while .h files in window 3, is there any possible solution?

Many thanks for your reply.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁吢 2024-08-05 02:57:26

看看 类似问题的答案。 关键是使用变量: special-display -正则表达式。 这几乎是一个嵌入式解决方案,只需您根据扩展名选择窗口(而不是选择窗口)。

Take a look at the answer to a similar question. The key is to use the variable: special-display-regexps. It's nearly a drop-in solution, only you choose the window based on the extension (as opposed to not choosing a window).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文