emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 5badd5d 03/10: Remove diff-hl-flydiff/update-modified-tick


From: Dmitry Gutov
Subject: [elpa] master 5badd5d 03/10: Remove diff-hl-flydiff/update-modified-tick advice
Date: Sun, 10 Jan 2016 15:47:43 +0000

branch: master
commit 5badd5def53d8e8d0c7e937c671eb09a4a7587c6
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    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-hl-flydiff.el |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/diff-hl-flydiff.el b/diff-hl-flydiff.el
index a63bc06..e5a6111 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)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]