emacs-devel
[Top][All Lists]
Advanced

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

Re: Bug in font-lock-syntactic-keywords handling?


From: Stefan Monnier
Subject: Re: Bug in font-lock-syntactic-keywords handling?
Date: Mon, 06 Oct 2014 12:28:59 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> The problem is that it doesn't unfontify the already processed
> chunk beforehand.

Oh, indeed, sorry for being dense.
That's indeed a bug.  You could try to work around it with something like:

(defvar lua-font-lock-syntactic-keywords
  '(((lambda (limit)
      ;; font-lock sometimes fails to erase the `syntax-table' property before
      ;; calling us.  So let's make sure it's clean before moving on.
      (remove-text-properties (point) limit '(syntax-table))
      nil))
    (lua-match-multiline-literal-bounds
     (1 "!" nil noerror)
     (2 "|" nil noerror))))

Also, I recommend you use syntax-propertize-function when available.
It comes with various advantages (e.g. it also works when font-lock is
disabled).


        Stefan


PS: BTW, do you have any news about the copyright status of lua-mode
that would prevent including it in GNU ELPA?



reply via email to

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