]> code.delx.au - gnu-emacs-elpa/blobdiff - README.md
don't assume vc-git-diff-switches is defined
[gnu-emacs-elpa] / README.md
index 4a71d5e0db6d696b14d0a5ce286ed66c4c2cc2ac..725466b46d62cefe238ab00cf47b0059156a94a6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -15,7 +15,8 @@ The package also contains auxiliary modes:
 * `diff-hl-margin-mode` changes the highlighting function to\r
   use the margin instead of the fringe.\r
 * `diff-hl-amend-mode` shifts the reference revision back by one.\r
-* `diff-hl-flydiff-mode` enables diffing unsaved changes\r
+* `diff-hl-flydiff-mode` implements highlighting changes on the fly.\r
+  It requires Emacs 24.4 or newer.\r
 \r
 Check out the Commentary section in each respective file for the usage\r
 instructions.\r
@@ -47,6 +48,20 @@ Emacs 24+. On OS X, Emacs 24.3 or higher is recommended.
 Notes\r
 =====\r
 \r
+* By default `diff-hl-mode` uses the corresponding VC diff command, so\r
+  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
@@ -59,6 +74,9 @@ Notes
 \r
 * Frame-local and buffer-local values of `line-spacing` are not supported.\r
 \r
+* Fringe width up to 16 works best (because we can't define a bitmap\r
+  with width above that number).\r
+\r
 * [emacs-git-gutter](https://github.com/syohex/emacs-git-gutter) shows\r
   indicators in the margin by default, allows you to customize how the\r
   indicators look more easily, and has a "stage hunk" command.\r
@@ -82,5 +100,11 @@ psvn
 Magit\r
 -----\r
 \r
-If you have a recent enough version installed, it defines\r
-`magit-revert-buffer-hook` (or `magit-not-reverted-hook`), which we use.\r
+If you're using a version before 2.4.0, it defines `magit-revert-buffer-hook`\r
+(or `magit-not-reverted-hook`), which we use.\r
+\r
+When using Magit 2.4 or newer, add this to your init script:\r
+\r
+```lisp\r
+(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)\r
+```\r