]> code.delx.au - gnu-emacs-elpa/commitdiff
Merge pull request #50 from PythonNut/master
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 5 Sep 2015 03:33:22 +0000 (06:33 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 5 Sep 2015 03:33:22 +0000 (06:33 +0300)
[WIP] Allow diffing on-the-fly

1  2 
README.md
diff-hl.el

diff --cc README.md
Simple merge
diff --cc diff-hl.el
index 18b92c716cba3d3fe5fc983cb5e30b749f15345e,1677798eac4034cc0a44076c424a459f66c4538f..50714b2e3d05c0a24fd312f4b23fcc5e21da7cd8
           (vc-hg-diff-switches nil)
           (vc-svn-diff-switches nil)
           (vc-diff-switches '("-U0"))
 -         (vc-disable-async-diff t))
 +         ,@(when (boundp 'vc-disable-async-diff)
 +             '((vc-disable-async-diff t))))
       ,body))
  
+ (defun diff-hl-modified-p (state)
+   (or (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))))
+ (defun diff-hl-changes-buffer (file backend)
+   (let ((buf-name " *diff-hl* "))
+     (diff-hl-with-diff-switches
+       (vc-call-backend backend 'diff (list file)
+         diff-hl-reference-revision nil
+         buf-name))
+     buf-name))
  (defun diff-hl-changes ()
    (let* ((file buffer-file-name)
           (backend (vc-backend file)))