From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Question on syntax-propertize-function Date: Thu, 06 Jun 2013 17:23:41 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1370553850 7901 80.91.229.3 (6 Jun 2013 21:24:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Jun 2013 21:24:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 06 23:24:09 2013 Return-path: Envelope-to: geh-help-gnu-emacs@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 1UkhfE-00084q-HI for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Jun 2013 23:24:08 +0200 Original-Received: from localhost ([::1]:57285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkhfD-0004FJ-SU for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Jun 2013 17:24:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukhf4-0004Ex-PG for help-gnu-emacs@gnu.org; Thu, 06 Jun 2013 17:23:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ukhf1-0000lj-Qy for help-gnu-emacs@gnu.org; Thu, 06 Jun 2013 17:23:58 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:51973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukhf1-0000lR-KK for help-gnu-emacs@gnu.org; Thu, 06 Jun 2013 17:23:55 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ukhez-0007uj-PQ for help-gnu-emacs@gnu.org; Thu, 06 Jun 2013 23:23:53 +0200 Original-Received: from 69-165-139-76.dsl.teksavvy.com ([69.165.139.76]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Jun 2013 23:23:53 +0200 Original-Received: from monnier by 69-165-139-76.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Jun 2013 23:23:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 69-165-139-76.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:kwVGQCg8nBOs3gM4NuPGJ/olZh4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91360 Archived-At: > (modify-syntax-entry ?\( "()1" st) > (modify-syntax-entry ?\) ")(4" st) > (modify-syntax-entry ?\* ". 23n" st) Looks good. > (defun holl-syntax-propertize (start end) > (goto-char start) > (funcall > (syntax-propertize-rules > ("\\((\\)\\(\\*\\)\\()\\)" > (1 "() ") > (2 ". ") > (3 ")( ")) > ) > start end)) Looks OK (changing the syntax of the * in the middle should be sufficient, but the extra entries shouldn't hurt). > and I set syntax-propertize-function in the initialization of the major mode: > (set (make-local-variable 'syntax-propertize-function) > #'holl-syntax-propertize) Looks good. > However, this doesn't seems to have any effect. I also played with > syntax-propertize-extend-region-functions but with no success. > Can you see what's wrong with this approach? Nope, it looks fine. Which version of Emacs are you using? Is the mode using font-lock? Do you have font-lock-syntactic-keywords maybe? > and if I run it on a region containing (*) I get no effect. That might be due to the syntax-table property being immediately reset by the code that auto-runs syntax-propertize-function or something along these lines. Try it first in a fundamental-mode buffer. Stefan