emacs-devel
[Top][All Lists]
Advanced

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

Re: Ugly regexps


From: Stefan Monnier
Subject: Re: Ugly regexps
Date: Wed, 03 Mar 2021 12:44:20 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> Not sure what you mean by "those cases".  I'm thinking this `ere` would
>> be useful for the cases where the author finds `rx` unpalatable for
>> some reason.
> Why would someone find rx unpalatable?

Maybe just because of habit, but I think the main downside of `rx` is
that it's very verbose, which ends up hiding the "text".  For example in

    (rx "(def" (or "macro" "un" "subst")))

I find the `or` to get a bit in the way of my visual cortex recognizing
the "defmacro" pattern above.

> If this is about personal preferences and tastes, then I think having
> 3 different flavors of regexps in our sources due to personal
> preferences is not necessarily a good idea.

Yes, it's the downside.


        Stefan




reply via email to

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