emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: syntax-propertize-function vs indentation lexer


From: Dmitry Gutov
Subject: Re: syntax-propertize-function vs indentation lexer
Date: Wed, 29 May 2013 19:28:39 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

Stephen Leake <address@hidden> writes:

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

You can call `syntax-propertize', like `js-mode' does in its major mode
function.

It's usually called by `syntax-ppss', which is used in indentaion code
in most of the packages.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]