And*_*ott 7 windows emacs buffer
我有一个缓冲区,我想在按键上的emacs窗口中"切换".
例如:
________________ ________________ ________________
| | | | | | |
| | | | | | |
| | | | | | |
| W | -> | S | W | -> | W |
| | <f3> | | | <f3> | |
| | | | | | |
---------------- ---------------- ----------------
Run Code Online (Sandbox Code Playgroud)
凡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)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
330 次 |
| 最近记录: |