all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Yuri Khan <yurivkhan@gmail.com>
Cc: van@scratch.space, Eli Zaretskii <eliz@gnu.org>,
	Emacs developers <emacs-devel@gnu.org>,
	rms@gnu.org, Noam Postavsky <npostavs@gmail.com>
Subject: Re: Off Topic (was: bug#31544)
Date: Thu, 24 May 2018 19:57:55 +0000	[thread overview]
Message-ID: <20180524195755.GB4035@ACM> (raw)
In-Reply-To: <CAP_d_8Wx7r=Mob=vSzn6EnNmoWah2UXqBjSoMEdtmSy4dKXXkg@mail.gmail.com>

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 <acm@muc.de> 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).



  reply	other threads:[~2018-05-24 19:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 11:18 bug#31544: Emacs 26.1 rc-1 Texinfo View fails to italicize all 6 lines in paragraph Van L
2018-05-21 16:23 ` Eli Zaretskii
2018-05-21 23:45   ` Van L
2018-05-22  2:13 ` Richard Stallman
2018-05-22  2:40   ` Van L
2018-05-22  4:32     ` Eli Zaretskii
2018-05-22  6:58       ` Off Topic (was: bug#31544) Van L
2018-05-23  3:24         ` Richard Stallman
2018-05-23  3:44           ` Van L
2018-05-23 11:06           ` Noam Postavsky
2018-05-24  2:48             ` Richard Stallman
2018-05-24  9:03               ` Off Topic Robert Pluim
2018-05-24 15:20                 ` Eli Zaretskii
2018-05-24 15:41                   ` Robert Pluim
2018-05-24 17:07                     ` Eli Zaretskii
2018-05-25  2:59                     ` Richard Stallman
2018-05-24 16:35               ` Off Topic (was: bug#31544) Alan Mackenzie
2018-05-24 16:53                 ` Yuri Khan
2018-05-24 19:57                   ` Alan Mackenzie [this message]
2018-05-24 20:24                     ` Noam Postavsky
2018-05-24 20:36                     ` Off Topic Stefan Monnier
2018-05-25  3:01                     ` Off Topic (was: bug#31544) Richard Stallman
2018-05-25  2:59                   ` Richard Stallman
2018-05-24 17:01                 ` Eli Zaretskii
2018-05-28 22:42       ` bug#31544: Emacs 26.1 rc-1 Texinfo View fails to italicize all 6 lines in paragraph Noam Postavsky
2022-01-23 13:57         ` bug#31544: texinfo-mode fails to consistently fontify multiline @i{italic text} Lars Ingebrigtsen

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=20180524195755.GB4035@ACM \
    --to=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=npostavs@gmail.com \
    --cc=rms@gnu.org \
    --cc=van@scratch.space \
    --cc=yurivkhan@gmail.com \
    /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.