unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Removing no-back-reference restriction from syntax-propertize-rules
Date: Sat, 16 May 2020 22:41:48 -0400	[thread overview]
Message-ID: <jwvtv0fcmz5.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <877dxcgezf.fsf@gnu.org> (Tassilo Horn's message of "Sat, 16 May 2020 15:56:52 +0200")

> In AUCTeX we use them to match macros with choosable delimiter, e.g.,
> \verb|foo| which could as well be written as \verb-foo- or \verb/foo/.

Hmm... in tex-mode.el we do:

    ("\\\\verb\\**\\([^a-z@*]\\)"
      (1 (prog1 "\""
           (tex-font-lock-verb
            (match-beginning 0) (char-after (match-beginning 1))))))))

and indeed, `tex-font-lock-verb` then restricts it to only match on
a single-line, so a regexp with a backref would be simpler (I think
I evolved that code from that of perl-mode.el where regexp operations
can take similarly delimited args, but those can span several lines so
a regexp was not appropriate).

> Another example is in the minted.el style for things like
> \mintinline[lisp]|(setq foo 1)| and there might be more occurrences in
> user-defined styles.

\lstinline (from `listings` package) is probably another example, yes.


        Stefan




  reply	other threads:[~2020-05-17  2:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16  8:39 Removing no-back-reference restriction from syntax-propertize-rules Tassilo Horn
2020-05-16 13:17 ` Stefan Monnier
2020-05-16 13:56   ` Tassilo Horn
2020-05-17  2:41     ` Stefan Monnier [this message]
2020-05-17 23:57 ` Stefan Monnier
2020-05-18 18:20   ` Tassilo Horn
2020-05-18 19:30     ` Stefan Monnier
2020-05-18 21:30       ` Tassilo Horn
2020-05-19  2:58         ` Stefan Monnier
2020-05-19 13:28           ` Tassilo Horn
2020-05-19 15:06             ` Stefan Monnier
2020-05-19 18:54               ` Tassilo Horn
2020-05-19 18:55                 ` Stefan Monnier

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=jwvtv0fcmz5.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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).