From: "Wedler, Christoph" <christoph.wedler@sap.com>
To: Dmitry Gutov <dgutov@yandex.ru>,
"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: RE: Clarification needed: syntax-propertize vs font-lock-syntax-table
Date: Fri, 20 Nov 2015 18:24:34 +0000 [thread overview]
Message-ID: <F9C2521BBF380A4A97379009991555E699356051@DEWDFEMB17C.global.corp.sap> (raw)
In-Reply-To: <564CC55B.4060102@yandex.ru>
> On 11/18/2015 08:06 PM, Wedler, Christoph wrote:
>> * Solution 1: the font-lock syntax table must not differ too much from
>> the normal syntax table, i.e., the function in
> I think this is the current consensus. It shouldn't differ in paren,
> comment or string syntax. IOW, it should be syntax-ppss-compatible with
> the main one.
OK, fine with me.
> syntax-propertize-function should behave the same. If so, it should
> be probably documented.
> It should.
And syntax-propertize should be called at more places. Currently, doing
it lazily does not really work, as it is not called when needed. That
is why js-mode calls (syntax-propertize (point-max)) at the end (and I
will do the same in antlr-mode).
My other question was concerning (nth 9 ppss), i.e. the list of open
parentheses is very useful to have (and its also used in syntax.el
itself) -> I would like to have this to be official in the lisp
docstring as well - in src/syntax.c, we have
struct lisp_parse_state
{
[...]
Lisp_Object levelstarts; /* Char numbers of starts-of-expression
of levels (starting from outermost). */
};
>> Any other ideas?
> Support different syntax tables in different parts of the buffer. That
> must be a part of our eventual multi-major-mode solution.
In the case of antlr-mode (grammar with actions), it could be done as
long as it does not break the calulation of the "inner-mode-chunk-end",
e.g, with Python actions
rule: "KEYWORD" { do_something { } # do it };
the action ends with the final "}" (even though a naive Python-like
syntax-propertization would think of it as part of a comment)
next prev parent reply other threads:[~2015-11-20 18:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-18 18:06 Clarification needed: syntax-propertize vs font-lock-syntax-table Wedler, Christoph
2015-11-18 18:37 ` Dmitry Gutov
2015-11-20 18:24 ` Wedler, Christoph [this message]
2015-11-20 18:39 ` Dmitry Gutov
2015-11-23 17:05 ` Wedler, Christoph
2015-11-23 19:01 ` Dmitry Gutov
2015-11-24 8:58 ` Wedler, Christoph
2015-11-24 11:35 ` Dmitry Gutov
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=F9C2521BBF380A4A97379009991555E699356051@DEWDFEMB17C.global.corp.sap \
--to=christoph.wedler@sap.com \
--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).