From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: syntax-propertize-function vs indentation lexer Date: Wed, 29 May 2013 19:28:39 +0400 Message-ID: <87ppw9erfc.fsf@yandex.ru> 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 1369841347 19722 80.91.229.3 (29 May 2013 15:29:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 May 2013 15:29:07 +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 17:29:07 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 1UhiJD-000316-SD for ged-emacs-devel@m.gmane.org; Wed, 29 May 2013 17:29:03 +0200 Original-Received: from localhost ([::1]:42386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhiJD-0003R9-Ev for ged-emacs-devel@m.gmane.org; Wed, 29 May 2013 11:29:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhiJ1-00038Q-II for emacs-devel@gnu.org; Wed, 29 May 2013 11:28:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhiIt-00089G-NA for emacs-devel@gnu.org; Wed, 29 May 2013 11:28:51 -0400 Original-Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:61018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhiIt-000897-Er for emacs-devel@gnu.org; Wed, 29 May 2013 11:28:43 -0400 Original-Received: by mail-la0-f45.google.com with SMTP id ec20so8845835lab.18 for ; Wed, 29 May 2013 08:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:x-antivirus:x-antivirus-status; bh=Wdo9y9UEoIyflAxsVk/V/beg7dGiI0/9O8NvlN8Qs9Y=; b=UtCcGdtLBd9Qzuo2gNkDlpdR5nlhjt9Cr6j90q1SzcxQCJRIstPJqMJeypU9x1D2K7 GcCUwzpM6M6WLLkQcJRTKFhINN/D/gUc7o9BC/PxFmboR83R3kW2w/FDEnCvG0eOO3MI /WYAJGlrlIXlp4NbJP4+Y+6dMFcCysMTO59s3ges08qT1+d5dHGtR3pfqbVYhU76wMqs D8P9IrN9aOLqQXNcAY4cAyg+XNix60g2IrN3tNRj5kLRKgkxlm9BxZ/VurFjpwt5fjpx 0qHDEHK/Zz8pofqUBX3fBe+Ma6X+DeUeZF0y3SK/WwnYrzNpiqTviPrMAY2xc0enof3m uf1w== X-Received: by 10.112.33.227 with SMTP id u3mr1879971lbi.35.1369841322068; Wed, 29 May 2013 08:28:42 -0700 (PDT) Original-Received: from SOL ([178.252.98.87]) by mx.google.com with ESMTPSA id oi3sm2023189lbb.6.2013.05.29.08.28.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 08:28:41 -0700 (PDT) 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 (windows-nt) X-Antivirus: avast! (VPS 130529-0, 29.05.2013), Outbound message X-Antivirus-Status: Clean X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22d 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:159890 Archived-At: Stephen Leake 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.