(add-hook 'after-save-hook 'diff-hl-update nil t)\r
(add-hook 'after-change-functions 'diff-hl-edit nil t)\r
(add-hook (if vc-mode\r
+ ;; Defer until the end of this hook, so that its\r
+ ;; elements can modify the update behavior.\r
'diff-hl-mode-on-hook\r
+ ;; If we're only opening the file now,\r
+ ;; `vc-find-file-hook' likely hasn't run yet, so\r
+ ;; let's wait until the state information is\r
+ ;; saved, in order not to fetch it twice.\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
+ ;; Magit does call `auto-revert-handler', but it usually\r
+ ;; doesn't do much, because `buffer-stale--default-function'\r
+ ;; doesn't care about changed VC state.\r
(add-hook 'magit-revert-buffer-hook 'diff-hl-update nil t)\r
(add-hook 'text-scale-mode-hook 'diff-hl-define-bitmaps nil t))\r
(remove-hook 'after-save-hook 'diff-hl-update t)\r