]> code.delx.au - gnu-emacs-elpa/blobdiff - diff-hl-amend.el
diff-hl-amend-mode: Don't defer via find-file-hook
[gnu-emacs-elpa] / diff-hl-amend.el
index ba93298c106c9097e44a3757eba8e1167250713e..713f83824b27c2407d46c4fa043d800bef265124 100644 (file)
 
 ;;; Code:
 
+(require 'diff-hl)
+
 ;;;###autoload
 (define-minor-mode diff-hl-amend-mode
   "Show changes against the second-last revision in `diff-hl-mode'.
-Most useful with VCSes that support rewriting local commits, and
-'amending' the most recent one in particular.
+Most useful with backends that support rewriting local commits,
+and most importantly, 'amending' the most recent one.
 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