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

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

问题描述

如果我只有一个窗口显示在emacs中并且使用M-x编译,窗口分为两个,我可以轻松地观看编译缓冲区。但是,如果我有更多的窗口显示,编译日志会占用其中一个,我觉得很刺激。如何使emacs总是分裂一个新窗口来显示编译日志?

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?

推荐答案

您可以修改由特雷杰克逊,以满足您的需求。

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天全站免登陆