all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Michael Heerdegen" <michael_heerdegen@web.de>,
	"Mattias Engdegård" <mattiase@acm.org>,
	36237@debbugs.gnu.org, kevin.legouguec@gmail.com
Subject: bug#36237: Support (rx (and (regexp EXPR) (regexp-quote EXPR)))
Date: Sun, 16 Jun 2019 08:25:46 -0400	[thread overview]
Message-ID: <87fto9yawl.fsf@gmail.com> (raw)
In-Reply-To: <jwvy321ahzh.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 16 Jun 2019 07:34:49 -0400")


> [ BTW, please use "--" for rx-compile-to-lisp since I believe it's
>   internal.  ]

I'm not sure that it is, e.g., python-rx might bind it too (if it
weren't for the fact that python.el needs to maintain backwards
compatibility with older Emacs).

> What do regexp and regexp-quote do in rx-to-string?

regexp does exactly what it did before, i.e., it accepts only a constant
string.  Likewise regexp-quote accepts only a constant string, which
makes it pointless to use in rx-to-string (just use a plain STRING
directly), but I didn't disallow it.

Hmm, I think I had meant to update rx-to-string's docstring, but forgot
about it.

>> - A more suitable name is needed; `regexp-quote' makes no sense at all in
>> the context of rx. What about `literal'? For simplicity, I'm proceeding with
>> that name below.
>
> I'll let others figure that one out.

Probably `literal' makes sense.  I originally used regexp-quote, just
because I was thinking of it as a short form of

    (rx (regexp (regexp-quote EXPR)))

>> - What is now the correct way of including a compile-time regexp expression,
>> such as a defconst? (regexp (eval-when-compile EXPR))? Still a mouthful, but
>> perhaps outside the scope of this bug.

Oh, hmm.  That might be a reason to keep using `eval'.

> FWIW, I have the impression that in most cases where this could be
> useful, a better solution would be to provide something like
> `rx-defmacro` and/or `rx-macrolet`.

I guess that could replace the "old crusty" rx-constituents thing too.

>> I have: I'm sitting on a full rewrite, code-named `ry'. It's shorter,
>> much cleaner, and about twice as fast (usually more). The only thing
>> still missing is compatibility with the old crusty `rx-constituents'
>> extension mechanism.
>> 
>> The plan was to replace rx with ry entirely when complete.

How far away is this?  Would it make sense to delay this bug until "ry"
comes in?





  reply	other threads:[~2019-06-16 12:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-15 23:43 bug#36237: Support (rx (and (regexp EXPR) (regexp-quote EXPR))) Noam Postavsky
2019-06-16  0:03 ` Michael Heerdegen
2019-06-16  0:28   ` Noam Postavsky
2019-06-16 10:03 ` Mattias Engdegård
2019-06-16 11:34   ` Stefan Monnier
2019-06-16 12:25     ` Noam Postavsky [this message]
2019-06-16 12:35       ` Stefan Monnier
2019-06-16 19:50         ` Noam Postavsky
2019-06-16 20:04           ` Stefan Monnier
2019-06-16 20:25           ` Drew Adams
2019-06-16 20:34             ` Mattias Engdegård
2019-06-16 21:09               ` Drew Adams
2019-06-17 20:57             ` Juri Linkov
2019-06-18 19:45       ` Mattias Engdegård
2019-06-19  1:34         ` Noam Postavsky
2019-06-19 15:42           ` Mattias Engdegård
2019-06-20  0:29             ` Noam Postavsky
2019-06-20 10:26               ` Mattias Engdegård
2019-06-22 22:05                 ` Noam Postavsky
2019-06-23 11:09                   ` Mattias Engdegård
2019-06-23 15:46                     ` Noam Postavsky
2019-06-24  3:50                       ` Stefan Monnier
2019-06-24 10:52                         ` Mattias Engdegård
2019-06-26  2:07                       ` Noam Postavsky
2019-06-23 14:45                   ` Drew Adams
2019-06-26 12:23 ` Andy Moreton
2019-06-26 12:56   ` Noam Postavsky
2019-06-26 13:08 ` Andy Moreton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fto9yawl.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=36237@debbugs.gnu.org \
    --cc=kevin.legouguec@gmail.com \
    --cc=mattiase@acm.org \
    --cc=michael_heerdegen@web.de \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.