all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: immerrr again <immerrr+lua@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Bug in font-lock-syntactic-keywords handling?
Date: Mon, 06 Oct 2014 12:28:59 -0400	[thread overview]
Message-ID: <jwviojxmb6z.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAERznn-QPwbGB93Km62H2V4-7_63tPPD_X5j5fNNZ5vM-LjXsw@mail.gmail.com> (immerrr again's message of "Mon, 6 Oct 2014 18:21:35 +0400")

> 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	other threads:[~2014-10-06 16:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 11:42 Bug in font-lock-syntactic-keywords handling? immerrr again
2014-10-06 13:14 ` Stefan Monnier
2014-10-06 14:21   ` immerrr again
2014-10-06 16:28     ` Stefan Monnier [this message]
2014-10-06 23:27       ` immerrr again

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=jwviojxmb6z.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=immerrr+lua@gmail.com \
    /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.