如何使编译日志在Emacs中创建一个新窗口? [英] How can I make the compilation log create a new window in Emacs?

查看:136
本文介绍了如何使编译日志在Emacs中创建一个新窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我只有一个窗口显示在emacs和使用M-x编译,窗口拆分为两个,我可以看到编译缓冲区容易。但是,如果我有更多的窗口显示,编译日志接管其他的一个,我觉得刺激。我如何使emac总是拆分一个新窗口以显示编译日志?

If I only have one window showing in emacs and use M-x compile, the window splits in two and I can watch the compile buffer easily. However, if I have more windows showing, the compilation log takes over one of the others, which I find irritating. How can I make emacs always split a new window to show the compilation log?

编辑:从我的阅读中我已经做了一些更多的信息。它看起来像compile.el调用display-buffer,它只分割一个窗口,如果它是当前全宽。是否有某种方法可以避免这种行为?

A bit more information from my reading that I've been doing. It looks like compile.el calls display-buffer, which only splits a window if it is current full width. Is there some way to avoid this behaviour?

推荐答案

您可以修改 Trey Jackson 以满足您的需求。

You may modify the solution provided by Trey Jackson to fit your needs.

以下代码段标记缓冲区 * compilation * 为特殊,并设置自定义函数作为其显示函数进行拆分

The following snippet marks buffer *compilation* as special, and sets a customized function as its display function to split current window even if already in a split window.

(setq special-display-buffer-names
      '("*compilation*"))

(setq special-display-function
      (lambda (buffer &optional args)
        (split-window)
        (switch-to-buffer buffer)
        (get-buffer-window buffer 0)))

这篇关于如何使编译日志在Emacs中创建一个新窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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