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

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

bug#31953: feature request - `highlight-rx` interactively


From: VanL
Subject: bug#31953: feature request - `highlight-rx` interactively
Date: Sat, 02 Nov 2019 19:30:46 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (berkeley-unix)

Juri Linkov <juri@linkov.net> writes:

>>> i.e. These would be equivalent:
>>>
>>> M-x highlight-rx RET (or "foo" "bar") RET
>>> M-x highlight-regexp RET \(foo\|bar\) RET
>>
>> What I can tell from the emacs-devel list and the git log is the rx
>> feature is being worked on.  I'd like to use rx everywhere regexp occurs
>> and highlight-rx would be the first easy use case.
>
> Do you mean using rx also in all search and replace commands?

I guess so if that makes sense to do farther down the track.
The advantage to using rx is to avoid those repeating
pathological toothpick sequences that are difficult to track.
For now, highlight-rx for searching is enough.

> But the documentation says:
>
>      The ‘rx’ notation is mainly useful in Lisp code; it cannot be used in
>   most interactive situations where a regexp is requested, such as when
>   running ‘query-replace-regexp’ or in variable customisation.

For search and replace, I don't know if it would be possible to
use in org-mode in the future, say, a table of three columns
having

1. input pattern
2. output 'desired' pattern
3. rx pattern which is generated automatically for 2

>> At the limit there are things expressible in regexp that rx won't be
>> able to.  And, in that case, I'd like to see in the rx documentation
>> a sign post to regexp at depth for that.  And, if there are patterns
>> rx and/or regexp are unable to express then providing a see also for
>> those would be a help.
>
> There is still some shortcomings in the current rx shorthands: ...

I guess the rx keywords will evolve to fit better with
experience.  Statistics are beginning to be collected on the
reported bugs.  Perhaps, rx can be used there where it makes
sense.





reply via email to

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