X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/20857ea5f2f8d348f93feecacaa5e0f7846d26c8..e93367512080e540dc5dd126dfcb38b4a5e9415b:/diff-hl-amend.el diff --git a/diff-hl-amend.el b/diff-hl-amend.el index f3a151b38..defb3f45e 100644 --- a/diff-hl-amend.el +++ b/diff-hl-amend.el @@ -1,14 +1,16 @@ +;; Copyright (C) 2012-2013 Free Software Foundation, Inc. + ;; Author: Dmitry Gutov ;; 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. @@ -23,20 +25,19 @@ ;;; 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-set) - (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 @@ -61,3 +62,7 @@ Currently only supports Git, Mercurial and Bazaar." (defun turn-on-diff-hl-amend-mode () "Turn on `diff-hl-amend-mode' in a buffer if appropriate." (and buffer-file-name (diff-hl-amend-mode 1))) + +(provide 'diff-hl-amend) + +;;; diff-hl-amend.el ends here