]> code.delx.au - gnu-emacs-elpa/blob - README.md
diff-hl-command-prefix: make it a defcustom
[gnu-emacs-elpa] / README.md
1 About
2 =====
3
4 `diff-hl-mode` highlights uncommitted changes on the left side of the window,
5 allows you to jump between and revert them selectively.
6
7 For the usage instructions and the list of commands, see the Commentary section
8 inside the file.
9
10 Tested with Git, Mercurial, Bazaar and SVN. May work with other VC backends, too.
11
12 The package also contains auxiliary modes:
13
14 * `diff-hl-dired-mode` provides similar functionality in Dired.
15 * `diff-hl-margin-mode` changes the highlighting function to
16 use the margin instead of the fringe.
17 * `diff-hl-amend-mode` shifts the reference revision back by one.
18
19 Check out the Commentary section in each respective file for the usage
20 instructions.
21
22 Screenshots
23 =====
24
25 diff-hl-mode
26 -----
27 Top window: a buffer in this minor mode, bottom window: the corresponding diff.
28
29 ![screenie](screenshot.png)
30
31 diff-hl-dired-mode
32 -----
33
34 ![screenie](screenshot-dired.png)
35
36 diff-hl-margin-mode
37 -----
38
39 ![screenie](screenshot-margin.png)
40
41 Requirements
42 =====
43
44 Emacs 24+. On OS X, Emacs 24.3 or higher is recommended.
45
46 Notes
47 =====
48
49 * Since it uses the corresponding VC diff command, it's only accurate when the
50 buffer is in saved state. Highlighting changes "on the fly" might be better,
51 maybe we can do something similar to `highlight-markup-buffers` with a hidden
52 buffer containing the unmodified copy.
53
54 * We conflict with other modes when they put indicators on the fringe,
55 such as [Flycheck](https://github.com/flycheck/flycheck). This is
56 rarely a significant problem, since if you're using such a mode,
57 you'd usually want to fix all errors and warnings before continuing,
58 and then the conflicting indicators go away.
59
60 * There's no fringe when Emacs is running in the console, but the navigation and
61 revert commands still work. Consider turning `diff-hl-margin-mode` on.
62
63 * Frame-local and buffer-local values of `line-spacing` are not supported.
64
65 * [git-gutter](https://github.com/syohex/emacs-git-gutter) provides interactive
66 commands to show/hide/toggle margin indicators for the same information, and
67 allows you to customize how the indicators look.
68
69 Integration
70 =====
71
72 If you're using some package other than `vc` to commit changes, it might
73 not run `vc-checkin-hook` after commits. In that case, you'll need to
74 either add `diff-hl-update` to the hook it does run, or advise some
75 function that's called in the buffer after its state has changed.
76
77 psvn
78 -----
79
80 ```lisp
81 (defadvice svn-status-update-modeline (after svn-update-diff-hl activate)
82 (diff-hl-update))
83 ```