emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 01/02: diff-hl-mode: add comments


From: Dmitry Gutov
Subject: [elpa] 01/02: diff-hl-mode: add comments
Date: Mon, 11 Aug 2014 00:00:41 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 4709fc4530da4ddfd29b910763c801292b228f69
Author: Dmitry Gutov <address@hidden>
Date:   Mon Aug 11 03:59:46 2014 +0400

    diff-hl-mode: add comments
---
 diff-hl.el |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/diff-hl.el b/diff-hl.el
index a2a8d38..c116a6e 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -426,11 +426,20 @@ in the source file, or the last line of the hunk above 
it."
         (add-hook 'after-save-hook 'diff-hl-update nil t)
         (add-hook 'after-change-functions 'diff-hl-edit nil t)
         (add-hook (if vc-mode
+                      ;; Defer until the end of this hook, so that its
+                      ;; elements can modify the update behavior.
                       'diff-hl-mode-on-hook
+                    ;; If we're only opening the file now,
+                    ;; `vc-find-file-hook' likely hasn't run yet, so
+                    ;; let's wait until the state information is
+                    ;; saved, in order not to fetch it twice.
                     'find-file-hook)
                   'diff-hl-update t t)
         (add-hook 'vc-checkin-hook 'diff-hl-update nil t)
         (add-hook 'after-revert-hook 'diff-hl-update nil t)
+        ;; Magit does call `auto-revert-handler', but it usually
+        ;; doesn't do much, because `buffer-stale--default-function'
+        ;; doesn't care about changed VC state.
         (add-hook 'magit-revert-buffer-hook 'diff-hl-update nil t)
         (add-hook 'text-scale-mode-hook 'diff-hl-define-bitmaps nil t))
     (remove-hook 'after-save-hook 'diff-hl-update t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]