all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 8dafacd: * lisp/emacs-lisp/syntax.el (syntax-ppss-table): New var
Date: Mon, 18 Jan 2016 17:12:50 -0500	[thread overview]
Message-ID: <jwvd1symtp7.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <569D4EDE.6080605@yandex.ru> (Dmitry Gutov's message of "Mon, 18 Jan 2016 23:45:18 +0300")

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

Right.

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

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.


        Stefan



  reply	other threads:[~2016-01-18 22:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160116200607.22534.62936@vcs.savannah.gnu.org>
     [not found] ` <E1aKX6t-0005s4-NF@vcs.savannah.gnu.org>
2016-01-17 10:56   ` [Emacs-diffs] master 8dafacd: * lisp/emacs-lisp/syntax.el (syntax-ppss-table): New var Dmitry Gutov
2016-01-17 21:14     ` John Wiegley
2016-01-17 21:32       ` Stefan Monnier
2016-01-18 20:45         ` Dmitry Gutov
2016-01-18 22:12           ` Stefan Monnier [this message]
2016-01-19  1:25             ` Dmitry Gutov
2016-01-19 14:30               ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvd1symtp7.fsf-monnier+emacsdiffs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.