[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ELPA] New package: xr
From: |
Stefan Monnier |
Subject: |
Re: [ELPA] New package: xr |
Date: |
Fri, 01 Mar 2019 08:51:39 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>> I'm definitely in favor of using the standard * + and ?
> They are suggestive but I find `?' a bit on the hacky side. For instance,
> you can't break the line after the operator, since it requires
> a space following.
Oh, indeed, that's a problem.
> Interestingly, (not (any ...)) and (not (in ...)) are valid, but (not (char
> ...)) isn't (although there is `not-char').
I guess this means we should go with `in`.
Tho it should be easy to add (not (char ...)) if needed.
BTE, I don't like (not (any ...)) and (not (in ...)) in any case:
the negation should be within the `char`, `in`, or `any` not around it.
This is because the negation of a regexp RE could be defined as a regexp
which matches all strings not matched by RE (and hence when RE is (any
...), it will also match all strings of length != 1).
This form of negation is supported in lex.el, for example.
> Another implementation leak: since `any' is also an alias for `not-newline',
> `char' and `in' are as well:
> (rx any char in) => "..."
But XR doesn't have to abuse this, luckily.
Stefan