From: Dmitry Gutov Date: Wed, 6 Jan 2016 19:01:44 +0000 (+0300) Subject: Remove diff-hl-flydiff/update-modified-tick advice X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/5badd5def53d8e8d0c7e937c671eb09a4a7587c6 Remove diff-hl-flydiff/update-modified-tick advice It was broken: * There's no function called diff-hl-change. * Calling it from after-change-functions meant the tick value seemed always up to date. --- diff --git a/diff-hl-flydiff.el b/diff-hl-flydiff.el index a63bc06e4..e5a6111f4 100644 --- a/diff-hl-flydiff.el +++ b/diff-hl-flydiff.el @@ -124,6 +124,7 @@ the user should be returned." This requires the external program `diff' to be in your `exec-path'." (interactive) (vc-ensure-vc-buffer) + (setq diff-hl-flydiff-modified-tick (buffer-modified-tick)) (with-current-buffer (get-buffer (current-buffer)) (let* ((temporary-file-directory (if (file-directory-p "/dev/shm/") @@ -139,16 +140,12 @@ This requires the external program `diff' to be in your `exec-path'." (unless (and auto (or (= diff-hl-flydiff-modified-tick (buffer-modified-tick)) - (file-remote-p default-directory) - (not (buffer-modified-p)))) + (file-remote-p default-directory))) (funcall old-fun))) (defun diff-hl-flydiff/modified-p (state) (buffer-modified-p)) -(defun diff-hl-flydiff/update-modified-tick (&rest args) - (setq diff-hl-flydiff-modified-tick (buffer-modified-tick))) - ;;;###autoload (define-minor-mode diff-hl-flydiff-mode "Highlight diffs on-the-fly" @@ -163,9 +160,6 @@ This requires the external program `diff' to be in your `exec-path'." #'diff-hl-flydiff/modified-p) (advice-add 'diff-hl-changes-buffer :override #'diff-hl-flydiff-buffer-with-head) - (advice-add 'diff-hl-change :after - #'diff-hl-flydiff/update-modified-tick) - (setq diff-hl-flydiff-timer (run-with-idle-timer diff-hl-flydiff-delay t #'diff-hl-update t))) @@ -174,7 +168,6 @@ This requires the external program `diff' to be in your `exec-path'." (advice-remove 'diff-hl-modified-p #'diff-hl-flydiff/modified-p) (advice-remove 'diff-hl-changes-buffer #'diff-hl-flydiff-buffer-with-head) - (advice-remove 'diff-hl-change #'diff-hl-flydiff/update-modified-tick) (cancel-timer diff-hl-flydiff-timer)))