From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#36237: Support (rx (and (regexp EXPR) (regexp-quote EXPR))) Date: Sun, 16 Jun 2019 08:25:46 -0400 Message-ID: <87fto9yawl.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="14590"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: Michael Heerdegen , Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 36237@debbugs.gnu.org, kevin.legouguec@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 16 14:27:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hcUFZ-0003hI-O3 for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Jun 2019 14:27:09 +0200 Original-Received: from localhost ([::1]:39410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcUFY-0000oj-Qz for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Jun 2019 08:27:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40324) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcUFT-0000od-Lr for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 08:27:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcUFS-0005iv-L5 for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 08:27:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54617) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hcUFS-0005ig-ET for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 08:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hcUFS-0003Qs-81 for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2019 08:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Jun 2019 12:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36237 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36237-submit@debbugs.gnu.org id=B36237.156068796213103 (code B ref 36237); Sun, 16 Jun 2019 12:27:02 +0000 Original-Received: (at 36237) by debbugs.gnu.org; 16 Jun 2019 12:26:02 +0000 Original-Received: from localhost ([127.0.0.1]:39928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcUET-0003PD-L9 for submit@debbugs.gnu.org; Sun, 16 Jun 2019 08:26:01 -0400 Original-Received: from mail-io1-f43.google.com ([209.85.166.43]:40301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hcUER-0003Ov-Vc for 36237@debbugs.gnu.org; Sun, 16 Jun 2019 08:26:00 -0400 Original-Received: by mail-io1-f43.google.com with SMTP id n5so15384403ioc.7 for <36237@debbugs.gnu.org>; Sun, 16 Jun 2019 05:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=QDkJABNnDIZVKpozS3iLmTxU3BIcq709QMWvspkmk+Y=; b=RkyYrp+NA7Y2OHLS/rjmCNJaegnhq5WIaKFhfkODCykRGiJFby9V1M4nbF3qQgdRBB P0aJAo33vEm9P1p7ATapN8hGSLh/f8s2AVtzBOt2l4/Yzr/Z1Q3wa/S2aizsa6Zmmpmr Ozzc1YTIh5l/3U/EXlNQRvn9qYgo6SbPaJLjZ+Mru2eaWcpuK76oPIXDL1VQosZ36bhj 6xE6OHVDkTwWYozmpM7YfK/jyaEfJByGbOkgQWk6p/h/8U6NqL1iXw9WpZRuzUibv0rE q0BI6+7ySxRYQpAtCAtH3/+7POARmzz2193fSJ0RFd5fOCITon+hcs6LTzYjVJm/pJI1 AGOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=QDkJABNnDIZVKpozS3iLmTxU3BIcq709QMWvspkmk+Y=; b=omeVhHM7YwuJINjnPNn/uAboKdiU//oOtRf0sNYt24v6PrBTK+dZISjECmqFEO8dzO U/jqloG5sTIOvuzPXBxt9UeCEjVUKrOaS+QdmSuKjwbquTbXoT6LQMdDo0rzJzATjIPe 9oILIqQq0WnhbG4+Y83/B2tGLnyLCzzI6TPLswV9bV9kaVDs64aI3ajYDkgDgLz3opeE 4AERlx3NK4ggZWRtB67WzJpdFbO4Bn8+h5ebsNTuRAq++dQddBD2Bop4LU3TqpVV/oFp 59W/LRiIIvtwVTY3/Pladxjip5Dn0EEBFTwYa1PpWzbiD9bTU+w1ZjhwYwNle+X6WaA1 0mOQ== X-Gm-Message-State: APjAAAWs/KhwxAJ/Z72R3wEB2pqwWmLFspN16giXLUksdoQtDppNJVSW sBjWcKNSwJ2TsHcW9Ds6LyM= X-Google-Smtp-Source: APXvYqxsawxXFX2gbpOA6qiGlOEI7mCFoPcFFBY3+4RVCILhDHGPZTIS5WzjC432qV4uTFVZNWIzsA== X-Received: by 2002:a5d:8759:: with SMTP id k25mr16300830iol.307.1560687951224; Sun, 16 Jun 2019 05:25:51 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id a1sm6825535ioo.5.2019.06.16.05.25.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Jun 2019 05:25:48 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 16 Jun 2019 07:34:49 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160665 Archived-At: > [ 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?