From: PythonNut Date: Thu, 3 Sep 2015 22:55:40 +0000 (+0000) Subject: Simplify diff-hl-flydiff/modified-p advice X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/2992efd07244df5ff8c1833e9c3e3716ecb2de93 Simplify diff-hl-flydiff/modified-p advice --- diff --git a/diff-hl-flydiff.el b/diff-hl-flydiff.el index 6215ab7bc..b5f6b4c85 100644 --- a/diff-hl-flydiff.el +++ b/diff-hl-flydiff.el @@ -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)