From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: immerrr again Newsgroups: gmane.emacs.devel Subject: Re: font-lock-syntactic-keywords: evaluating arbitrary elisp inside matchers? Date: Tue, 26 Mar 2013 17:48:59 +0400 Message-ID: References: <505CD2A0.1090906@gmail.com> <5061960C.7050106@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1364305771 23118 80.91.229.3 (26 Mar 2013 13:49:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Mar 2013 13:49:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 26 14:49:56 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 1UKUFt-0003Ux-J7 for ged-emacs-devel@m.gmane.org; Tue, 26 Mar 2013 14:49:37 +0100 Original-Received: from localhost ([::1]:42598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKUFV-00005M-Oo for ged-emacs-devel@m.gmane.org; Tue, 26 Mar 2013 09:49:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:32782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKUFP-0008UL-Mx for emacs-devel@gnu.org; Tue, 26 Mar 2013 09:49:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKUFI-00035k-Au for emacs-devel@gnu.org; Tue, 26 Mar 2013 09:49:07 -0400 Original-Received: from mail-ie0-x231.google.com ([2607:f8b0:4001:c03::231]:32794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKUFI-00035T-6L for emacs-devel@gnu.org; Tue, 26 Mar 2013 09:49:00 -0400 Original-Received: by mail-ie0-f177.google.com with SMTP id tp5so4321920ieb.8 for ; Tue, 26 Mar 2013 06:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=pIfPpoz7EelIC09ZRBa2Bqxtn5pSDNfkwf/zcAH1bUU=; b=nq0KEMjhuasreSqj2/wr64w68VH+r2GAMx4B3HECLSZXB/yBBxXTTYN/gbtluz7ozy YIBuZ+cMG9v5Ihzpi4ifAsiq5MBdO1kbrFLop1i5oEfo2C0WWbnSF/ZZFxsYA31ZhNy/ ko5G2LfdrUCsXTkjcE0xE2IeKTP0Vq9TtG0hQhxSeUpkgG5ihv/DflOr8k3QPF8WMdmC fbLnbqXaFJuK7j/gMnZfJ0qvZHCEdCzm1FEgv3I/P5kNFIJJhnDJGG/89Ap3EL6y0RBe JJ2MPF+78gtSDx0a6squlX3ar9YLBDhQPI0sQMY52Ll71JPAt47kcbT5AypB95wvQA4N WClA== X-Received: by 10.42.54.5 with SMTP id p5mr9308317icg.49.1364305739205; Tue, 26 Mar 2013 06:48:59 -0700 (PDT) Original-Received: by 10.43.53.66 with HTTP; Tue, 26 Mar 2013 06:48:59 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: 9rwIC1dqVF8LqJc9Ur9wJC99YB8 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::231 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:158210 Archived-At: On Fri, Sep 28, 2012 at 4:28 PM, Stefan Monnier wrote: > > > > -- Stefan Hi Stefan Wanted to say thanks once again for the help. I've finally found the time to try out your suggestion and it worked as a charm [1]. Although, the similarity is not immediately obvious, because I couldn't resist to (cl-prettyexpand ...) the syntax-propertize-rules macro and tailor the expansion to my liking. The only drawback was that it only worked for Emacs24, so I had to backport basically the same functionality via font-lock-syntactic-keywords [2]. And this implementation, admittedly slower than syntax-propertize-based one, is probably the answer to my original question. Cheers, immerrr 1. https://github.com/immerrr/lua-mode/commit/dbedb1e3e19e81e9031eff08d2d30b19b89d8654 2. https://github.com/immerrr/lua-mode/commit/2a0314b2bda879f5e97d851c43e840671f5ace8d