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]> |
> Here's an almost final scratch of what I'm working on. Thanks for the patch. I have tested it, and it makes UI nicer. > Before I go ahead with tests and manual entries, I'd like to share it > with you for reviewing code, feature expectations, grammar, doc length > and so on. I have a comment about doc length: the amount of text in the paragraph explaining the details of the function of two arguments looks disproportionally long. > Users can also set 'query-replace-preview-separator' to: > > - nil (automatic default, will use → or -> if not available) > - "" (a custom string in case of wanting another symbol or adding spaces > around, like " → ") Not sure if we need a special option 'query-replace-preview-separator-string' since in rare cases it's possible to change the string using the function in 'query-replace-show-preview'. (Or at least postpone addition until requested by users.) Also the face 'query-replace-preview-separator' doesn't look necessary now since it can be added by the same function (a face still could be added later when requested by users). > Regarding faces, following this scheme: > > [match]→[replace] > 1 2 3 > > The provided faces are: > > 1 -> query-replace-preview-match > 2 -> query-replace-preview-separator > 3 -> query-replace-preview > > Please find attached the diff and some screenshots. Since you added dedicated faces, I have a better suggestion for their default colors. Like the result of replacements can be viewed as a diff (there is even a key 'd' that shows a diff during replacement), let's use diff colors by default where the match has the red background, and the replacement the green background, i.e. colors from diff-mode faces 'diff-removed' and 'diff-added'. Like on the screenshot Karthik posted to emacs-devel. This removes the need to use strike-through that makes the text less readable.