unofficial mirror of emacs-devel@gnu.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: Tue, 19 Jan 2016 09:30:39 -0500	[thread overview]
Message-ID: <jwvwpr5d51n.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <569D9087.2060803@yandex.ru> (Dmitry Gutov's message of "Tue, 19 Jan 2016 04:25:27 +0300")

>>> Doesn't paren-matching code call syntax-ppss anyway?
>> Not that I know, no.
> electric-pair-syntax-info calls syntax-ppss.

Yes, but again that's only to figure out if we're inside
a string/comment, so I think it's fine.

> Are current-syntax-table and syntax-ppss-table allowed to differ more
> than that?

In the one current use case, they differ significantly, yes.

>>> 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.
> Never for its 9th element?

AFAICT no (even though it could, indeed).

>>> It doesn't seem easy to reason about.
>> Indeed, it's not.
> So, I'm wondering if we could postpone introducing a new variable, and
> implement the same thing in nxml-mode somehow in a different way.

I think syntax-ppss-table is "the right way" in that it is the place
where we can define the "low-level, strict, formal syntax".

This new variable makes it possible to use with-syntax-table safely with
any random syntax table which happens to parse things the way we
currently need it.

There are indeed potential problems with interactions with other
functions, but I expect that the right fix for them would be to be more
careful about whether they use the output of syntax-ppss (and hence
the proper syntax of the major mode) or if they use something else
(e.g. forward-sexp) to get a more dwimish behavior.


        Stefan



      reply	other threads:[~2016-01-19 14:30 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
2016-01-19  1:25             ` Dmitry Gutov
2016-01-19 14:30               ` Stefan Monnier [this message]

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=jwvwpr5d51n.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 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).