]> code.delx.au - gnu-emacs-elpa/commitdiff
diff-hl-amend-mode: Don't defer via find-file-hook
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 6 Sep 2013 09:03:16 +0000 (12:03 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 6 Sep 2013 09:03:16 +0000 (12:03 +0300)
Simpler model at the cost of +1 external process call (#11).

diff-hl-amend.el

index 3f65cb75104370ac9fbdc963da9e9b9a1f2b2674..713f83824b27c2407d46c4fa043d800bef265124 100644 (file)
@@ -34,11 +34,8 @@ Currently only supports Git, Mercurial and Bazaar."
   :lighter " Amend"
   (if diff-hl-amend-mode
       (progn
-        (if vc-mode
-            (diff-hl-amend-setup)
-          (add-hook 'find-file-hook 'diff-hl-amend-setup nil t))
+        (diff-hl-amend-setup)
         (add-hook 'after-revert-hook 'diff-hl-amend-setup nil t))
-    (remove-hook 'find-file-hook 'diff-hl-amend-setup t)
     (remove-hook 'after-revert-hook 'diff-hl-amend-setup t)
     (setq-local diff-hl-reference-revision nil))
   (when diff-hl-mode