help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

highlighting one buffer according to another


From: Samuel Wales
Subject: highlighting one buffer according to another
Date: Wed, 14 Sep 2022 20:09:29 -0700

this is probably much too much for me but i thought i'd bring it up anyway.

i have a derivative of diff-mode that has special gutter characters.

it captures the diff, its contents, from any other buffer.  suppose
the buffer it captures from is called orig.  it could be magit or
anything else.  and suppose the name of the buffer with special gutter
characters is mydiff.

what i want to do is mark every - or + line in orig, if the
corresponding line in mydiff contains a special gutter character.  for
marking, i haven't decided fully,  but it can maybe change the face
for the - or + line to inverse video.

so part of the problem is finding the corresponding line in orig for
each line in mydiff, and part of it is changing the face of lines in
orig.  [or in principle using fringe or something, but starting with
inverse video seems reasonable.]

a test for plain equality of lines after eliminating gutter etc. would
be sufficient, but some kind of @@ line number syncing or wiggling
might or might not be in principle possible for more accuracy of which
line mydiff refers to.

ideas welcome.  or any code.  i don't have more specific qs than this
beause this is where i got in this.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]