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

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

[elpa] 04/07: diff-hl-mode: defer diff-hl-update until diff-hl-mode-on-h


From: Dmitry Gutov
Subject: [elpa] 04/07: diff-hl-mode: defer diff-hl-update until diff-hl-mode-on-hook
Date: Sun, 10 Aug 2014 16:33:01 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 21a6d83c325a24fc65f2738b8622e30bdd129f10
Author: Dmitry Gutov <address@hidden>
Date:   Sun Aug 10 20:27:02 2014 +0400

    diff-hl-mode: defer diff-hl-update until diff-hl-mode-on-hook
    
    ...in the best case.
---
 diff-hl.el |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/diff-hl.el b/diff-hl.el
index da1f1a4..be1000a 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -425,9 +425,10 @@ in the source file, or the last line of the hunk above it."
         (diff-hl-maybe-define-bitmaps)
         (add-hook 'after-save-hook 'diff-hl-update nil t)
         (add-hook 'after-change-functions 'diff-hl-edit nil t)
-        (if vc-mode
-            (diff-hl-update)
-          (add-hook 'find-file-hook 'diff-hl-update t t))
+        (add-hook (if vc-mode
+                      'diff-hl-mode-on-hook
+                    '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)
         (add-hook 'magit-revert-buffer-hook 'diff-hl-update nil t)



reply via email to

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