From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Augusto Stoffel <arstoffel@gmail.com>, emacs-devel@gnu.org
Subject: Re: master 5c70ff9: New user option 'font-lock-ignore'
Date: Sat, 02 Apr 2022 10:06:41 -0400 [thread overview]
Message-ID: <jwvh77blhu3.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83mth43sb7.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Apr 2022 09:36:28 +0300")
>> The symbol is interpreted as a glob
>> +pattern; in particular, @code{*} matches everything.
> Do you mean shell glob patterns? AFAIK, we don't use them in Emacs
> except for shell wildcards, so why are they used here?
A bit of history: originally his code only supported `*` and I suggested
the use of `wildcard-to-regexp` to both simplify the code, be more
general, and simplify the doc since we can just say "glob pattern" which
is a known concept.
> why not regexps?
I did not suggest the use of regexps because I felt that regexps written
as symbols could be problematic (especially the `.` being a second-class
citizen among symbol constituents in ELisp). Admittedly, in practice
`.` works fine (i.e. without backslash-escaping) in most places in
a symbol so maybe it wouldn't be that bad.
My gut tells me that globs are preferable here (slightly less verbose
and slightly less odd):
(typer-mode foo-*-baz)
vs
(typer-mode \\\`foo-.*-baz\\\')
But either way is fine by me (we can make the \\\` anchoring \\\' implicit).
> And in any case, those patterns need a thorough description,
> since we don't use them elsewhere. For example, the way to quote
> meta-characters such as '*' must be documented, because it isn't
> self-evident.
AFAIK glob patterns come with their own standard way to escape,
e.g. `foo[*]bar`, tho admittedly to make it into a single symbol you need
to write it as `foo\[*\]bar` :-(
Stefan
next prev parent reply other threads:[~2022-04-02 14:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-02 6:36 master 5c70ff9: New user option 'font-lock-ignore' Eli Zaretskii
2022-04-02 7:34 ` Augusto Stoffel
2022-04-02 10:01 ` Eli Zaretskii
2022-04-02 11:18 ` Augusto Stoffel
2022-04-02 11:58 ` Eli Zaretskii
2022-04-02 12:08 ` Augusto Stoffel
2022-04-02 13:52 ` Eli Zaretskii
2022-04-02 16:25 ` Augusto Stoffel
2022-04-02 16:44 ` Eli Zaretskii
2022-04-02 16:52 ` Augusto Stoffel
2022-04-02 14:06 ` Stefan Monnier [this message]
2022-04-02 15:28 ` [External] : " Drew Adams
2022-04-02 16:25 ` Augusto Stoffel
2022-04-02 18:45 ` Drew Adams
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvh77blhu3.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=arstoffel@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).