+;; Copyright (C) 2012-2013 Free Software Foundation, Inc.
+
;; Author: Dmitry Gutov <dgutov@yandex.ru>
;; URL: https://github.com/dgutov/diff-hl
-;; This file is not part of GNU Emacs.
+;; This file is part of GNU Emacs.
-;; This file is free software: you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
-;; This file is distributed in the hope that it will be useful,
+;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;; 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