]> code.delx.au - gnu-emacs-elpa/blobdiff - README.md
diff-hl-dired: Highlight ignored files
[gnu-emacs-elpa] / README.md
index 740dbf61afbf95a4a6b0e933ff48a6361316fe4e..325f53ea570c349cbb6f346eafedf7f4106ef82c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,34 +1,90 @@
 About\r
 =====\r
 \r
-`diff-hl-mode` provides IDE-like highlighting of `vc-diff` results on the left\r
-fringe of the current buffer.\r
+`diff-hl-mode` highlights uncommitted changes on the left side of the window,\r
+allows you to jump between and revert them selectively.\r
 \r
-Since it uses the corresponding VC diff command, it's only accurate when the\r
-buffer is in saved state.\r
+For the usage instructions and the list of commands, see the Commentary section\r
+inside the file.\r
 \r
-Additionally, it defines and binds\r
+Tested with Git, Mercurial, Bazaar and SVN. May work with other VC backends, too.\r
 \r
-* `diff-hl-diff-goto-hunk` (`C-x v =`)\r
-* `diff-hl-revert-hunk` (`C-x v n`)\r
-* `diff-hl-previous-hunk` (`C-x v [`)\r
-* `diff-hl-next-hunk` (`C-x v ]`)\r
+The package also contains auxiliary modes:\r
 \r
-Tested with Git, Mercurial, and Bazaar. May work with other VC backends, too.\r
+* `diff-hl-dired-mode` provides similar functionality in Dired.\r
+* `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
 \r
-Usage\r
+Check out the Commentary section in each respective file for the usage\r
+instructions.\r
+\r
+Screenshots\r
+=====\r
+\r
+diff-hl-mode\r
+-----\r
+Top window: a buffer in this minor mode, bottom window: the corresponding diff.\r
+\r
+![screenie](screenshot.png)\r
+\r
+diff-hl-dired-mode\r
+-----\r
+\r
+![screenie](screenshot-dired.png)\r
+\r
+diff-hl-margin-mode\r
+-----\r
+\r
+![screenie](screenshot-margin.png)\r
+\r
+Requirements\r
 =====\r
 \r
-Ensure `diff-hl.el` is in a directory on your load-path, and add the following\r
-to your `~/.emacs` or `~/.emacs.d/init.el`\r
+Emacs 24+. On OS X, Emacs 24.3 or higher is recommended.\r
+\r
+Notes\r
+=====\r
+\r
+* Since it uses the corresponding VC diff command, it's only accurate when the\r
+  buffer is in saved state. Highlighting changes "on the fly" might be better,\r
+  maybe we can do something similar to `highlight-markup-buffers` with a hidden\r
+  buffer containing the unmodified copy.\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
+  you'd usually want to fix all errors and warnings before continuing,\r
+  and then the conflicting indicators go away.\r
+\r
+* There's no fringe when Emacs is running in the console, but the navigation\r
+  and revert commands still work. Consider turning `diff-hl-margin-mode` on,\r
+  to show the indicators in the margin instead.\r
+\r
+* Frame-local and buffer-local values of `line-spacing` are not supported.\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
+\r
+Integration\r
+=====\r
 \r
-    (require 'diff-hl)\r
+If you're using some package other than `vc` to commit changes, it might\r
+not run `vc-checkin-hook` after commits. In that case, you'll need to\r
+either add `diff-hl-update` to the hook it does run, or advise some\r
+function that's called in the buffer after its state has changed.\r
 \r
-and, to use it in all buffers\r
+psvn\r
+-----\r
 \r
-    (global-diff-hl-mode)\r
+```lisp\r
+(defadvice svn-status-update-modeline (after svn-update-diff-hl activate)\r
+  (diff-hl-update))\r
+```\r
 \r
-or, for example, to use it in all `prog-mode` and `vc-dir-mode` buffers\r
+Magit\r
+-----\r
 \r
-    (add-hook 'prog-mode-hook 'turn-on-diff-hl-mode)\r
-    (add-hook 'vc-dir-mode-hook 'turn-on-diff-hl-mode)\r
+If you have a recent enough version installed, it defines\r
+`magit-revert-buffer-hook`, which we use.\r