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: Tassilo Horn
Subject: Re: Removing no-back-reference restriction from syntax-propertize-rules
Date: Sat, 16 May 2020 15:56:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> right now, the docstring of `syntax-propertize-rules' states that
>> back-references aren't supported (which is true).  I don't see why
>> that has to be the case.  It already shifts numbered groups as
>> needed, so why can't it simply shift back-references, too?
>
> The original reason was that I want to compile those to DFAs.
>
> But a secondary reason was that every case where backrefs were used in
> `font-lock-syntactic-keywords` was very easy to rewrite to not use
> backrefs.  Do you have an example where backrefs are really important
> in `syntax-propertize-rules`?

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/.

  
http://git.savannah.gnu.org/cgit/auctex.git/tree/font-latex.el?h=font-latex-update&id=e6076a4f8cf2f06e956ad1a60728ca3b2eb11a83#n1023

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.

Bye,
Tassilo



reply via email to

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