From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Off Topic (was: bug#31544) Date: Thu, 24 May 2018 19:57:55 +0000 Message-ID: <20180524195755.GB4035@ACM> References: <7D0B397D-5D1B-4B8C-93B6-1CA207DD552A@scratch.space> <6271469D-6B02-4334-828E-D81816143734@scratch.space> <20180524163534.GA4035@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1527191883 26677 195.159.176.226 (24 May 2018 19:58:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 24 May 2018 19:58:03 +0000 (UTC) User-Agent: Mutt/1.9.4 (2018-02-28) Cc: van@scratch.space, Eli Zaretskii , Emacs developers , rms@gnu.org, Noam Postavsky To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 24 21:57:58 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLwN4-0006ns-LL for ged-emacs-devel@m.gmane.org; Thu, 24 May 2018 21:57:58 +0200 Original-Received: from localhost ([::1]:40497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLwPA-0007PU-4f for ged-emacs-devel@m.gmane.org; Thu, 24 May 2018 16:00:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLwP4-0007PK-1p for emacs-devel@gnu.org; Thu, 24 May 2018 16:00:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLwP1-0002fM-1A for emacs-devel@gnu.org; Thu, 24 May 2018 16:00:02 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:20138 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1fLwP0-0002dc-Mb for emacs-devel@gnu.org; Thu, 24 May 2018 15:59:58 -0400 Original-Received: (qmail 47506 invoked by uid 3782); 24 May 2018 19:59:57 -0000 Original-Received: from acm.muc.de (p5B147627.dip0.t-ipconnect.de [91.20.118.39]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 24 May 2018 21:59:56 +0200 Original-Received: (qmail 21803 invoked by uid 1000); 24 May 2018 19:57:55 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225676 Archived-At: Hello, Yuri. On Thu, May 24, 2018 at 23:53:52 +0700, Yuri Khan wrote: > On Thu, May 24, 2018 at 11:38 PM Alan Mackenzie wrote: > > rx.el uses a wordy syntax, somewhat analagously to Cobol 50 years ago. > > Its premiss is that it's the terse, dense, austere characters which make > > a regexp difficult to write and read. I would suggest that it's more > > the abstract concepts which cause beginners difficulties, rather than > > the syntax. This was true of Cobol 50 years ago, and I think it's > > always been the case with regexps. > > That said, rx.el is used ~72 times in 19 files.el in Emacs, so somebody > > likes it. > I like rx.el. :-) > I like it because any reasonably involved rx.el expression will be written > out on multiple lines, indented, and possibly commented; whereas the > equivalent plain regexp will be jumbled up on one long line, or else broken > up into a concat of several arbitrary parts. Yes. But... rx.el needs to be _learnt_. You cannot, at least not yet, learn rx.el as an alternative to normal string regexp syntax, because the string syntax is so common that it _must_ be learnt. So rx.el is an optional extra. It seems unlikely that its use could spread beyond Emacs, so the effort learning rx.el is going to yield special purpose knowledge only. > I like rx.el because its expressions can be navigated structurally, using > ‘backward-up-list’, ‘forward-sexp’, and the like. The same commands work on > regular regular expressions only if they have not been broken up for > readability. What would be useful would be a function to turn normal regexps into rx.el syntax. > I also like rx.el because it allows me to see fewer backslashes, > double-backslashes, and quadruple-backslashes. It's when you start seeing triple backslashes that you need to start worrying. ;-) -- Alan Mackenzie (Nuremberg, Germany).