如何防止`magit-visit-thing`打开`evil-mode`缓冲区

时间:2016-08-29 14:22:59

标签: emacs evil-mode magit

evil-modeevil-emacs-state-modes var,用于定义要在emacs模式下打开的模式。

我在该var中列出了magit-diff-mode(实际上,它是默认值)。

magit-diff模式下正常运行emacs

但是,如果我运行magit-status(在emacs mode中打开),请将该点放在Head(缓冲区中的第一行)并点击 Ret magit-visit-thing被调用,并且提交信息显示在新缓冲区中。此缓冲区位于magit-diff-mode中,但evil-mode对此缓冲区有效。

如何防止此行为?

1 个答案:

答案 0 :(得分:0)

As we figured out in the comments - the buffer opens in magit-revision-mode, not in magit-diff-mode.

To find out the major mode of the buffer, describe variable major-mode - C-h v major-mode <RET>.

For you information, when you do describe-mode instead (C-h m) what you see as mode name is the string that appears in the status line. It may be difficult to guess from it what the actual mode name is - like Magit Rev is actually a string for magit-revision-mode - no way of knowing unless you look in magit-diff.el:

define-derived-mode magit-revision-mode magit-diff-mode "Magit Rev"