emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing no-back-reference restriction from syntax-propertize-rules


From: Stefan Monnier
Subject: Re: Removing no-back-reference restriction from syntax-propertize-rules
Date: Sat, 16 May 2020 22:41:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]