如何使这个Emacs框架保持缓冲区,而不是调整大小? [英] How do I make this Emacs frame keep its buffer and not get resized?

查看:141
本文介绍了如何使这个Emacs框架保持缓冲区,而不是调整大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Emacs框架如下所示:

My Emacs frame looks like this:

+---------------------------+
|             |             |
|             |             |
|             |      B      |
|      A      |             |
|             |             |
|             |             |
|             |-------------|
|             |      C      |
+---------------------------+

C 通常是具有某种长时间运行的进程的终端,如Web服务器或守护程序。不幸的是,各种各样的事情,比如在这个窗口中切换缓冲区,有时会调整大小。如何锁定窗口的缓冲区和高度 C

C is usually a terminal with some kind of long-running process, like a web server or daemon. Unfortunately, all sorts of things like to switch the buffer in that window and occasionally it gets resized. How can I lock the buffer and height of window C?

推荐答案

如果你不想被窗口窃取和调整大小的烦恼,请将以下行放在.emacs中最终的解决方案,即使是像gud这样的图书馆,当他们无法窃取你的窗口时尝试打开一个新的框架:

If you don't want to be annoyed by window stealing and resizing, put the following lines in your .emacs for a definitive solution that works even with libraries like gud that tries to open a new frame when they can't steal your windows :

(见<以下<$ c $的信息href =https://stackoverflow.com/questions/812192/emacs-preventing-gud-pdb-from-controlling-windows/5175715#5175715>此答案 c> advice )

(see this answer for info on the following advice)

(defadvice pop-to-buffer (before cancel-other-window first)
  (ad-set-arg 1 nil))

(ad-activate 'pop-to-buffer)

;; Toggle window dedication
(defun toggle-window-dedicated ()
  "Toggle whether the current active window is dedicated or not"
  (interactive)
  (message
   (if (let (window (get-buffer-window (current-buffer)))
         (set-window-dedicated-p window 
                                 (not (window-dedicated-p window))))
       "Window '%s' is dedicated"
     "Window '%s' is normal")
   (current-buffer)))

;; Press [pause] key in each window you want to "freeze"
(global-set-key [pause] 'toggle-window-dedicated)

,并自定义弹出窗口变量为 nil

您还可以使用 StickyWindows 而不是窗口专用功能。

you could also use StickyWindows instead of window-dedicated feature.

这篇关于如何使这个Emacs框架保持缓冲区,而不是调整大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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