]> code.delx.au - gnu-emacs-elpa/blobdiff - diff-hl-flydiff.el
#'diff-hl-flydiff/overlay-modified → #'ignored
[gnu-emacs-elpa] / diff-hl-flydiff.el
index 3d7c2c7f4caea61700e96193bec2368247054b87..4cd2bad5fb1a729c63dc3c64580089d88078766f 100644 (file)
@@ -20,6 +20,9 @@
 
 ;;; Commentary:
 
+;; This mode enables diffing on-the-fly (i.e. without saving the buffer first)
+;; Toggle in all buffers with M-x diff-hl-flydiff-mode
+
 ;;; Code:
 
 (require 'diff-hl)
@@ -29,7 +32,7 @@
 (make-variable-buffer-local 'diff-hl-flydiff-modified-tick)
 
 ;; Polyfill concrete revisions for vc-git-working-revision in Emacs 24.4, 24.5
-(when (version<= emacs-version "24.5")
+(when (version<= emacs-version "25.0")
   (with-eval-after-load 'vc-git
     (defun vc-git--symbolic-ref (file)
       (or
@@ -167,8 +170,6 @@ This requires the external program `diff' to be in your `exec-path'."
           ((eq state 'removed)
             `((1 ,(line-number-at-pos (point-max)) delete))))))))
 
-(defun diff-hl-flydiff/overlay-modified (&rest args))
-
 ;;;###autoload
 (define-minor-mode diff-hl-flydiff-mode
   "Highlight diffs on-the-fly"
@@ -177,12 +178,9 @@ This requires the external program `diff' to be in your `exec-path'."
   (if diff-hl-flydiff-mode
     (progn
       (require 'nadvice)
-      (advice-add 'diff-hl-update :around
-        #'diff-hl-flydiff/update)
-      (advice-add 'diff-hl-changes :override
-        #'diff-hl-flydiff/changes)
-      (advice-add 'diff-hl-overlay-modified :override
-        #'diff-hl-flydiff/overlay-modified)
+      (advice-add 'diff-hl-update :around #'diff-hl-flydiff/update)
+      (advice-add 'diff-hl-changes :override #'diff-hl-flydiff/changes)
+      (advice-add 'diff-hl-overlay-modified :override #'ignored)
 
       (remove-hook 'after-change-functions #'diff-hl-edit t)
       (setq diff-hl-flydiff-timer
@@ -190,8 +188,7 @@ This requires the external program `diff' to be in your `exec-path'."
 
     (advice-remove 'diff-hl-update #'diff-hl-flydiff/update)
     (advice-remove 'diff-hl-changes #'diff-hl-flydiff/changes)
-    (advice-remove 'diff-hl-overlay-modified
-      #'diff-hl-flydiff/overlay-modified)
+    (advice-remove 'diff-hl-overlay-modified #'ignored)
 
     (cancel-timer diff-hl-flydiff-timer)
     (when diff-hl-mode