emacs-devel
[Top][All Lists]
Advanced

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

Re: regular expressions that match nothing


From: Stefan Monnier
Subject: Re: regular expressions that match nothing
Date: Fri, 17 May 2019 08:53:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> similar long symbols were introduced this would be a pain - a minor pain
> yes, but a pain nevertheless.

While it's long, it's shorter than the cryptic regexp itself if you take
into account the comment that had to accompany the regexp to explain it
and that now is made unnecessary because the name is self-explanatory.

> Why has nobody commented on my suggestion of using re- rather than
> regexp- as the prefix?  We already have re-search-forward.

I recommended "regexp-".  I like brevity and plead guilty of preferring
"-re" (over "-regexp") suffixes in variable names.  Yet I recommended
"regexp-" because it seems to be what Elisp is standardizing on
(e.g. compare `C-h o re- TAB` and `C-h o regexp- TAB`; or look at the
number of variables that were renamed from "-re" to "-regexp") and
I think uniformity and understandability here trumps saving a few chars.
Especially because this is not used very often at all.
Of course, feel free to define `c-nomatch` ;-)

My own favorite is <prefix>-∅ which I believe is the shortest of all the
suggestions I've seen pass by; yet I don't think we want to go that way.

Clearly, this is prime bikeshedding material, so I'll just support the
code author's choice because he was the one who finally did it, after
all these years where it's been mentioned as something we could/should do.


        Stefan




reply via email to

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