所以我通常在Emacs中打开3个缓冲区.
我写的实际代码的一个缓冲区.
一个缓冲区用于所述代码的单元测试.
第三个缓冲区,显示单元测试的结果.当我运行单元测试时,此缓冲区在另外两个缓冲区之下C-x SPACE.
如何禁用此第三个缓冲区,以便在按下时C-x o我只在缓冲区1和缓冲区2之间切换?目前,我在缓冲区1,缓冲区2,缓冲区3,缓冲区1等C-x o之间切换.具体来说,我只想在缓冲区1和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)))))
将变量自定义为与要跳过的缓冲区名称匹配的正则表达式.
Trey的答案将完全符合您的要求(至少看起来会如此;我没有尝试过).更通用的解决方案是swbuff
与swbuff-x
我们自己一起使用swbuff-advice
.有关这三个的信息可以在Emacs Wiki swbuff页面上找到.