bug#81583: 32.0.50; Optional preview of the replacement text while typing it

Juri Linkov <[email protected]>
Newsgroups gmane.emacs.bugs
Organization LINKOV.NET
Message-ID <[email protected]>
> I made it closer to Karthik's screenshot, also added the diff faces as
> base for the feature.  Much better.

Thanks, indeed it's much better.

> The diff faces are not autoloaded, so a top-level `require` would load
> them even when they aren't needed.  That's why the `require` is in
> `replace-preview-setup`, in the branch that only runs when the preview
> is enabled. Is this acceptable?

Requiring diff-mode just for faces doesn't look right.

> The alternative would be to copy the color values from `diff-mode.el`
> into the two faces.  That would avoid the load, but it would duplicate
> the colors and ignore any customizations the user or theme has made to
> the diff faces.

Duplication of face definitions doesn't look right either.

What we can do is to add new generic faces in faces.el
by copying face definitions from diff-mode, then inherit
from them in packages.  But unfortunately this will lose
any customizations by users.

I don't remember why we don't use ###autoload for defface.
But adding ###autoload to these two faces in diff-mode.el
could solve the problem.

> An extra: Zero-length matches are better than before (at least for the
> 'both case), since an empty match at least shows the arrow, so there is
> something at the spot.  I still think it deserves a change of its own
> when we finish this part of the feature.

Yes, for the value 'both' a placeholder for an empty match is not much needed.
But still it would be better to have it at least for the 't' case.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.