From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vasilij Schneidermann Newsgroups: gmane.emacs.devel Subject: Re: Combining syntax comment sequences (yaml-mode) Date: Wed, 23 Dec 2015 22:56:33 +0100 Message-ID: <20151223215633.GB780@odonien> References: <20151223104741.GA769@odonien.fritz.box> <87bn9hxwbc.fsf@igel.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: ger.gmane.org 1450907807 28167 80.91.229.3 (23 Dec 2015 21:56:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Dec 2015 21:56:47 +0000 (UTC) Cc: emacs-devel To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 23 22:56:46 2015 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 1aBrOn-0005Hf-U3 for ged-emacs-devel@m.gmane.org; Wed, 23 Dec 2015 22:56:46 +0100 Original-Received: from localhost ([::1]:58068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBrOn-0001ec-Gn for ged-emacs-devel@m.gmane.org; Wed, 23 Dec 2015 16:56:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBrOj-0001bD-5i for emacs-devel@gnu.org; Wed, 23 Dec 2015 16:56:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBrOe-0006Bs-6w for emacs-devel@gnu.org; Wed, 23 Dec 2015 16:56:41 -0500 Original-Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:37612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBrOe-0006BX-09 for emacs-devel@gnu.org; Wed, 23 Dec 2015 16:56:36 -0500 Original-Received: by mail-wm0-x22d.google.com with SMTP id p187so163881124wmp.0 for ; Wed, 23 Dec 2015 13:56:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=dsFtOpS0veGqx+Lcd+AWxdmsIm0LvzNiqDahbRBynM8=; b=p4pLUdV71J1xXyFKly6keOKMUSNVFBHiB6ncxEaF3RBeiky3vzbiWyy619fq5WBlKU iB/ARC7iKD6v6RWG3v4IPxPOLn3xjaAuNWx69Oxnd46IzD1AajUTZCK01w7GY5pH2Sb4 pNeXZbFuoB8enqZ2AqbN1LeV6c1jLcfvBaHC87UNezGMsQ9u+vKeQ3DtlappWyCkOVmm cFwkxUX4VOeE5Um9WgHrH7otDmF/c/oJKx5a1jZdnYsL+GqGZaZRcMo3ZhIhM9HIYVYW yi48mhBVuv82mF0hkhCxd3btigVRLWRhv0L9Xzo9rXKwY47p7e++SC+2qIiS2RZEP9+i /OGA== X-Received: by 10.194.80.200 with SMTP id t8mr28235708wjx.74.1450907795239; Wed, 23 Dec 2015 13:56:35 -0800 (PST) Original-Received: from localhost (dslb-188-097-059-127.188.097.pools.vodafone-ip.de. [188.97.59.127]) by smtp.gmail.com with ESMTPSA id ke10sm38977708wjb.3.2015.12.23.13.56.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Dec 2015 13:56:34 -0800 (PST) Content-Disposition: inline In-Reply-To: <87bn9hxwbc.fsf@igel.home> User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::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:196738 Archived-At: With the given hint I was able to write up a helper function adding `syntax-table` properties: (defvar yaml-mode-syntax-propertize-function (syntax-propertize-rules ("^#" (0 "<")) ("[ \t]+#" (0 "<")))) While this looks much neater than my previous approach, it doesn't nearly function as well. After loading up the file, not a single comment is highlighted correctly. The only thing that triggers refontification is deleting(!) text close to the comment. Inserting text(!!) before or after the comment disables the highlighting again. This is inacceptable behaviour and since I'm not in the mood for figuring out how font-lock works, I'll wait and see whether someone's got an idea how to combine the syntax entries presented in the original post.