unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kai Ma <justksqsf@gmail.com>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: 60196@debbugs.gnu.org
Subject: bug#60196: 29.0.60; re-builder should read all forms for the rx syntax
Date: Fri, 30 Dec 2022 21:45:21 +0800	[thread overview]
Message-ID: <82236308-CB69-43CE-BDAA-F405AD98A114@gmail.com> (raw)
In-Reply-To: <64E4056A-0167-4B41-BB44-60A47C7FA6A5@acm.org>



> On Dec 30, 2022, at 20:28, Mattias Engdegård <mattiase@acm.org> wrote:
> 
> The handling of rx input in re-builder is indeed unsatisfactory. We could adopt your proposed solution:
> 
>> Ideally, re-builder should allow users to simply write
>> 
>>    "<i>" (group (*? anychar)) "</i>"
> 
> which would be a definite improvement. We could also accept a Lisp expression that is evaluated, so that you'd write
> 
>    (rx "<i>" (group (*? anychar)) "</i>")
> 
> On the surface this looks more verbose, but since re-builder itself would provide the `(rx )` boilerplate, there wouldn't actually be any more typing.

Good point!  And it is much easier to copy a whole Sexpr.

> The main advantage would be that regexps could be built up from smaller pieces:
> 
>    (rx-let ((spaces (* " "))
>             (identifier (: alpha (* alnum))))
>      (rx identifier spaces "->" spaces identifier))
> 
> Either would be a definite improvement to the current rather strange re-builder behaviour with respect to rx input. Any preference?

I like your proposal better! :-)






      reply	other threads:[~2022-12-30 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19  9:02 bug#60196: 29.0.60; re-builder should read all forms for the rx syntax Kai Ma
2022-12-30 12:28 ` Mattias Engdegård
2022-12-30 13:45   ` Kai Ma [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=82236308-CB69-43CE-BDAA-F405AD98A114@gmail.com \
    --to=justksqsf@gmail.com \
    --cc=60196@debbugs.gnu.org \
    --cc=mattiase@acm.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).