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

Stefan Monnier <monnier@iro.umontreal.ca> 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	other threads:[~2020-05-16 13:56 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 [this message]
2020-05-17  2:41     ` Stefan Monnier
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=877dxcgezf.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).