From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luca Ferrari Newsgroups: gmane.emacs.help Subject: Re: regular expression help (again) Date: Thu, 24 Jan 2013 10:23:38 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1359019856 17509 80.91.229.3 (24 Jan 2013 09:30:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Jan 2013 09:30:56 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 24 10:31:16 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 1TyJ9N-00073j-DJ for geh-help-gnu-emacs@m.gmane.org; Thu, 24 Jan 2013 10:31:13 +0100 Original-Received: from localhost ([::1]:51532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyJ96-0007xO-2t for geh-help-gnu-emacs@m.gmane.org; Thu, 24 Jan 2013 04:30:56 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyJ8w-0007wS-Om for help-gnu-emacs@gnu.org; Thu, 24 Jan 2013 04:30:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TyJ8t-0000uB-My for help-gnu-emacs@gnu.org; Thu, 24 Jan 2013 04:30:46 -0500 Original-Received: from mail-wi0-f174.google.com ([209.85.212.174]:41607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyJ8t-0000tw-Cn for help-gnu-emacs@gnu.org; Thu, 24 Jan 2013 04:30:43 -0500 Original-Received: by mail-wi0-f174.google.com with SMTP id hq4so241611wib.1 for ; Thu, 24 Jan 2013 01:30:42 -0800 (PST) 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:content-type; bh=IV32Mmn51ebjoUXc4JKwe6g1ZQfWifMCGiTcnFjS7TA=; b=KpnKgZcAqNTU3mzH4grNlBCo1C2GLwSGfmUmnm2JmT8yQbGhaxEo65Sw1jr37hqQQk 05MtYv+I9S2wATXSssj4Iw1B4Cy4Yx1gm4N91FLXEo6hF8I76lh4noxokCEy0fGTaQiA i00zacZ2b1c/xREZv58db4JQfwq2u86C9Qkqq7QKHHEV6/TNPVYwaQfn0iq9aXyszT/S QcUqn8sACWY8LtX+/QphdhcaiuPN8YrXSrqoOCqQzCET6D52PHxkIVwYHYCQFq208KpS R5k93MM1w0ege5pe3mGIbrcublCVQCFqV8pnAVVYHyVniwE3m2Slj23kChIFfwYEvFL9 o/Ew== X-Received: by 10.194.58.175 with SMTP id s15mr1603712wjq.31.1359019418467; Thu, 24 Jan 2013 01:23:38 -0800 (PST) Original-Received: by 10.194.39.1 with HTTP; Thu, 24 Jan 2013 01:23:38 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: Oxzq5CTada9rQbxo5g7aUBhM0nw X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.174 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:88791 Archived-At: As far as I can see here http://www.emacswiki.org/emacs/MultilineFontLock using multiple lines is not enough simple to wrap it into a single regexp and appears also to be a bad idea. Luca On Thu, Jan 24, 2013 at 8:22 AM, Luca Ferrari wrote: > Hi, > there is something I'm missing: I'm still writing my mode for a > programming language and I'd like to set a font-lock for a block of > lines that begins with /SOMETHING and ends with /* like the following: > > /MASK > Field 1: _____ > Field 2: _____ > /* > > So I defined the following regular expression to first match the whole block: > > "^/\w+[ \t\n]+(.*\n)/\*$" > > but it is not working, in particular testing it against > re-search-forward the \w+ works as expected but the [ \t\n]+ > subsedquent part is blocking the regular expression. What am I doing > wrong? > > Second question, within the same block would it be possible to set a > fot-lock for any word that is not made by underscores and to set > another font-lock for any _ found in the block? I need a little > suggestion about this (if possible). > > Thanks, > Luca