简体   繁体   English

在emacs中如何控制哪个windows显示编译结果?

[英]in emacs how to control which windows to show compile result?

I have used emacs for erlang programming.我用emacs进行erlang编程。 According to http://emacswiki.org/emacs/CompileCommand , I have configure cc c for recompile.根据http://emacswiki.org/emacs/CompileCommand ,我配置了 cc c 用于重新编译。 In the emacs frame, 6 windows are open, top 3 are for erlang source code reading and writing. emacs帧中,打开了6个windows,前3个为erlang源码读写。 In the below windows, one is supposed for the compie window. But when different windows is active and recompile, the compile window will switch randomly.在下面的windows中,一个应该是编译window。但是当不同的windows激活并重新编译时,编译window会随机切换。 How to fix it in one perticular window?如何在一个特定的 window 中修复它?

If you start reading at Ch f display-buffer RET (or in the manual at M-: (info "(elisp) Choosing Window") RET ), you'll find a bunch of ways in which you can modify the behaviour.如果您从Ch f display-buffer RET开始阅读(或在M-: (info "(elisp) Choosing Window") RET的手册中),您会发现许多可以修改行为的方法。

It can get a little complex, but something like this might be all you need in your recompile function:它可能会变得有点复杂,但在重新编译 function 时,您可能只需要这样的东西:

(let ((display-buffer-overriding-action
       '(display-buffer-reuse-window)))
  (compile))

I always use dedicated windows when I want to keep things in the one place, so you might also find that useful to look into:当我想把东西放在一个地方时,我总是使用专用的 windows,所以你可能还会发现它很有用:

M-: (info "(elisp) Dedicated Windows") RET M-:( (info "(elisp) Dedicated Windows") RET

I use the toggle-window-dedicated function from Pin Emacs buffers to windows (for cscope) (see also How do I make this Emacs frame keep its buffer and not get resized? )我使用toggle-window-dedicated function 从Pin Emacs 缓冲区到 windows(对于 cscope) (另请参阅如何使这个 Emacs 帧保持其缓冲区而不调整大小?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM