[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 8dafacd: * lisp/emacs-lisp/syntax.el (syntax-pp
Re: [Emacs-diffs] master 8dafacd: * lisp/emacs-lisp/syntax.el (syntax-ppss-table): New var
Mon, 18 Jan 2016 17:12:50 -0500
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
> Doesn't paren-matching code call syntax-ppss anyway?
Not that I know, no.
> I'm worried that we have _three_ different syntax tables now (including the
> font-lock- one), without clear documentation on how they should relate.
Yes, this whole area is rather murky. The font-lock syntax-table should
mostly disappear (90% of the uses were to turn "_" syntax into "w"
syntax so as to be able to use \< and \>, but this has been made
obsolete by the new \_< and \_>), I think.
But the interaction between the various syntax-tables as well as
forward-sexp-function deserves a serious rethink. I think such a rethink
will need to start by distinguishing "user-level dwimish" behavior and
lower-level behavior which adheres to strict syntax rules.
E.g. in TeX and HTML, we want to match parentheses even though the formal
syntax does not give any special rule to parentheses. Similar thing for
matching parens when the open and close parens are both inside comments,
but not inside the same one.
> 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 is indeed used, but only to decide if we're strings or
comments, so it should be OK.
> It doesn't seem easy to reason about.
Indeed, it's not.