From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Bug in font-lock-syntactic-keywords handling? Date: Mon, 06 Oct 2014 12:28:59 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412612967 17805 80.91.229.3 (6 Oct 2014 16:29:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Oct 2014 16:29:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: immerrr again Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 06 18:29:20 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XbB9z-0000cf-Fy for ged-emacs-devel@m.gmane.org; Mon, 06 Oct 2014 18:29:19 +0200 Original-Received: from localhost ([::1]:52978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbB9z-0007Fd-3i for ged-emacs-devel@m.gmane.org; Mon, 06 Oct 2014 12:29:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbB9o-00074z-CN for emacs-devel@gnu.org; Mon, 06 Oct 2014 12:29:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbB9g-0003uP-Om for emacs-devel@gnu.org; Mon, 06 Oct 2014 12:29:08 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:10395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbB9g-0003uH-LT for emacs-devel@gnu.org; Mon, 06 Oct 2014 12:29:00 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVNFxKjo/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBHTkjBQsLNBIUGA0kLYdXCNIZF44jVweEOASpGYFqg0whgS0 X-IPAS-Result: ArUGAIDvNVNFxKjo/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBHTkjBQsLNBIUGA0kLYdXCNIZF44jVweEOASpGYFqg0whgS0 X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="91801362" Original-Received: from 69-196-168-232.dsl.teksavvy.com (HELO pastel.home) ([69.196.168.232]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2014 12:29:00 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id B647A85CC; Mon, 6 Oct 2014 12:28:59 -0400 (EDT) In-Reply-To: (immerrr again's message of "Mon, 6 Oct 2014 18:21:35 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:175022 Archived-At: > 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?