GNU bug report logs -
#36496
[PATCH] Describe the rx notation in the lisp manual
Previous Next
Reported by: Mattias EngdegÄrd <mattiase <at> acm.org>
Date: Thu, 4 Jul 2019 12:14:01 UTC
Severity: wishlist
Merged with 31698
Found in version 27.0
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> would be great if you could invoke a command on a
> regexp (e.g. a regexp string in code) and have an
> equivalent `rx' expression pop up, for inspection
> and understanding.
I agree. That would make rx much more convenient for people who like
the shortness of some regexps. It could be part of Lisp mode, so you
could use this on a regexp constant in a source file.
I suspect that the long-windedness of rx input is a substantial
deterrent to its use. It may be better for complex patterns but worse
for simple ones.
> It would be nice to be able to have only the result
> of `rx' in the code and be able to get its `rx'
> expression on demand.
I think it would be clearer, usually, for Lisp source to have the rx
form. That would help people get used to rx. For complex patterns,
the rx form is easier to understand and change.
WHat would people think of making all the functions that want a regexp
accept an rx input equivalently? If the arg is not a string, treat it
as rx format. Compilation could convert a constant non-string, for
such args, to a regexp string.
Commands that read a regexp using the minibuffer could offer a key to
say that you are entering rx format. The only problem is, which key
would it be?
--
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
This bug report was last modified 3 years and 21 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.