[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ediff refinement issues
From: |
Stefan Monnier |
Subject: |
Re: ediff refinement issues |
Date: |
Tue, 30 Mar 2021 22:56:00 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>>> However, if the paragraphs are commented (for example,
>>> with ;;; in elisp or # in shell), it highlights the ;;;
>>> or the #. it also sometimes highlights words as a side
>>> effect.
FWIW, this is largely unavoidable.
Refilling has an effect similar to replacing
foo bar ;; baz
with
foo ;; bar baz
So the "fine" diff indicates that semi colons were removed at one place
and inserted at the other. In order to "abstract away" semi-colons
which are placed at the beginning of all lines, it would take extra work
and neither ediff nor smerge does that. I haven't thought about how
easy/hard it might be to implement such a thing (but at first glance,
I'd say it's probably not trivial).
As for why ediff sometimes highlights words and not smerge, I suspect
it's mostly an accident (linked to the details of how the fine-diffs are
defined in the two cases). E.g. in the above example you could also say
that what happened is that "bar" was removed at one place and inserted
at another. That's also valid, tho less good. Maybe Ediff gets it
"less good" more often than Smerge because it doesn't have the
equivalent of `smerge-refine-weight-hack` which marks "move ;;" as less
costly than "move bar" in the above example?
Stefan