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: syntax-propertize-function vs indentation lexer Date: Wed, 29 May 2013 13:52:13 -0400 Message-ID: References: <85mwrdbypv.fsf@member.fsf.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1369849976 26040 80.91.229.3 (29 May 2013 17:52:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 May 2013 17:52:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 29 19:52:55 2013 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 1UhkYQ-00022Y-4C for ged-emacs-devel@m.gmane.org; Wed, 29 May 2013 19:52:54 +0200 Original-Received: from localhost ([::1]:36831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhkYP-0002An-Qi for ged-emacs-devel@m.gmane.org; Wed, 29 May 2013 13:52:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhkYH-0002AN-T8 for emacs-devel@gnu.org; Wed, 29 May 2013 13:52:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhkYC-0002rA-TC for emacs-devel@gnu.org; Wed, 29 May 2013 13:52:45 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:43844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhkY7-0002gm-O9 for emacs-devel@gnu.org; Wed, 29 May 2013 13:52:40 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r4THqD7H007809; Wed, 29 May 2013 13:52:13 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 23143B4319; Wed, 29 May 2013 13:52:13 -0400 (EDT) In-Reply-To: <85mwrdbypv.fsf@member.fsf.org> (Stephen Leake's message of "Wed, 29 May 2013 11:19:24 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4594=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4594> : streams <970337> : uri <1433357> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:159901 Archived-At: > 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. "syntax propertization" is done lazily, so if/when you need it, you need to call `syntax-propertize'. In many cases it's done for you (e.g. indent-according-to-mode makes sure it's propertized til the end of the current line), but not in all cases. Not sure why propertization isn't done for you in the case of indentation. Maybe because you sometimes look after the current line? Or because your indentation doesn't go through indent-according-to-mode? Stefan