windows - Emacs,切换特定窗口

标签 windows emacs buffer

我有一个缓冲区,我想在按键时在 emacs 的窗口中“切换”打开。

例如:

 ________________        ________________        ________________ 
|                |      |    |           |      |                |
|                |      |    |           |      |                |
|                |      |    |           |      |                |
|       W        |  ->  | S  |     W     |  ->  |        W       |
|                | <f3> |    |           | <f3> |                |
|                |      |    |           |      |                |
 ----------------        ----------------        ---------------- 

在哪里S在左侧窗口中是一个特定的缓冲区。

问题出现了,无论W 的窗口结构如何,这都应该发生。是。如果W里面有几个不同的窗口,按 <F3>仍然应该在屏幕边缘创建一个新窗口,并将特定的缓冲区放入其中,然后它应该将其取走。

不过,我不太确定如何在 emacs 中执行此操作。

最佳答案

试试这个作为起点,它需要包 popwin

(require 'popwin)
(popwin-mode 1)

(generate-new-buffer "special-buffer")

(setq eab/special-buffer-displaedp nil)
(setq eab/special-buffer "special-buffer")

(add-to-list 'popwin:special-display-config
         `(,eab/special-buffer :width 20 :position left :stick t))    

(defun eab/special-buffer-toggle ()
  (interactive)
  (if eab/special-buffer-displaedp
      (progn
      (popwin:close-popup-window)
      (setq eab/special-buffer-displaedp nil))
    (progn
      (ignore-errors (popwin:display-buffer eab/special-buffer))
      (setq eab/special-buffer-displaedp 't))))

(global-set-key (kbd "<f3>") 'eab/special-buffer-toggle)

关于windows - Emacs,切换特定窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19462168/

相关文章:

c++ - std::vector 在加载/清除大量数据时变得越来越慢

python - 为什么 os.path 同时使用 '\' 和 '/' ?

bash - 使用ssh登录后如何在新窗口中打开emacs

regex - 如何在 Emacs 正则表达式中表示 "not a bracket"?

emacs - 获取emacs中的处理器数量

linux - 在 Linux 中编写我的第一个漏洞利用程序

java - 无法找到用于设置首选项 Eclipse 的 Android SDK 位置

c++ - 如果 HWND 窗口仍然存在,我该如何确定

c - 与 Pthread 共享有界缓冲区和互斥锁忙等待

file-io - Racket 中的文件输出有最大长度吗?