我使用Emacs Live,其中包含git-gutter.el
。问题是它与linum-mode
的效果不佳。运行 M-x git-gutter:clear
时,问题已解决。我希望在我的init.el
函数中包含一个函数,只要我切换到现有缓冲区或打开一个新缓冲区,它就会执行git-gutter:clear
。我还希望在保存缓冲区时运行(通过 C-x C-s )。感谢。
答案 0 :(得分:1)
(defun user2475612-forward-window ()
(interactive)
(other-window 1)
(git-gutter:clear) )
(defun user2475612-backward-window ()
(interactive)
(other-window -1)
(git-gutter:clear) )
(add-hook 'window-configuration-change-hook (lambda ()
(git-gutter:clear) ))
(add-hook 'change-major-mode-hook (lambda ()
(git-gutter:clear) ))
(add-hook 'after-save-hook (lambda ()
(git-gutter:clear) ))
以下是处理Emacs中包含的标准挂钩的文档的链接:
http://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-Hooks.html