all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri Khan <yurivkhan@gmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Syntactic fontification of diff hunks
Date: Fri, 17 Aug 2018 12:41:10 +0700	[thread overview]
Message-ID: <CAP_d_8WrD1vek3PoKaNMYRAceGZR47whGsuTnn3eJW+0f70RFA@mail.gmail.com> (raw)
In-Reply-To: <87in4af29r.fsf@mail.linkov.net>

On Fri, Aug 17, 2018 at 4:41 AM Juri Linkov <juri@linkov.net> wrote:
>
> 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.

Oh yesss.

> 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.

I suppose some integration will be needed before this works in Magit, too?

Also, it looks like it’s going to be somewhere between slightly and
horribly inaccurate depending on where the hunk starts (e.g. in the
middle of a string literal or comment)?



  parent reply	other threads:[~2018-08-17  5:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP_d_8WrD1vek3PoKaNMYRAceGZR47whGsuTnn3eJW+0f70RFA@mail.gmail.com \
    --to=yurivkhan@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.