GNU bug report logs -
#50766
Regexp paren pairs in query-replace-regexp prompt should be highlighted
Previous Next
Reported by: ndame <laszlomail <at> protonmail.com>
Date: Thu, 23 Sep 2021 17:01:01 UTC
Severity: wishlist
Tags: moreinfo, patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #25 received at 50766 <at> debbugs.gnu.org (full text, mbox):
> Indeed. I wondered whether we had code that did the right syntax
> marking for regexps so that this would work, but I guess not?
It's not entirely trivial: With "\(" you normally want to put the syntax
table property on the "\" but inside a character alternative you want to
put it on the "(". So you have to re-parse the minibuffer after each
editing change.
Which means we'd have to, at the beginning of 'show-paren--default',
- check whether this is a minibuffer where we want that feature enabled,
- enable 'parse-sexp-lookup-properties' for it,
- syntactically propertize parens, brackets, braces and backslashes
according to their positions within the regexp typed.
That's all. What it would get us are regexps with properly highlighted
parens and proper sexp navigation.
I have written such code for Elisp buffers and can convert and simplify
it to make it work for minibuffers. I suppose it would amount to about
100 lines to add to paren.el and would do it only if you are convinced
that it's worth the effort. It would not handle 'blink-matching-open'.
martin
This bug report was last modified 1 year and 340 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.