unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Syntactic fontification of diff hunks
@ 2018-08-16 21:08 Juri Linkov
  2018-08-16 21:44 ` Kaushal Modi
  2018-08-17  5:41 ` Yuri Khan
  0 siblings, 2 replies; 12+ messages in thread
From: Juri Linkov @ 2018-08-16 21:08 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 843 bytes --]

Most version control sites like gitlab/github highlight syntax
in code snippets inside diff hunks, for example:
https://github.com/magit/magit/pull/2834/commits/95cacde4fcccc95c25d6fb9988d2aa097193f8c0

This is very helpful when looking at code changes.  I missed this feature in Emacs
for a long time.  This is why I asked a question about a possible implementation in
https://emacs.stackexchange.com/questions/43957/syntactic-fontification-of-diff-hunks
but no one had an answer.

Then I realized that much simpler would be just to use the same approach
implemented by diff-mode refinement, i.e. to take each diff hunk one by
one, and like the diff refinement highlights more fine-grained changes,
do the same for syntax highlighting according to the language in
compared files/commits.

You can see the result at the following screenshot:


[-- Attachment #2: diff-syntax.png --]
[-- Type: image/png, Size: 27954 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-08-19 20:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-16 21:08 Syntactic fontification of diff hunks Juri Linkov
2018-08-16 21:44 ` Kaushal Modi
2018-08-16 22:27   ` Juri Linkov
2018-08-16 22:33     ` Kaushal Modi
2018-08-16 22:41       ` Juri Linkov
2018-08-17  5:41 ` Yuri Khan
2018-08-17  6:00   ` Andreas Röhler
2018-08-17  6:47     ` Yuri Khan
2018-08-17 17:47       ` Juri Linkov
2018-08-17 18:34         ` Yuri Khan
2018-08-19 20:57           ` Juri Linkov
2018-08-18 20:02       ` Andreas Röhler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).