emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] New package: xr


From: Mattias Engdegård
Subject: Re: [ELPA] New package: xr
Date: Fri, 1 Mar 2019 14:39:24 +0100

1 mars 2019 kl. 00.06 skrev Stefan Monnier <address@hidden>:

> 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.

>> any char in
> 
> I think I prefer `char` or `in`.

Interestingly, (not (any ...)) and (not (in ...)) are valid, but (not (char 
...)) isn't (although there is `not-char').

Another implementation leak: since `any' is also an alias for `not-newline', 
`char' and `in' are as well:
(rx any char in) => "..."

>> line-start bol
>> line-end eol
>> string-start buffer-start bos bot
>> string-end buffer-end eos eot
>> word-start bow
>> word-end eow
> 
> I like the boX/eoX nomenclature.
> 
> The main benefit of RX is to make the structure more visible, and the
> main downside is to make regexp more verbose, so I think short
> identifiers are preferable.

There is definitely merit to that, although I also have sympathy for the 
verbosity preferred by others.
Lisp seems to cope with long identifiers better than most other languages 
(dashes permitted, easy line breaking).

I'm leaning towards giving xr a brief and verbose options, and let the default 
be in the middle somewhere.

>> sequence seq and :
> 
> I'm strongly opposed to `and` because that should mean the
> conjunction/intersection of two regexps (i.e. a string matches it only
> if it matches both sub-regexps) rather than the sequential concatenation.
> [ lex.el supports such intersections.  ]

Strongly agreed!




reply via email to

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