]> code.delx.au - gnu-emacs-elpa/commitdiff
Merge commit 'e93367512080e540dc5dd126dfcb38b4a5e9415b' from diff-hl
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 23 Jun 2016 01:18:12 +0000 (04:18 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 23 Jun 2016 01:18:12 +0000 (04:18 +0300)
1  2 
packages/diff-hl/README.md
packages/diff-hl/diff-hl-flydiff.el
packages/diff-hl/diff-hl.el

index b8bbe3a2724188fc231329144320e1daf2aaefb0,725466b46d62cefe238ab00cf47b0059156a94a6..725466b46d62cefe238ab00cf47b0059156a94a6
@@@ -52,6 -52,16 +52,16 @@@ Note
    it's only accurate when the buffer is in saved state. Check out\r
    `diff-hl-flydiff-mode`, it aims to handle unsaved buffers as well.\r
  \r
+ * To use an\r
+   [alternative diff algorithm](http://stackoverflow.com/questions/32365271/whats-the-difference-between-git-diff-patience-and-git-diff-histogram)\r
+   with Git, add a corresponding argument to `vc-git-diff-switches`,\r
+   e.g. `(setq vc-git-diff-switches '("--histogram"))`. Using the\r
+   `diff.algorithm` option doesn't work\r
+   [because](http://article.gmane.org/gmane.comp.version-control.git/294622)\r
+   `vc-git-diff` calls `git diff-index`. `diff-hl-flydiff-mode` does\r
+   not support alternative algorithms, because it uses the external\r
+   `diff` program.\r
\r
  * We conflict with other modes when they put indicators on the fringe,\r
    such as [Flycheck](https://github.com/flycheck/flycheck). This is\r
    rarely a significant problem, since if you're using such a mode,\r
index 94dbbd7f6d9e89f68536d9a37ccd86884d18e3b3,7f0c6c7de03f41aa0c624bd09dc5f2c2afc6fff1..7f0c6c7de03f41aa0c624bd09dc5f2c2afc6fff1
@@@ -39,7 -39,7 +39,7 @@@
    :type 'number)
  
  (defvar diff-hl-flydiff-modified-tick 0)
- (defvar diff-hl-flydiff-timer)
+ (defvar diff-hl-flydiff-timer nil)
  (make-variable-buffer-local 'diff-hl-flydiff-modified-tick)
  
  (defun diff-hl-flydiff/vc-git--symbolic-ref (file)
@@@ -167,6 -167,7 +167,7 @@@ This requires the external program `dif
      (advice-remove 'diff-hl-modified-p #'diff-hl-flydiff/modified-p)
      (advice-remove 'diff-hl-changes-buffer #'diff-hl-flydiff-buffer-with-head)
  
-     (cancel-timer diff-hl-flydiff-timer)))
+     (and diff-hl-flydiff-timer
+          (cancel-timer diff-hl-flydiff-timer))))
  
  (provide 'diff-hl-flydiff)
index 2aaabd431dd39d15b4bd725df0ab0a8183fd8a4f,6650818ce880bd69c9155c3f1dca942fa763b67a..6650818ce880bd69c9155c3f1dca942fa763b67a
@@@ -5,7 -5,7 +5,7 @@@
  ;; Author:   Dmitry Gutov <dgutov@yandex.ru>
  ;; URL:      https://github.com/dgutov/diff-hl
  ;; Keywords: vc, diff
- ;; Version:  1.8.3
+ ;; Version:  1.8.4
  ;; Package-Requires: ((cl-lib "0.2"))
  
  ;; This file is part of GNU Emacs.
  (defvar vc-svn-diff-switches)
  
  (defmacro diff-hl-with-diff-switches (body)
-   `(let ((vc-git-diff-switches nil)
+   `(let ((vc-git-diff-switches
+           ;; https://github.com/dgutov/diff-hl/issues/67
+           (cons "-U0"
+                 ;; https://github.com/dgutov/diff-hl/issues/9
+                 (and (boundp 'vc-git-diff-switches)
+                      (listp vc-git-diff-switches)
+                      (cl-remove-if-not
+                       (lambda (arg)
+                         (member arg '("--histogram" "--patience" "--minimal")))
+                       vc-git-diff-switches))))
           (vc-hg-diff-switches nil)
           (vc-svn-diff-switches nil)
           (vc-diff-switches '("-U0"))