all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Kangas <stefan@marxist.se>
Cc: "Mattias Engdegård" <mattiase@acm.org>,
	"Richard Stallman" <rms@gnu.org>,
	41006@debbugs.gnu.org, jan <rtm443x@googlemail.com>
Subject: bug#41006: 26.3; regular expressions documentation
Date: Sun, 3 May 2020 18:00:48 -0700 (PDT)	[thread overview]
Message-ID: <76a4ceaa-7d50-489d-94a7-150ec14f3cd9@default> (raw)
In-Reply-To: <87k11s221z.fsf@stefankangas.se>

> >> The disposition of the regexp documentation could be improved, yes.
> >> Currently it's arranged by syntax, which is the implementor's view,
> >> rather than by function, which is the user's.
> >
> > FWIW, I disagree with that characterization.
> >
> > Especially when it comes to the doc for regexp
> > patterns, as a user I want it to be organized
> > according to syntax.  A regexp (regardless of
> > the particular syntax system used for regexps
> > in a given language) is very much about syntax.
> 
> For me, this is different.  My background before ELisp was already
> having using regexps extensively in other languages, having read the
> "Mastering Regular Expressions" book, and so on.  (I expect that this
> is fairly typical.)

It's my case too, FWIW.  So far "this is different" isn't.

> So I go to the "Regular Expressions" node, looking mostly for how to
> use them.  But I find nothing on that there.  I only find a review of
> what looks like everything I already knew about regular expressions.

Hm.  Use of regexps is precisely what I'd have thought
you had experience with before Elisp.  What's particular
about Elisp regexps is their syntax and the behavior of
the regexp engine.  (And those pecularities are, BTW,
presented in "Mastering Regular Expressions", where
different regexp dialects are compared.)

> In the past, I did this: scratched my head, gave up and searched the
> web instead.  And it left me thinking that it's weird that Emacs
> documentation on Regular Expression is so poor...

Can you give an example (even artificial, if you don't
recall) of some "use" of regexps that you might have
wanted to find, and could not, in the manual.  Or even
just that you wanted to find (even if you found it).
I think I'm probably not getting what you have in mind.

> I have since learned that the information I have been looking for is
> actually in a separate node, for some reason not sorting under
> "Regular Expressions", called "Regexp Search".  This section is
> expertly written and exactly what I would have needed, only too bad I
> couldn't find it!  :-)

Ah, I see.  That's what you mean by using regexps.
OK, makes sense.  But that info, as you say, is there.
It's just that you couldn't find it at first.  You
didn't care about the Elisp regexp syntax etc.  You
wanted to know how to use a regexp to match text.

So the problem, I guess, was only that you had some
difficulty finding that doc.  Do you have an idea
what the difficulty was?  A guess: could it have
been because that doc was represented as being about
"searching" and you were looking for something about
"matching"?  Maybe the index could be improved, if
it's something as simple as that.

In addition, perhaps there could be a cross-reference
to the doc you were really looking for (node `Regexp
Search') from nodes `Regular Expressions' and `Regexp
Functions'.  Do you think that would help?

(Note BTW that the menu in node `Searching and
Matching' lists menu items `Regular Expressions' and
`Regexp Search'.)

> It definitely seems to me that there is room for improvement here.
> And I think it's more about the structure than content.

Got it.  Think it over and see if you can come up
with a suggested change.  I'm thinking indexing
and xrefs, but maybe something else is needed.

Maybe the order of nodes `Regular Expressions' and
`Regexp Search' should be switched: present how to
use them, before diving deep down into the exact
syntax.  I think that might make sense.

> BTW, while we're on it, it would be very handy to have an overview in
> the manual of the quirks of regexps in Emacs in comparison to other
> languages.  Mastering Regular Expressions does a very good job here,
> as far as I recall.  That plus a list of which functions to use would
> get me, when I first started out with ELisp, 99% of where I needed to
> be, I think.

That's just the comparison I mentioned above.
I'd suggest that instead of reproducing something
like that (which needs updating from time to time)
in the manual, the manual just have an external
link to such a comparison on the web.  If that
already exists then the updating might take care
of itself.  If not, then so be it.  If the book
is available as HTML, that could work.  If not,
and if there's no existing comparison, Someone(TM)
could create it on EmacsWiki.  Just a thought.





  reply	other threads:[~2020-05-04  1:00 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 19:06 bug#41006: 26.3; regular expressions documentation jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-03  3:40 ` Richard Stallman
2020-05-03 10:31   ` jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-03 13:07 ` Mattias Engdegård
2020-05-03 14:00   ` jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-03 20:08   ` Drew Adams
2020-05-03 20:31     ` Stefan Kangas
2020-05-04  1:00       ` Drew Adams [this message]
2020-05-05  2:56       ` Richard Stallman
2020-05-05 10:05         ` jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-05 16:51           ` Mattias Engdegård
2020-05-05 18:20         ` Stefan Kangas
2020-05-05 18:40           ` Drew Adams
2020-05-05 19:04             ` Stefan Kangas
2020-05-05 19:42               ` Drew Adams
2020-05-05 21:23                 ` Stefan Kangas
2020-05-05 21:37                   ` Drew Adams
2020-05-07  2:40                   ` Richard Stallman
2020-05-09  3:48               ` Richard Stallman
2020-05-07  2:41             ` Richard Stallman
2020-05-07  3:17               ` Drew Adams
2020-05-08  2:51                 ` Richard Stallman
2020-05-07 10:31               ` Stefan Kangas
2020-05-07  2:41           ` Richard Stallman
2020-05-07  3:18             ` Drew Adams
2020-05-07 10:32             ` Stefan Kangas
2020-05-08  2:49               ` Richard Stallman
2020-05-08  6:47                 ` Eli Zaretskii
2020-05-08 10:10                   ` Stefan Kangas
2020-05-08 10:31                     ` Eli Zaretskii
2020-05-08 18:17                       ` Stefan Kangas
2020-05-08 18:47                         ` Eli Zaretskii
2020-05-08 20:09                           ` Stefan Kangas
2020-05-08 10:04                 ` jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-09  3:56                   ` Richard Stallman
2020-05-08 16:49                 ` Drew Adams
2020-05-09  3:53                   ` Richard Stallman
2020-05-09  3:54                   ` Richard Stallman
2020-05-07  2:41           ` Richard Stallman
2020-05-04  3:10   ` Richard Stallman
2020-05-04  9:13     ` jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-05  2:56       ` Richard Stallman
2020-05-05 10:02         ` jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-05 17:12     ` Mattias Engdegård
2020-05-05 17:40       ` Eli Zaretskii
2020-05-05 17:50         ` jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-05 18:09         ` Stefan Kangas
2020-05-05 18:23           ` Eli Zaretskii
2020-05-07  2:42       ` Richard Stallman
2022-04-29 12:22 ` 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=76a4ceaa-7d50-489d-94a7-150ec14f3cd9@default \
    --to=drew.adams@oracle.com \
    --cc=41006@debbugs.gnu.org \
    --cc=mattiase@acm.org \
    --cc=rms@gnu.org \
    --cc=rtm443x@googlemail.com \
    --cc=stefan@marxist.se \
    /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.