[Top][All Lists]

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

Re: [Emacs-diffs] master 8dafacd: * lisp/emacs-lisp/syntax.el (syntax-pp

From: Dmitry Gutov
Subject: Re: [Emacs-diffs] master 8dafacd: * lisp/emacs-lisp/syntax.el (syntax-ppss-table): New var
Date: Mon, 18 Jan 2016 23:45:18 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Thunderbird/43.0

On 01/18/2016 12:32 AM, Stefan Monnier wrote:

Any time where you want to use a different syntax-table.  E.g. e use it
in nxml-mode where the syntax-table to use normally should be
"text-like" (e.g. parens are matched), but where actual formal parsing
needs something very different (since nothing guarantees that parens
are matched, whereas matching <..> is a lot more useful).

Thanks. What is the purpose left for the "main" syntax table, though? Doesn't paren-matching code call syntax-ppss anyway?

I'm worried that we have _three_ different syntax tables now (including the font-lock- one), without clear documentation on how they should relate.

I expect it to be handy as well in cases where the "normal" syntax table
may be changed at various times.  E.g. this allows the use of
syntax-ppss within with-syntax-table.  I actually imagine it may become
"normal and recommended" to set syntax-ppss-table in any buffer where
with-syntax-table may be used, since syntax-ppss can very easily be
triggered by accident (e.g. via forward-sexp -> syntax-propertize ->

So, forward-sexp can trigger syntax-ppss via syntax-propertize, which will use syntax-ppss-table, but forward-sexp itself will use the main syntax table? At least when called with positive argument.

But up-list uses the return value of syntax-ppss, so it will be affected by syntax-ppss-table? And backward-sexp, too?

It doesn't seem easy to reason about.

You've added the var, but without any usages.

Actually there is one usage in trunk (in nxml).  I just mistakenly
installed it before installing the corresponding change in syntax.el.

Yes, I missed that (that patch was long).

reply via email to

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