Subject: bug#36496: [PATCH] Describe the rx notation in the lisp manual

From: Richard Stallman <[email-masked]>
Date: Sun, 07 Jul 2019 19:51:24 -0400

[[[ 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)