Emacs:定义命令输出的目标窗口 [英] Emacs: define target window for command output

查看:120
本文介绍了Emacs:定义命令输出的目标窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我厌倦了emacs用我的窗口和它的输出,并且不可预知地在这一切。我想在emacs框架中有几个窗口,并且每个窗口仅用于特定目的。例如,

  ECB面板|编辑1 |编辑2 |书签+ 
--------------------------------------------- ---
消息(输出缓冲区)

所以,当我运行code> Mx编译,我希望输出始终进入消息。同样,当我运行 M-x magit-status 时,我也希望结果在消息。点击书签或按 Cx rb 应该打开文件并将光标放在编辑器1中。



ve尝试了一些lisp片段来锁定窗口以防止更改,但是当所有窗口都被锁定时,emacs会变得坚固,因为它找不到可用的窗口来将新的输出放入。这种令人讨厌的缓冲区交换功能必须返回到80x25个字符的终端日子。



我从来没有看到ECB窗口被破坏,所以它必须可行

解决方案

你明确要求专用的窗口。那么Emacs具有这样的功能: 专用的窗口 Chrg专用窗口几乎告诉你需要知道的一切。



但另请参见 special-display-buffer-names special-display-regexps ---或者如果你是一个受虐狂者, c> display-buffer-alist 做同样的事情。



使用 display-buffer-alist 你原则上可以做任何你可能会想到的,包括把你的内衣绑在一起,然后将它们点燃。



,我只是将 special-display-regexps 设置为([]?[*] [^ *] + [*])。)


I'm tired of emacs clobbering my windows with its output, and unpredictably at that. I'd like to have several windows in emacs frame and have each window dedicated for a certain purpose only. For example,

ECB panels |  Editor 1 | Editor 2 |  Bookmarks+
------------------------------------------------
"Messages" (output buffer)

So, when I run M-x compile, I want the output to always go into Messages. Similarily, when I run M-x magit-status, I want results in Messages, as well. Clicking on a bookmark or pressing C-x r b should open the file and position the cursor in Editor 1.

I've tried some lisp snippets to "lock" the windows to prevent the changes but the emacs goes nuts when all windows are "locked", cause it can't find an available window to put new output into. This nasty buffer-swap feature that emacs has must be going back to the 80x25 character terminal days.

I've never seen ECB windows get clobbered, so it must be doable somehow.

解决方案

You are explicitly asking for dedicated windows. Well, Emacs has exactly that feature: dedicated windows. C-h r g dedicated windows tells you pretty much everything you need to know.

But see also special-display-buffer-names and special-display-regexps --- or if you are a masochist, fiddle with display-buffer-alist to do the same thing.

With display-buffer-alist you can in principle do anything you might imagine, including tie your underwear in knots and set it on fire.

(Me, I just set special-display-regexps to ("[ ]?[*][^*]+[*]").)

这篇关于Emacs:定义命令输出的目标窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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