]> code.delx.au - gnu-emacs-elpa/commitdiff
diff-hl-mode: defer diff-hl-update until diff-hl-mode-on-hook
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 10 Aug 2014 16:27:02 +0000 (20:27 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 10 Aug 2014 16:27:02 +0000 (20:27 +0400)
...in the best case.

diff-hl.el

index da1f1a4ef91ff5987627a1a9f636aae1d59117f1..be1000a8082bfea2349b309b795532c74632d8a6 100644 (file)
@@ -425,9 +425,10 @@ in the source file, or the last line of the hunk above it."
         (diff-hl-maybe-define-bitmaps)\r
         (add-hook 'after-save-hook 'diff-hl-update nil t)\r
         (add-hook 'after-change-functions 'diff-hl-edit nil t)\r
-        (if vc-mode\r
-            (diff-hl-update)\r
-          (add-hook 'find-file-hook 'diff-hl-update t t))\r
+        (add-hook (if vc-mode\r
+                      'diff-hl-mode-on-hook\r
+                    'find-file-hook)\r
+                  'diff-hl-update t t)\r
         (add-hook 'vc-checkin-hook 'diff-hl-update nil t)\r
         (add-hook 'after-revert-hook 'diff-hl-update nil t)\r
         (add-hook 'magit-revert-buffer-hook 'diff-hl-update nil t)\r