GNU bug report logs - #36496
[PATCH] Describe the rx notation in the lisp manual

Previous Next

Package: emacs;

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


Message #53 received at 36496 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: rms <at> gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Cc: mattiase <at> acm.org, 36496 <at> debbugs.gnu.org
Subject: RE: bug#36496: [PATCH] Describe the rx notation in the lisp manual
Date: Sun, 7 Jul 2019 00:36:24 +0000 (UTC)
>   > I cannot answer the question without knowing which practical factors
>   > made rx inconvenient in the past.  Where can one find this
>   > information?
> 
> I don't know.  I think people discussed it in the
> past -- perhaps on emacs-devel.  I don't remember details.
> 
> What's clear is that rx didn't replace regexp syntax in the past.
> There had to be reasons.

I don't want to sidetrack this thread.  But one of
the things mentioned in some previous threads about
`rx' was that some people (including me) thought it
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.

A regexp string can be very concise (advantage),
even if obtuse (disadvantage).  Much of the time one
doesn't need to dig into the content of the regexp.
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.

In sum, I'd say that one advantage of a regexp is
its concision.  But when you need or want to grok
it it's good to be able to get its `rx' sexp.

With such a feature people could use `rx' or its
result in code, au choix.  And they could see the
`rx' equivalent for a regexp on demand.

This is orthogonal to having good doc for `rx'.
I mention it only because the question came up of
disadvantages of `rx' (reasons why it might not
replace a regexp).

(Another reason, if it's true, would be if there
are some regexp constructs that `rx' cannot
handle/reproduce.)




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.