diff options
| author | Juri Linkov | 2018-12-18 01:11:15 +0200 |
|---|---|---|
| committer | Juri Linkov | 2018-12-18 01:11:15 +0200 |
| commit | 6973b1489b24ca4190d24be9e5f887aef2cc9eff (patch) | |
| tree | e3d85774e1b34de4f41103f84e511adcd5a3264d /etc | |
| parent | c5e02f2bce28f3b1f2006ce1f208f4a92ca05ed9 (diff) | |
| download | emacs-6973b1489b24ca4190d24be9e5f887aef2cc9eff.tar.gz emacs-6973b1489b24ca4190d24be9e5f887aef2cc9eff.zip | |
Syntactic fontification of diff hunks (bug#33567)
* lisp/vc/diff-mode.el (diff-font-lock-syntax): New defcustom.
(diff-default-directory): New buffer-local variable.
(diff-indicator-removed, diff-indicator-added)
(diff-indicator-changed): Set foreground to distinctive colors.
(diff-context): Remove colors to make room for syntax highlighting.
(diff-font-lock-keywords): Add diff--font-lock-syntax.
(diff--font-lock-cleanup): Remove diff-mode syntax overlays.
(diff--font-lock-syntax, diff--font-lock-syntax--refresh)
(diff-syntax-fontify-revisions, diff-syntax-fontify-hunk)
(diff-syntax-fontify-props): New functions.
* lisp/vc/diff.el (diff-no-select): Set diff-default-directory to
default-directory.
* doc/emacs/files.texi (Diff Mode): Document diff-font-lock-syntax.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/NEWS | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -413,6 +413,12 @@ and compares their entire trees. | |||
| 413 | *** Hunks are now automatically refined by default. | 413 | *** Hunks are now automatically refined by default. |
| 414 | To disable it, set the new defcustom 'diff-font-lock-refine' to nil. | 414 | To disable it, set the new defcustom 'diff-font-lock-refine' to nil. |
| 415 | 415 | ||
| 416 | +++ | ||
| 417 | *** Better syntax highlighting of Diff hunks. | ||
| 418 | Fragments of source in Diff hunks are now by default highlighted | ||
| 419 | according to the appropriate major mode. Customize the new option | ||
| 420 | 'diff-font-lock-syntax' to nil to disable this. | ||
| 421 | |||
| 416 | *** File headers can be shortened, mimicking Magit's diff format. | 422 | *** File headers can be shortened, mimicking Magit's diff format. |
| 417 | To enable it, set the new defcustom 'diff-font-lock-prettify' to t. | 423 | To enable it, set the new defcustom 'diff-font-lock-prettify' to t. |
| 418 | 424 | ||