From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: bug#36496: [PATCH] Describe the rx notation in the lisp manual Date: Sun, 07 Jul 2019 19:51:24 -0400 Message-ID: References: <0C783D67-9502-408B-B845-5599BD596361@acm.org> <838stdbw8e.fsf@gnu.org> <83a7draccd.fsf@gnu.org> <0458803b-c701-4706-9843-174b7373cf23@default> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="71882"; mail-complaints-to="usenet@blaine.gmane.org" Cc: mattiase@acm.org, 36496@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 08 01:52:09 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 1hkGwz-000Ib7-LQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 01:52:09 +0200 Original-Received: from localhost ([::1]:37644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkGwy-000372-7H for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Jul 2019 19:52:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43266) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkGwt-00036k-Ko for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 19:52:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkGws-00043P-Hh for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 19:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48749) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkGws-00043J-EX for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 19:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkGws-0005kJ-A5 for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2019 19:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Jul 2019 23:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36496-submit@debbugs.gnu.org id=B36496.156254349322053 (code B ref 36496); Sun, 07 Jul 2019 23:52:02 +0000 Original-Received: (at 36496) by debbugs.gnu.org; 7 Jul 2019 23:51:33 +0000 Original-Received: from localhost ([127.0.0.1]:57570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkGwP-0005jc-5S for submit@debbugs.gnu.org; Sun, 07 Jul 2019 19:51:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkGwN-0005jP-2Y for 36496@debbugs.gnu.org; Sun, 07 Jul 2019 19:51:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hkGwH-0003Z3-F7; Sun, 07 Jul 2019 19:51:25 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hkGwG-0005Ic-6y; Sun, 07 Jul 2019 19:51:24 -0400 In-Reply-To: <0458803b-c701-4706-9843-174b7373cf23@default> (message from Drew Adams on Sun, 7 Jul 2019 00:36:24 +0000 (UTC)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:162311 Archived-At: [[[ 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)