all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Wedler, Christoph" <christoph.wedler@sap.com>
To: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Clarification needed: syntax-propertize vs font-lock-syntax-table
Date: Wed, 18 Nov 2015 18:06:53 +0000	[thread overview]
Message-ID: <F9C2521BBF380A4A97379009991555E699354F9D@DEWDFEMB17C.global.corp.sap> (raw)

The function `syntax-propertize' sets the syntax-table properties which
shadow the definition from the current syntax-table.  This function
calls the function in syntax-propertize-function whose docstring
explicitly allows to call `syntax-ppss'.

For this to work consistently, it is necessary that `syntax-propertize'
is called with the same (or very similar) syntax-table, at least for the
same buffer areas.  (Yes, I see the Todo at the beginning of syntax.el)
Or do I miss something?

The most prominent call of `syntax-propertize' is inside font-lock,
where the `font-lock-syntax-table' is active.  But there are also many
valid calls of this function (most via `syntax-ppss') where the standard
(syntax-table) is active.  (And there are missing calls - hello imenu.el)

What does this mean?  To be consistent, ...

 * Solution 1: the font-lock syntax table must not differ too much from
   the normal syntax table, i.e., the function in
   syntax-propertize-function should behave the same.  If so, it should
   be probably documented.

 * Solution 2: there is a local variable for an extra syntax table for
   `syntax-propertize'

Any other ideas?

With Solution 1, it would be excellent if the (nth 9 ppss),
parse-partial-sexp, would be made official.  Otherwise, the multi-mode
check in antlr-mode.el (are we in the action of a grammar?) could not
rely on (nth 0 ppss) anymore...

- Christoph




             reply	other threads:[~2015-11-18 18:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 18:06 Wedler, Christoph [this message]
2015-11-18 18:37 ` Clarification needed: syntax-propertize vs font-lock-syntax-table Dmitry Gutov
2015-11-20 18:24   ` Wedler, Christoph
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

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

  git send-email \
    --in-reply-to=F9C2521BBF380A4A97379009991555E699354F9D@DEWDFEMB17C.global.corp.sap \
    --to=christoph.wedler@sap.com \
    --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.