>> Here is a more less final version that I tested on many different diffs: > > Thanks, I have a few minor comments, mainly to the documentation > parts. > >> diff --git a/etc/NEWS b/etc/NEWS >> index decc5e3954..1024e9e9f5 100644 >> --- a/etc/NEWS >> +++ b/etc/NEWS >> @@ -273,6 +273,8 @@ To disable it, set the new defcustom 'diff-font-lock-refine' to nil. >> *** File headers can be shortened, mimicking Magit's diff format >> To enable it, set the new defcustom 'diff-font-lock-prettify to t. >> >> +*** Source language syntax is highlighted in diff hunks when 'diff-font-lock-syntax' is t. > > This line is too long, suggest to rephrase: > > *** Better syntax highlighting of Diff hunks. > Fragments of source in Diff hunks are now by default highlighted > according to the appropriate major mode. Customize the new option > 'diff-font-lock-syntax' to nil to disable this. Changed. >> +@vindex diff-font-lock-syntax >> + If non-nil, diff hunk font-lock includes source language syntax highlighting. > > "nil" should be in @code. Changed. >> diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el >> index ac94586cac..93fa54b1fb 100644 >> --- a/lisp/vc/diff.el >> +++ b/lisp/vc/diff.el >> @@ -165,6 +167,7 @@ diff-no-select >> (lambda (_ignore-auto _noconfirm) >> (diff-no-select old new switches no-async (current-buffer)))) >> (setq default-directory thisdir) >> + (set (make-local-variable 'diff-default-directory) default-directory) > > Any reason not to use setq-local? Only for consistency with other variables in the same file that still don't use make-local-variable. But now I added automatically buffer-local (make-variable-buffer-local 'diff-default-directory) for consistency with `default-directory'. >> +(defun diff--font-lock-syntax (max) >> + "Syntax highlighting from font-lock." > > Although an internal function, could it have a slightly more detailed > do string, please? Done. >> +(defun diff-syntax-fontify-hunk (beg end old) >> + "Highlight source language syntax in diff hunks." > > This is for a single hunk, not "hunks", right? Also, please mention > the arguments in the doc string. Done. >> +(defun diff-syntax-fontify-props (file text line-nb &optional no-init hunk-only) >> + "Get font-lock properties from the source code." > > Please mention the arguments ion the doc string. Done. Also with more highlighting in diff hunks now diff indicators need more distinctive colors that I also tested.