unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* syntax-propertize-function vs indentation lexer
@ 2013-05-29 15:19 Stephen Leake
  2013-05-29 15:28 ` Dmitry Gutov
  2013-05-29 17:52 ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Stephen Leake @ 2013-05-29 15:19 UTC (permalink / raw)
  To: emacs-devel

I'm working on a new indentation mode for Ada (and have been for a while
- see http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html).

I've recently run across an issue with syntax-propertize-function.

I use that to set the syntax of Ada character constants (ie 'A') to
'string'. This matters for the particular constant '\', and for some
other cases.

The indentation engine relies on this, because it uses a lexer that uses
syntax properties.

However, syntax-propertize-function is only called from font-lock. So it
only runs on the visible part of the buffer, and only when font-lock is
enabled. So if neither of those conditions is present, the lexer fails
on character constants. In particular, I have a test suite that runs in
batch mode, when global-font-lock-mode is off.

To fix this, I could call syntax-propertize-function (or
ada-syntax-propertize directly) from ada-mode to initialize the buffer,
and again from before- or after-change-functions to catch edits.

Is there a better way?

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-06-01 14:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-29 15:19 syntax-propertize-function vs indentation lexer Stephen Leake
2013-05-29 15:28 ` Dmitry Gutov
2013-05-29 17:52 ` Stefan Monnier
2013-05-30  9:15   ` Stephen Leake
2013-05-30 14:02     ` Stefan Monnier
2013-05-31  7:45       ` Stephen Leake
2013-05-31 13:23         ` Stefan Monnier
2013-06-01  5:19           ` Stephen Leake
2013-06-01 14:31             ` Stefan Monnier

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