]> code.delx.au - gnu-emacs-elpa/commitdiff
Simplify diff-hl-flydiff/modified-p advice
authorPythonNut <PythonNut@users.noreply.github.com>
Thu, 3 Sep 2015 22:55:40 +0000 (22:55 +0000)
committerPythonNut <PythonNut@users.noreply.github.com>
Thu, 3 Sep 2015 22:55:40 +0000 (22:55 +0000)
diff-hl-flydiff.el

index 6215ab7bc26960786bdd247498e48a1c5cb60278..b5f6b4c851005ec8a07f6850560bb83f475f331d 100644 (file)
@@ -132,14 +132,7 @@ This requires the external program `diff' to be in your `exec-path'."
     (funcall old-fun)))
 
 (defun diff-hl-flydiff/modified-p (state)
-  (or
-    (buffer-modified-p)
-    (eq state 'edited)
-    (and (eq state 'up-to-date)
-      ;; VC state is stale in after-revert-hook.
-      (or revert-buffer-in-progress-p
-        ;; Diffing against an older revision.
-        diff-hl-reference-revision))))
+  (buffer-modified-p))
 
 (defun diff-hl-flydiff/update-modified-tick (&rest args)
   (setq diff-hl-flydiff-modified-tick (buffer-modified-tick)))
@@ -154,7 +147,7 @@ This requires the external program `diff' to be in your `exec-path'."
       (advice-add 'diff-hl-update :around #'diff-hl-flydiff/update)
       (advice-add 'diff-hl-overlay-modified :override #'ignore)
 
-      (advice-add 'diff-hl-modified-p :override
+      (advice-add 'diff-hl-modified-p :before-until
         #'diff-hl-flydiff/modified-p)
       (advice-add 'diff-hl-changes-buffer :override
         #'diff-hl-flydiff-buffer-with-head)