当在emacs中使用两个帧时,如何防止编译缓冲区出现在​​两个? [英] When using two frames in emacs, how do I prevent the compilation buffer from showing up in both?

查看:163
本文介绍了当在emacs中使用两个帧时,如何防止编译缓冲区出现在​​两个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用两个显示器,经常使用两个框架打开的emacs;每个监视器一个。每个框架分为两个并排窗口,如下所示:

I work with two monitors, and often use emacs with two frames open; one for each monitor. each frame is split into two side-by-side windows, like so:

 a | b   <-- frame 1 in monitor 1
-------
 c | d   <-- frame 2 in monitor 2

当我在窗口中点击' a,编译缓冲区在它旁边的缓冲区中打开。到目前为止很好:

When I hit my 'compile' button while in window a, the compilation buffer opens in the buffer next to it. So far so good:

 a | compilation
-----------------
 c |     d

但是,如果我然后移动到窗口c编辑一些东西, d也访问编译缓冲区:

However, if I then move to window c to edit some stuff, then hit compile again, window d visits the compilation buffer as well:

 a | compilation
------------------
 c | compilation

现在我有一半的屏幕空间占用了同一个编译的两个副本缓冲区,想知道为什么我有两个监视器):

So now I have half of my screen real-estate taken up by two copies of the same compilation buffer, wondering why I have two monitors :)

我可以防止这种情况下,只有当我的光标在当前打开的编译缓冲区旁边的缓冲区,但我打的编译这么早,经常,我通常没有心灵的存在这样做。我觉得必须有一些东西,我可以调整在.emacs所以我不应该。

I can prevent this by conscientiously only hitting the compile key when my cursor is in the buffer next to the currently open compile buffer, but I hit 'compile' so early and often that I usually don't have the presence of mind to do so. I feel like there must be something I can tweak in .emacs so I shouldn't have to.

有任何建议吗?理想情况下,当我点击编译时,当前打开的编译缓冲区应该从其上一个窗口移动到当前使用的窗口旁边。如果这太复杂了,如果已经在另一个窗口中打开过,我很容易让emacs 不要访问相邻窗口中的编译缓冲区。

Any suggestions? Ideally, when I hit 'compile', the currently open compilation buffer should move from its previous window to the one next to the currently used window. If that's too complicated, I'd easily settle for having emacs not visit the compilation buffer in the neighboring window, if it's already open in another window.

推荐答案

(setq-default display-buffer-reuse-frames t)

从文档:


非nil意味着`display-buffer'重用帧。
如果所讨论的缓冲区已经显示在框架中,则提高
的框架。

Non-nil means `display-buffer' should reuse frames. If the buffer in question is already displayed in a frame, raise that frame.

这篇关于当在emacs中使用两个帧时,如何防止编译缓冲区出现在​​两个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆