所以我通常在 Emacs 中打开 3 个缓冲区。
- 我正在编写的实际代码的一个缓冲区。
- 用于所述代码的单元测试的一个缓冲区。
- A third buffer that displays the results of the unit test. This buffer comes into being
below the two other buffers when I run my unit test C-x SPACE.
How do I disable this third buffer such that when I press C-x o I am only switching between buffer 1 and buffer 2? Currently, I switch between buffer 1, then buffer 2, then buffer 3, then buffer 1, etc. To be specific, I want C-x o to only switch between buffer 1 and 2.
谢谢。
对此的一般解决方案(可以看起来)如下所示:
(defvar ignore-windows-containing-buffers-matching-res '("\\*Help")
"List of regular expressions specifying windows to skip (if window contains buffer that matches, skip)")
(defadvice other-window (before other-window-ignore-windows-containing activate)
"skip over windows containing buffers which match regular expressions in 'ignore-windows-containing-buffers-matching-res"
(if (and (= 1 (ad-get-arg 0)) (interactive-p))
(let* ((win (next-window))
(bname (buffer-name (window-buffer win))))
(when (some 'identity (mapcar '(lambda (re)
(string-match re bname))
ignore-windows-containing-buffers-matching-res))
(ad-set-arg 0 2)))))
将变量自定义为与要跳过的缓冲区名称匹配的正则表达式。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)