]> code.delx.au - gnu-emacs-elpa/blob - README.md
vc-disable-async-diff: Don't bind when it's undefined
[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
61 and revert commands still work. Consider turning `diff-hl-margin-mode` on,
62 to show the indicators in the margin instead.
63
64 * Frame-local and buffer-local values of `line-spacing` are not supported.
65
66 * Fringe width up to 16 works best (because we can't define a bitmap
67 with width above that number).
68
69 * [emacs-git-gutter](https://github.com/syohex/emacs-git-gutter) shows
70 indicators in the margin by default, allows you to customize how the
71 indicators look more easily, and has a "stage hunk" command.
72
73 Integration
74 =====
75
76 If you're using some package other than `vc` to commit changes, it might
77 not run `vc-checkin-hook` after commits. In that case, you'll need to
78 either add `diff-hl-update` to the hook it does run, or advise some
79 function that's called in the buffer after its state has changed.
80
81 psvn
82 -----
83
84 ```lisp
85 (defadvice svn-status-update-modeline (after svn-update-diff-hl activate)
86 (diff-hl-update))
87 ```
88
89 Magit
90 -----
91
92 If you have a recent enough version installed, it defines
93 `magit-revert-buffer-hook` (or `magit-not-reverted-hook`), which we use.