From MAILER-DAEMON Thu Feb 02 11:12:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RszGb-000671-0O
	for mharc-help-source-highlight@gnu.org; Thu, 02 Feb 2012 11:12:09 -0500
Received: from eggs.gnu.org ([140.186.70.92]:48947)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1RszGV-00065J-4H
	for help-source-highlight@gnu.org; Thu, 02 Feb 2012 11:12:07 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1RszGO-0003rw-NE
	for help-source-highlight@gnu.org; Thu, 02 Feb 2012 11:12:03 -0500
Received: from mail-bk0-f41.google.com ([209.85.214.41]:50154)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1RszGO-0003rc-Cf
	for help-source-highlight@gnu.org; Thu, 02 Feb 2012 11:11:56 -0500
Received: by bkbzs2 with SMTP id zs2so2713902bkb.0
	for <help-source-highlight@gnu.org>;
	Thu, 02 Feb 2012 08:11:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:user-agent:mime-version:to:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=k72CojsTDZu1V+7nQMVUsIQZ2qTppfL2vlVzmKfGYbY=;
	b=rNFndtRJlYcl39bSeK47zQHJcyheRLr3Sd9b8L948BcZJ5NI10CYPTC1EBXEs6cobi
	RIhNBUUjmO2nKuaafcOgEZoAdONNy6LAAPPG/3B/zX/d9o23qz7hfHcbSa8pbj185onU
	uwofLYOJ4mZ+g1P3ks9eNmdZll006KHsAtxlo=
Received: by 10.204.153.27 with SMTP id i27mr1701016bkw.81.1328199114810;
	Thu, 02 Feb 2012 08:11:54 -0800 (PST)
Received: from [192.168.1.130] (2-231-9-43.ip204.fastwebnet.it. [2.231.9.43])
	by mx.google.com with ESMTPS id cz3sm8463458bkb.3.2012.02.02.08.11.52
	(version=SSLv3 cipher=OTHER); Thu, 02 Feb 2012 08:11:53 -0800 (PST)
Message-ID: <4F2AB790.4020504@gmail.com>
Date: Thu, 02 Feb 2012 17:19:28 +0100
From: Federico Bruni <fedelogy@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0) Gecko/20120129 Thunderbird/10.0
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F1688C7.5050605@gmail.com> <4F168A63.7090209@dsi.unifi.it>
	<4F174DC6.1000003@gmail.com> <4F1ACAA8.2050002@dsi.unifi.it>
	<4F1BF109.2030102@gmail.com> <4F1BF168.9050103@dsi.unifi.it>
	<4F1C0532.5030208@gmail.com> <4F1C1484.4090003@gmail.com>
	<4F27B312.9090809@gmail.com> <4F27B262.1070503@dsi.unifi.it>
In-Reply-To: <4F27B262.1070503@dsi.unifi.it>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.41
Subject: Re: [Help-source-highlight] regexp for scheme blocks in lilypond
 language
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Feb 2012 16:12:07 -0000

Il 31/01/2012 10:20, Lorenzo Bettini ha scritto:
> Sorry, I've been busy these days
>
> `#'?\((\(*)` @{1} + ")"
>
> the @{1} will refer to the grouped expression of the previous matched
> string, i.e., (\(*) which looks wrong to me...
>
> thus, the ending delimiter would try to match
>
> "()"
>
> which looks wrong to me...
>
Yyes, to me too :)
That's why I surprised it was working.

I think it was working because @{1} was useless.
I've found out that I don't need dynamic backreference. The following 
rule works fine (I think it's final):

environment scheme delim '#\'?\(' ")" multiline nested begin
   environment scheme delim "(" ")" multiline nested begin
     include "url.lang"
   end
end

Also, I've realized that the environment matches also single line 
strings. I need to add just this to cover all the cases:

scheme_value = '##(t|f)',
                '#\'?[[:alnum:]\.-]+'


> again, could you please provide some examples of strings that you need
> to match?

Yes, see example below (commented with %, as in LilyPond syntax):


%% Scheme big block: #(......)
#(define (naturalize-pitch p)
    (let ((o (ly:pitch-octave p))
          (a (* 4 (ly:pitch-alteration p)))
          ;; alteration, a, in quarter tone steps,
          ;; for historical reasons
          (n (ly:pitch-notename p)))
      (cond
       ((and (> a 1) (or (eq? n 6) (eq? n 2)))
        (set! a (- a 2))
        (set! n (+ n 1)))
       ((and (< a -1) (or (eq? n 0) (eq? n 3)))
        (set! a (+ a 2))
        (set! n (- n 1))))
      (cond
       ((> a 2) (set! a (- a 4)) (set! n (+ n 1)))
       ((< a -2) (set! a (+ a 4)) (set! n (- n 1))))
      (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7))))
      (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7))))
      (ly:make-pitch o n (/ a 4))))


%% Multiline scheme block in \paper: #'(.......)
\paper {
   score-system-spacing =
     #'((basic-distance . 12)
        (minimum-distance . 6)
        (padding . 1)
        (stretchability . 12))
}

%% Scheme strings (no multiline): #'(.......)
tagline =
     \markup {
       \override #'(box-padding . 1.0) \override #'(baseline-skip . 2.7) 
\box
       \center-column {
         \small \line { Sheet music from \with-url 
#"http://www.MutopiaProject.org"
           \line { \teeny www. \hspace #-0.5 MutopiaProject \hspace 
#-0.5 \teeny .org \hspace #0.5 }
         }
       }
     }

%% Scheme values
\hspace #0.5
ragged-right = ##t
print-page-number = ##f
\applyMusic #unfold-repeats


From MAILER-DAEMON Thu Feb 02 12:01:55 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rt02l-0004c3-1r
	for mharc-help-source-highlight@gnu.org; Thu, 02 Feb 2012 12:01:55 -0500
Received: from eggs.gnu.org ([140.186.70.92]:37937)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1Rt02b-0004VS-Mh
	for help-source-highlight@gnu.org; Thu, 02 Feb 2012 12:01:53 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1Rt02X-00068q-Py
	for help-source-highlight@gnu.org; Thu, 02 Feb 2012 12:01:45 -0500
Received: from mail-bk0-f41.google.com ([209.85.214.41]:34099)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1Rt02X-00068e-FO
	for help-source-highlight@gnu.org; Thu, 02 Feb 2012 12:01:41 -0500
Received: by bkbzs2 with SMTP id zs2so2779667bkb.0
	for <help-source-highlight@gnu.org>;
	Thu, 02 Feb 2012 09:01:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:user-agent:mime-version:to:subject
	:content-type:content-transfer-encoding;
	bh=zBrBqNJZFJ1BOm/Ox+NjT6kplRImVf8Mln0eEwBe0is=;
	b=nLs5I1aYySiEEtNUQPScNfCDsEFqHSZLn/UzSIZqtmhV4S/VJVxzxipjB3uh37Cgaj
	UnNWUmyGTvIPe3yuZ8wXAptGWEoZfVkfP1YmHSU0yjvoGwYWiUswYmkVuI2wBmwXio5I
	RWAYmLz6dPp0le/3XrPEuske4PzORFxyafLGI=
Received: by 10.204.152.88 with SMTP id f24mr1711825bkw.31.1328202100523;
	Thu, 02 Feb 2012 09:01:40 -0800 (PST)
Received: from [192.168.1.130] (2-231-9-43.ip204.fastwebnet.it. [2.231.9.43])
	by mx.google.com with ESMTPS id
	ez5sm8745793bkc.15.2012.02.02.09.01.39 (version=SSLv3 cipher=OTHER);
	Thu, 02 Feb 2012 09:01:39 -0800 (PST)
Message-ID: <4F2AC33B.4090008@gmail.com>
Date: Thu, 02 Feb 2012 18:09:15 +0100
From: Federico Bruni <fedelogy@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0) Gecko/20120129 Thunderbird/10.0
MIME-Version: 1.0
To: help-source-highlight@gnu.org
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.41
Subject: [Help-source-highlight] conditional highlight (without losing other
	definitions)
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Feb 2012 17:01:53 -0000

Hi,

I'm trying to find a smarter way to highlight some strings:

All the "\strings" inside \markup{ ... } should have a different colour 
of \strings occurences in other parts of the input.
How can I achieve that in a smart way (i.e. without using a list of all 
the \strings which can occur inside a \markup{} block)?

I want to preserve all the other highlighting definitions. Maybe 
state|environment is not the right tool? Because in Doc 7.9 it says:

"When entering a state/environment, however, the definitions given 
outside the state/environment are not matched. "

Let's do an example:

\markup {
   \override #'(box-padding . 1.0) \override #'(baseline-skip . 2.7) \box
     \center-column {
       \small \line { Sheet music from \with-url 
#"http://www.MutopiaProject.org"
       \line { \teeny www. \hspace #-0.5 MutopiaProject \hspace #-0.5 
\teeny .org \hspace #0.5 }
       }
     }
}

I want to match only: \override \box \center-column \small \line 
\with-url \teeny \hspace

The following environment:

environment markup delim '\\markup\s*\{' "}" multiline nested begin
   environment markup delim "{" "}" multiline nested begin
     markup_command = '\\[[:alpha:]-]+'
   end
end

can see the relevant block and highlight the \strings correctly, but at 
the same time it breaks something, in particular some elements lose 
their highlighting (as documentations says):

1) \markup
2) {}
3) #......

So I guess that state|environment is not the solution here. Or I'm 
missing something?
Can you give me a hint?

Thanks,
Federico (really close to the final draft of lilypond.lang)


From MAILER-DAEMON Tue Feb 07 15:48:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rurxp-0002m7-Ky
	for mharc-help-source-highlight@gnu.org; Tue, 07 Feb 2012 15:48:33 -0500
Received: from eggs.gnu.org ([140.186.70.92]:38133)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1Rurxm-0002kF-Bk
	for help-source-highlight@gnu.org; Tue, 07 Feb 2012 15:48:31 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1Rurxk-0000MA-Kp
	for help-source-highlight@gnu.org; Tue, 07 Feb 2012 15:48:30 -0500
Received: from pianeta.di.unito.it ([130.192.156.1]:46491)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1Rurxk-0000LB-7Q
	for help-source-highlight@gnu.org; Tue, 07 Feb 2012 15:48:28 -0500
X-MailScanner-From: bettini@dsi.unifi.it
X-SpamCheck: not spam, SpamAssassin (not cached, score=-103.113, required 3,
	autolearn=not spam, AUTHENTICATEDUSER -100.00, AWL 0.39,
	BAYES_00 -2.60, RCVD_IN_DNSWL_LOW -1.00, RDNS_NONE 0.10)
X-AntiVirus: Email Clean
X-dipinfo-MailScanner-ID: q17KmBAs009705
X-dipinfo-MailScanner-Information: Please contact Department of Computer
	Science technical staff for more information
Received: from pianeta.di.unito.it ([130.192.156.1])
	by pianeta.di.unito.it (INFO-DIP) with ESMTP id q17KmBAs009705
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO
	AuthenticatedUser=bettini ) for <help-source-highlight@gnu.org>;
	Tue, 7 Feb 2012 21:48:14 +0100 (CET)
X-DKIM: OpenDKIM Filter v2.4.1 pianeta.di.unito.it q17KmBAs009705
Message-ID: <4F318E0B.7040204@dsi.unifi.it>
Date: Tue, 07 Feb 2012 21:48:11 +0100
From: Lorenzo Bettini <bettini@dsi.unifi.it>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:9.0) Gecko/20111229 Thunderbird/9.0
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F2AC33B.4090008@gmail.com>
In-Reply-To: <4F2AC33B.4090008@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 130.192.156.1
Subject: Re: [Help-source-highlight] conditional highlight (without losing
 other definitions)
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 07 Feb 2012 20:48:31 -0000

On 02/02/2012 06:09 PM, Federico Bruni wrote:
> Hi,
>
> I'm trying to find a smarter way to highlight some strings:
>
> All the "\strings" inside \markup{ ... } should have a different colour
> of \strings occurences in other parts of the input.
> How can I achieve that in a smart way (i.e. without using a list of all
> the \strings which can occur inside a \markup{} block)?
>
> I want to preserve all the other highlighting definitions. Maybe
> state|environment is not the right tool? Because in Doc 7.9 it says:
>
> "When entering a state/environment, however, the definitions given
> outside the state/environment are not matched. "
>
> Let's do an example:
>
> \markup {
> \override #'(box-padding . 1.0) \override #'(baseline-skip . 2.7) \box
> \center-column {
> \small \line { Sheet music from \with-url #"http://www.MutopiaProject.org"
> \line { \teeny www. \hspace #-0.5 MutopiaProject \hspace #-0.5 \teeny
> .org \hspace #0.5 }
> }
> }
> }
>
> I want to match only: \override \box \center-column \small \line
> \with-url \teeny \hspace
>
> The following environment:
>
> environment markup delim '\\markup\s*\{' "}" multiline nested begin
> environment markup delim "{" "}" multiline nested begin
> markup_command = '\\[[:alpha:]-]+'
> end
> end

Hi

what is that - '\\[[:alpha:]-]+' ?

if the strings starting with \ are fixed, you could simply list them

markup_command = "\override","\box" etc.

>
> can see the relevant block and highlight the \strings correctly, but at
> the same time it breaks something, in particular some elements lose
> their highlighting (as documentations says):
>
> 1) \markup
> 2) {}
> 3) #......

I didn't understand this, could you please elaborate it?

cheers
	Lorenzo

-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


From MAILER-DAEMON Sat Feb 11 07:51:03 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RwCPv-0000Dq-1O
	for mharc-help-source-highlight@gnu.org; Sat, 11 Feb 2012 07:51:03 -0500
Received: from eggs.gnu.org ([140.186.70.92]:41207)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1RwCPs-0000Dg-3N
	for help-source-highlight@gnu.org; Sat, 11 Feb 2012 07:51:01 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1RwCPp-0003yZ-83
	for help-source-highlight@gnu.org; Sat, 11 Feb 2012 07:51:00 -0500
Received: from mail-ey0-f169.google.com ([209.85.215.169]:63229)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1RwCPo-0003yG-Vd
	for help-source-highlight@gnu.org; Sat, 11 Feb 2012 07:50:57 -0500
Received: by eaag11 with SMTP id g11so1261475eaa.0
	for <help-source-highlight@gnu.org>;
	Sat, 11 Feb 2012 04:50:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:user-agent:mime-version:to:subject:references
	:in-reply-to:content-type;
	bh=Jrb974SwFPokuYYsTgjlvMjOps/aPwKtLC067BBsw1U=;
	b=StRQouaT57eu9R1TlbnE5YoLC5SOMrSzDnhTo5Wv4ojGY4RuVIFk9f6JwLVbMEAvIi
	R8Fbdt60PjTwFT9qA22vTfnqAihDUjsJu51whZMvaiDJIv8eetiFpXFB894YTWpVaLbo
	jOUhpYkE6E0hM4XxI97qgU/2asMszMzbonPOs=
Received: by 10.213.27.148 with SMTP id i20mr906284ebc.78.1328964654036;
	Sat, 11 Feb 2012 04:50:54 -0800 (PST)
Received: from [192.168.1.130] (2-231-9-43.ip204.fastwebnet.it. [2.231.9.43])
	by mx.google.com with ESMTPS id
	n17sm34941018eei.3.2012.02.11.04.50.52 (version=SSLv3 cipher=OTHER);
	Sat, 11 Feb 2012 04:50:53 -0800 (PST)
Message-ID: <4F366602.70409@gmail.com>
Date: Sat, 11 Feb 2012 13:58:42 +0100
From: Federico Bruni <fedelogy@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0) Gecko/20120129 Thunderbird/10.0
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F2AC33B.4090008@gmail.com> <4F318E0B.7040204@dsi.unifi.it>
In-Reply-To: <4F318E0B.7040204@dsi.unifi.it>
Content-Type: multipart/mixed; boundary="------------030509030804040002060109"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.215.169
Subject: Re: [Help-source-highlight] conditional highlight (without losing
 other definitions)
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 11 Feb 2012 12:51:01 -0000

This is a multi-part message in MIME format.
--------------030509030804040002060109
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Il 07/02/2012 21:48, Lorenzo Bettini ha scritto:
> On 02/02/2012 06:09 PM, Federico Bruni wrote:
>> Hi,
>>
>> I'm trying to find a smarter way to highlight some strings:
>>
>> All the "\strings" inside \markup{ ... } should have a different colour
>> of \strings occurences in other parts of the input.
>> How can I achieve that in a smart way (i.e. without using a list of all
>> the \strings which can occur inside a \markup{} block)?
>>
>> I want to preserve all the other highlighting definitions. Maybe
>> state|environment is not the right tool? Because in Doc 7.9 it says:
>>
>> "When entering a state/environment, however, the definitions given
>> outside the state/environment are not matched. "
>>
>> Let's do an example:
>>
>> \markup {
>> \override #'(box-padding . 1.0) \override #'(baseline-skip . 2.7) \box
>> \center-column {
>> \small \line { Sheet music from \with-url
>> #"http://www.MutopiaProject.org"
>> \line { \teeny www. \hspace #-0.5 MutopiaProject \hspace #-0.5 \teeny
>> .org \hspace #0.5 }
>> }
>> }
>> }
>>
>> I want to match only: \override \box \center-column \small \line
>> \with-url \teeny \hspace
>>
>> The following environment:
>>
>> environment markup delim '\\markup\s*\{' "}" multiline nested begin
>> environment markup delim "{" "}" multiline nested begin
>> markup_command = '\\[[:alpha:]-]+'
>> end
>> end
>
> Hi
>
> what is that - '\\[[:alpha:]-]+' ?
>
> if the strings starting with \ are fixed, you could simply list them
>
> markup_command = "\override","\box" etc.
>

I want to avoid using a list: that's the main purpose of my question :)
I said it explicitly:
 >> How can I achieve that in a smart way (i.e. without using a list of all
 >> the \strings which can occur inside a \markup{} block)?


>>
>> can see the relevant block and highlight the \strings correctly, but at
>> the same time it breaks something, in particular some elements lose
>> their highlighting (as documentations says):
>>
>> 1) \markup
>> 2) {}
>> 3) #......
>
> I didn't understand this, could you please elaborate it?
>

In my lilypond.lang file all these three elements are defined, so that 
they are supposed to have their own highlighting: \markup and {} are 
bold black, #... is kind of brown. But if I use the environment pasted 
above their highlighting is overridden.

I attach the current version of the files.
As you can see, I wrote a list for markup_command, but this is not much 
efficient because some \commands should be highlighted as markup 
commands only if they are inside a \markup{} block (for example, \override).
I chose to put in the list only the \commands specific of a \markup 
block, but if I could make this "conditional highlighting" work it would 
be much better (for a number of reasons).

I'll be off for a week. I hope to finalize it as soon as I'm back.
If you have any advice in the meanwhile, I'll be happy to hear :)

Thanks,
Federico

--------------030509030804040002060109
Content-Type: text/plain;
 name="lilypond.lang"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="lilypond.lang"

# LilyPond v2.14.2

string delim "\"" "\"" multiline

environment scheme delim '#\'?\(' ")" multiline nested begin
  environment scheme delim "(" ")" multiline nested begin
    include "scheme.lang"
  end
  environment string delim "\"" "\"" multiline begin
    include "url.lang"
  end
end

scheme_value = '##(t|f)', '#{1,2}\'?[[:alnum:]\.:+-]+'

comment delim "%{" "%}" multiline nested
comment start "%"

# Symbols
cbracket = "{|}|<<|>>"
symbol = "(|)|~|^|_"
dynamic = '\\(<|>|!|f{1,5}|p{1,5}|m(f|p)|fp|(r|s)fz|s(f|p){1,2})(?!\w)'

# Numbers
specialchar = '(?<!#)-[1-5]\b', '\\[0-9]\b' # strings and fingerings
note_duration = '(?<=[a-zR\',!?>\*])(1|2|4|8|16|32|64|128)(\.+|\b)'
value = '[[:digit:]/]+'

# Markup commands
markup_command = '\\((left-|center-|right-|general-)?align|arrow-head',
    'beam|bold|(left-|right-)brace|(filled-|rounded-)?box|(h)?bracket',
    'caps|char|circle|combine|concat|(left-|center-|right-|dir-)?column',
    'dynamic|dot|draw(-circle|-hline|-line)|eyeglasses|epsfile',
    'fill-with-pattern|finger|(double|semi|sesqui)?flat|fontCaps|(abs-)?fontsize',
    '(auto-)?footnote|fraction|fret-diagram(-terse|-verbose)?|fromproperty',
    'halign|harp-pedal|hcenter-in|hspace|huge|italic|justify(-field|-string)?',
    '(justified-|fill-)?line|large(r)?|lookup',
    'magnify|mark(alphabet|letter)|markup(list|lines)?|medium',
    'musicglyph|natural|normal-size(-super|-sub)|normalsize',
    'normal-text|note(-by-number)?|null|number',
    'override-lines|pad(-around|-markup|-to-box|-x)',
    'page(-link|-ref)|parenthesize|path|pattern',
    'postscript|property-recursive|put-adjacent',
    'raise|replace|roman|rotate|sans|(double|semi|sesqui)?sharp|simple',
    '(back)?slashed-digit|small(er|Caps)?|stencil|strut|sub|super',
    'table-of-contents|teeny|text|tick|tiny',
    'translate(-scaled)?|transparent|triangle|typewriter|underline|upright',
    'vcenter|vspace|verbatim-file',
    'with-(url|color|dimensions|link)|whiteout|woodwind-diagram',
    'wordwrap(-lines|-field|-string)?)\b'


lyric_command = '\\(lyricmode|lyrics(to)?)'

# Main commands
preproc = '\\(book(part)?|context|consists|header|include|language|layout',
    'midi|once|override(Property)?|paper|remove(WithTag)?',
    'revert|score|(un)?set|version|with)\b'

# Variables of music functions
variable = '(alto|baritone|bass|french|mezzosoprano|percussion',
    'soprano|subbass|tenor|treble|varbaritone',
    'percent|tremolo|unfold|volta',
    '\\(aeolian|dorian|ionian|lydian|locrian|minor|major|mixolydian|phrygian))\b'

header_variable = 'arranger', 'breakbefore', 'composer', 'copyright', 'date',
    'dedication', 'enteredby', 'filename', 'footer', 'instrument\b', 'lastupdated',
    'maintainer(Email|Web)?', 'meter', 'moreInfo',
    'mutopia(composer|instrument|opus|poet|title)?',
    'opus', 'poet', 'piece', 'source(url)?', 'style', '(sub){0,2}title',
    'tagline', 'texidoc'

# Contexts
# old regexp: '([A-Z][a-z]+){2,}' <-- too greedy, a list is better
context = '\\?(ChoirStaff|ChordNames|CueVoice|Devnull|Drum(Staff|Voice)',
    'Dynamics|FiguredBass|FretBoards|Global|GrandStaff',
    'GregorianTranscription(Staff|Voice)|Lyrics|Mensural(Staff|Voice)',
    'NoteNames|PianoStaff|RhythmicStaff|Score|Staff(Group)?',
    'Tab(Staff|Voice)|Vaticana(Staff|Voice)|Voice)\b'

# Layout objects
layout_object = 'Accidental(Cautionary|Placement|Suggestion)?',
    'Ambitus(Accidental|Line|NoteHead)?', 'Arpeggio', 'BalloonTextItem',
    'Bar(Line|Number)?', 'BassFigure(Alignment(Positioning)?|Bracket|Continuation|Line)?',
    'Beam', 'BendAfter', 'Break(AlignGroup|Alignment)?', 'BreathingSign',
    'ChordName', 'Clef', 'Cluster(Spanner(Beacon)?)', 'CombineTextScript',
    'Cue(Clef|EndClef)?', 'Custos', 'Dot(Column|s)?',
    'Double(PercentRepeat(Counter)?|RepeatSlash)?',
    'Dynamic(LineSpanner|Text|TextSpanner)?\b', 'Episema', 'Fingering', 'Flag',
    'Footnote(Item|Spanner)', 'FretBoard', 'Glissando', 'GraceSpacing',
    'Grid(Line|Point)', 'Hairpin', 'HorizontalBracket',
    'Instrument(Name|Switch)', 'Key(Cancellation|Signature)',
    'Laissez(VibrerTie(Column)?)', 'LedgerLineSpanner',
    'LeftEdge', 'LigatureBracket',
    'Lyric(Extender|Hyphen|Space|Text)', 'MeasureGrouping',
    'MelodyItem', 'MensuralLigature', 'MetronomeMark',
    'MultiMeasureRest(Number|Text)?', 'NonMusicalPaperColumn',
    'Note(Collision|Column|Head|Name|Spacing)', 'OctavateEight',
    'OttavaBracket', 'PaperColumn', 'ParenthesesItem',
    'Percent(Repeat(Counter)?)', 'PhrasingSlur', 'PianoPedalBracket',
    'RehearsalMark', 'Repeat(Slash|Tie(Column)?)', 'Rest(Collision)?',
     'Script(Column|Row)?', 'Slur', 'Sostenuto(Pedal(LineSpanner)?)',
     'SpacingSpanner', 'SpanBar', 'Staff(Grouper|Spacing|Symbol)',
     'StanzaNumber', 'Stem(Tremolo)?', 'StringNumber', 'StrokeFinger',
     'SustainPedal(LineSpanner)?',
     'System(StartBar|StartBrace|StartBracket|StartSquare)?',
     'TabNoteHead', 'Text(Script|Spanner)', 'Tie(Column)?', 'TimeSignature',
     'TrillPitch(Accidental|Group|Head)', 'TrillSpanner',
     'Tuplet(Bracket|Number)', 'UnaCordaPedal(LineSpanner)?',
     'VaticanaLigature', 'Vertical(Alignment|AxisGroup)', 'VoiceFollower',
     'VoltaBracket(Spanner)?'

# Context properties
context_property = '\b[a-z]+([A-Z]+[a-z]+)+',
                   'ottavation|output|stanza|timing|tonic'

# Layout properties
layout_property = '\b[a-z]+(-[a-z]+)+', 'indent'

# All the other commands (including variables defined by users)
function = '\\[[:alpha:]-]+'


--------------030509030804040002060109
Content-Type: text/plain;
 name="lilypond.style"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="lilypond.style"

symbol "#C000C0" b ;
cbracket, preproc black b ;
dynamic "#FF8000" b ;

string "#C20F0F" ;
scheme, scheme_value "#A04900" ;
comment gray i ;

note_duration teal ;
value "#808000" ;
specialchar "#FF8000" ;

function "#0000C0" b ;
markup_command "#008000" ;
lyric_command "#006000" b ;

header_variable, variable blue ;
context "#C000C0" b ;
layout_object "#C000C0" ;
context_property, layout_property blue ;


--------------030509030804040002060109--


From MAILER-DAEMON Sat Feb 11 11:16:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RwFch-0000qj-UE
	for mharc-help-source-highlight@gnu.org; Sat, 11 Feb 2012 11:16:27 -0500
Received: from eggs.gnu.org ([140.186.70.92]:34285)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1RwFce-0000ns-Vn
	for help-source-highlight@gnu.org; Sat, 11 Feb 2012 11:16:25 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1RwFcd-00073L-SM
	for help-source-highlight@gnu.org; Sat, 11 Feb 2012 11:16:24 -0500
Received: from mail-ee0-f41.google.com ([74.125.83.41]:37702)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1RwFcd-00073D-MP
	for help-source-highlight@gnu.org; Sat, 11 Feb 2012 11:16:23 -0500
Received: by eekc13 with SMTP id c13so1348549eek.0
	for <help-source-highlight@gnu.org>;
	Sat, 11 Feb 2012 08:16:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:user-agent:mime-version:to:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=Fd9uFphnd3vr2VuHVwelNCRjdn1eIoEPzmikXpcRH50=;
	b=J4ZWYisNNkr+igx245sZyx+ulc/LFyKHhla8+wXzgjfYAhyqD2R2XdBWzViKJJdoet
	dHg/3MflEhD6MgvBJ0lbyJ7nEoTcMFCuMmlHDAOV7J5+awgzjRH8DAd3CailWW0At4Bm
	mij1HAghmWxaalj3VdH7HFENUT69VHDoaNEpM=
Received: by 10.14.120.74 with SMTP id o50mr538906eeh.18.1328976982893;
	Sat, 11 Feb 2012 08:16:22 -0800 (PST)
Received: from [192.168.1.130] (2-231-9-43.ip204.fastwebnet.it. [2.231.9.43])
	by mx.google.com with ESMTPS id
	z47sm36960947eeh.9.2012.02.11.08.16.21 (version=SSLv3 cipher=OTHER);
	Sat, 11 Feb 2012 08:16:22 -0800 (PST)
Message-ID: <4F36962B.4050401@gmail.com>
Date: Sat, 11 Feb 2012 17:24:11 +0100
From: Federico Bruni <fedelogy@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0) Gecko/20120129 Thunderbird/10.0
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F2AC33B.4090008@gmail.com> <4F318E0B.7040204@dsi.unifi.it>
	<4F366602.70409@gmail.com>
In-Reply-To: <4F366602.70409@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 74.125.83.41
Subject: Re: [Help-source-highlight] conditional highlight (without losing
 other definitions)
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 11 Feb 2012 16:16:25 -0000

Il 11/02/2012 13:58, Federico Bruni ha scritto:
> I want to avoid using a list: that's the main purpose of my question :)
> I said it explicitly:
>  >> How can I achieve that in a smart way (i.e. without using a list of all
>  >> the \strings which can occur inside a \markup{} block)?

another option is using a backreference, but the following doesn't work:

markup_command = '(?<=\\markup\s\{)\\[[:alpha:]-]+'

also, it has a minor weakness: some people write \markup{ ... } instead 
of \markup { ... }


From MAILER-DAEMON Sat Feb 11 11:52:49 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RwGBt-0007cK-4P
	for mharc-help-source-highlight@gnu.org; Sat, 11 Feb 2012 11:52:49 -0500
Received: from eggs.gnu.org ([140.186.70.92]:51827)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1RwGBp-0007aT-OG
	for help-source-highlight@gnu.org; Sat, 11 Feb 2012 11:52:46 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1RwGBn-0003cE-Sm
	for help-source-highlight@gnu.org; Sat, 11 Feb 2012 11:52:45 -0500
Received: from pianeta.di.unito.it ([130.192.156.1]:57850)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1RwGBn-0003bf-FH
	for help-source-highlight@gnu.org; Sat, 11 Feb 2012 11:52:43 -0500
X-MailScanner-From: bettini@dsi.unifi.it
X-SpamCheck: 
X-AntiVirus: Email Clean
X-dipinfo-MailScanner-ID: q1BGqQ3u025389
X-dipinfo-MailScanner-Information: Please contact Department of Computer
	Science technical staff for more information
Received: from pianeta.di.unito.it ([130.192.156.1])
	by pianeta.di.unito.it (INFO-DIP) with ESMTP id q1BGqQ3u025389
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO
	AuthenticatedUser=bettini ) for <help-source-highlight@gnu.org>;
	Sat, 11 Feb 2012 17:52:30 +0100 (CET)
X-DKIM: OpenDKIM Filter v2.4.1 pianeta.di.unito.it q1BGqQ3u025389
Message-ID: <4F369CCA.1070705@dsi.unifi.it>
Date: Sat, 11 Feb 2012 17:52:26 +0100
From: Lorenzo Bettini <bettini@dsi.unifi.it>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:9.0) Gecko/20111229 Thunderbird/9.0
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F2AC33B.4090008@gmail.com>
In-Reply-To: <4F2AC33B.4090008@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 130.192.156.1
Subject: Re: [Help-source-highlight] conditional highlight (without losing
 other definitions)
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 11 Feb 2012 16:52:46 -0000

On 02/02/2012 06:09 PM, Federico Bruni wrote:
> Hi,
>
> I'm trying to find a smarter way to highlight some strings:
>
> All the "\strings" inside \markup{ ... } should have a different colour
> of \strings occurences in other parts of the input.
> How can I achieve that in a smart way (i.e. without using a list of all
> the \strings which can occur inside a \markup{} block)?
>
> I want to preserve all the other highlighting definitions. Maybe
> state|environment is not the right tool? Because in Doc 7.9 it says:
>
> "When entering a state/environment, however, the definitions given
> outside the state/environment are not matched. "
>
> Let's do an example:
>
> \markup {
> \override #'(box-padding . 1.0) \override #'(baseline-skip . 2.7) \box
> \center-column {
> \small \line { Sheet music from \with-url #"http://www.MutopiaProject.org"
> \line { \teeny www. \hspace #-0.5 MutopiaProject \hspace #-0.5 \teeny
> .org \hspace #0.5 }
> }
> }
> }
>
> I want to match only: \override \box \center-column \small \line
> \with-url \teeny \hspace
>
> The following environment:
>
> environment markup delim '\\markup\s*\{' "}" multiline nested begin
> environment markup delim "{" "}" multiline nested begin
> markup_command = '\\[[:alpha:]-]+'
> end
> end
>
> can see the relevant block and highlight the \strings correctly, but at
> the same time it breaks something, in particular some elements lose
> their highlighting (as documentations says):
>
> 1) \markup
> 2) {}
> 3) #......
>
> So I guess that state|environment is not the solution here. Or I'm
> missing something?

these elements lose highlighting since they are in a new environment as 
you said, but you can put in the environment the definitions that you 
want to be valid; instead of repeating them you might want to use 
variables, for instance the definition for #... can be put in a variable 
and have the definition outside the environment and inside...

for instance

vardef SCHEME_VALUE = '##(t|f)', '#{1,2}\'?[[:alnum:]\.:+-]+'

scheme_value = $SCHEME_VALUE

environment markup delim '\\markup\s*\{' "}" multiline nested begin
   environment markup delim "{" "}" multiline nested begin
     scheme_value = $SCHEME_VALUE
     markup_command = '\\[[:alpha:]-]+'
   end
end

though, from what I understand, what you said, it should be

environment markup delim '\\markup\s*\{' "}" multiline nested begin
   scheme_value = $SCHEME_VALUE
   markup_command = '\\[[:alpha:]-]+'
   environment markup delim "{" "}" multiline nested begin
     scheme_value = $SCHEME_VALUE
     markup_command = '\\[[:alpha:]-]+'
   end
end

cheers
	Lorenzo


-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


From MAILER-DAEMON Wed Feb 22 03:19:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S07QP-0007VJ-DZ
	for mharc-help-source-highlight@gnu.org; Wed, 22 Feb 2012 03:19:45 -0500
Received: from eggs.gnu.org ([140.186.70.92]:58175)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1S07QI-0007TK-41
	for help-source-highlight@gnu.org; Wed, 22 Feb 2012 03:19:43 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1S07QG-0000WC-58
	for help-source-highlight@gnu.org; Wed, 22 Feb 2012 03:19:38 -0500
Received: from mail-we0-f169.google.com ([74.125.82.169]:33641)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1S07QG-0000Vx-0E
	for help-source-highlight@gnu.org; Wed, 22 Feb 2012 03:19:36 -0500
Received: by wera13 with SMTP id a13so5606227wer.0
	for <help-source-highlight@gnu.org>;
	Wed, 22 Feb 2012 00:19:34 -0800 (PST)
Received-SPF: pass (google.com: domain of fedelogy@gmail.com designates
	10.180.92.165 as permitted sender) client-ip=10.180.92.165; 
Authentication-Results: mr.google.com;
	spf=pass (google.com: domain of fedelogy@gmail.com
	designates 10.180.92.165 as permitted sender)
	smtp.mail=fedelogy@gmail.com;
	dkim=pass header.i=fedelogy@gmail.com
Received: from mr.google.com ([10.180.92.165])
	by 10.180.92.165 with SMTP id cn5mr34045556wib.2.1329898774604
	(num_hops = 1); Wed, 22 Feb 2012 00:19:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:user-agent:mime-version:to:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=0Wq4w3DVo1SBSVF4/fzYATLY5l6qZUqY4310IUCajrE=;
	b=VPvnsbDhFCBBNCijv63lNt0qmOcTRh2o5yvPtZ+jThNVD4ZVx1Osv8Fpi4/QJfLZnz
	UPEjnsFKQbLTAu0yeJnRF3c+WYkkVeL+tKRFgrCRX1oXWSuzNC/8YLyL4A8f/U2I3M91
	7jkUmGDb/Jje6glOxfO+rbhnppW6FzKmZR2Lo=
Received: by 10.180.92.165 with SMTP id cn5mr28250981wib.2.1329898774504;
	Wed, 22 Feb 2012 00:19:34 -0800 (PST)
Received: from [192.168.1.130] (2-231-9-43.ip204.fastwebnet.it. [2.231.9.43])
	by mx.google.com with ESMTPS id bg3sm254668wib.10.2012.02.22.00.19.33
	(version=SSLv3 cipher=OTHER); Wed, 22 Feb 2012 00:19:33 -0800 (PST)
Message-ID: <4F44A6F8.5020500@gmail.com>
Date: Wed, 22 Feb 2012 09:27:36 +0100
From: Federico Bruni <fedelogy@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F2AC33B.4090008@gmail.com> <4F369CCA.1070705@dsi.unifi.it>
In-Reply-To: <4F369CCA.1070705@dsi.unifi.it>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 74.125.82.169
Subject: Re: [Help-source-highlight] conditional highlight (without losing
 other definitions)
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 22 Feb 2012 08:19:43 -0000

Il 11/02/2012 17:52, Lorenzo Bettini ha scritto:
> On 02/02/2012 06:09 PM, Federico Bruni wrote:
>> Hi,
>>
>> I'm trying to find a smarter way to highlight some strings:
>>
>> All the "\strings" inside \markup{ ... } should have a different colour
>> of \strings occurences in other parts of the input.
>> How can I achieve that in a smart way (i.e. without using a list of all
>> the \strings which can occur inside a \markup{} block)?
>>
>> I want to preserve all the other highlighting definitions. Maybe
>> state|environment is not the right tool? Because in Doc 7.9 it says:
>>
>> "When entering a state/environment, however, the definitions given
>> outside the state/environment are not matched. "
>>
>> Let's do an example:
>>
>> \markup {
>> \override #'(box-padding . 1.0) \override #'(baseline-skip . 2.7) \box
>> \center-column {
>> \small \line { Sheet music from \with-url
>> #"http://www.MutopiaProject.org"
>> \line { \teeny www. \hspace #-0.5 MutopiaProject \hspace #-0.5 \teeny
>> .org \hspace #0.5 }
>> }
>> }
>> }
>>
>> I want to match only: \override \box \center-column \small \line
>> \with-url \teeny \hspace
>>
>> The following environment:
>>
>> environment markup delim '\\markup\s*\{' "}" multiline nested begin
>> environment markup delim "{" "}" multiline nested begin
>> markup_command = '\\[[:alpha:]-]+'
>> end
>> end
>>
>> can see the relevant block and highlight the \strings correctly, but at
>> the same time it breaks something, in particular some elements lose
>> their highlighting (as documentations says):
>>
>> 1) \markup
>> 2) {}
>> 3) #......
>>
>> So I guess that state|environment is not the solution here. Or I'm
>> missing something?
>
> these elements lose highlighting since they are in a new environment as
> you said, but you can put in the environment the definitions that you
> want to be valid; instead of repeating them you might want to use
> variables, for instance the definition for #... can be put in a variable
> and have the definition outside the environment and inside...
>
> for instance
>
> vardef SCHEME_VALUE = '##(t|f)', '#{1,2}\'?[[:alnum:]\.:+-]+'
>
> scheme_value = $SCHEME_VALUE
>
> environment markup delim '\\markup\s*\{' "}" multiline nested begin
> environment markup delim "{" "}" multiline nested begin
> scheme_value = $SCHEME_VALUE
> markup_command = '\\[[:alpha:]-]+'
> end
> end
>
> though, from what I understand, what you said, it should be
>
> environment markup delim '\\markup\s*\{' "}" multiline nested begin
> scheme_value = $SCHEME_VALUE
> markup_command = '\\[[:alpha:]-]+'
> environment markup delim "{" "}" multiline nested begin
> scheme_value = $SCHEME_VALUE
> markup_command = '\\[[:alpha:]-]+'
> end
> end
>

Yes, the second is better.
I don't like the repetition, but it's necessary.

One more question: how can I create a variable of a delimiter?
For example:

string delim "\"" "\"" multiline

Should I rephrase it as a regexp?
Or there's a better way?
I've tried the following regexp but I can't make it working multiline.

#string delim "\"" "\"" multiline
vardef STRING = '".*"'
string = $STRING

Thanks,
Federico


From MAILER-DAEMON Wed Feb 22 04:43:05 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S08j3-0001OV-Ke
	for mharc-help-source-highlight@gnu.org; Wed, 22 Feb 2012 04:43:05 -0500
Received: from eggs.gnu.org ([140.186.70.92]:48224)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1S08iw-0001NA-62
	for help-source-highlight@gnu.org; Wed, 22 Feb 2012 04:43:04 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1S08ip-0007Cl-PX
	for help-source-highlight@gnu.org; Wed, 22 Feb 2012 04:42:58 -0500
Received: from pianeta.di.unito.it ([130.192.156.1]:57446)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1S08ip-0007CY-CS
	for help-source-highlight@gnu.org; Wed, 22 Feb 2012 04:42:51 -0500
X-MailScanner-From: bettini@dsi.unifi.it
X-SpamCheck: not spam, SpamAssassin (not cached, score=-103.122, required 3,
	autolearn=not spam, AUTHENTICATEDUSER -100.00, AWL 0.38,
	BAYES_00 -2.60, RCVD_IN_DNSWL_LOW -1.00, RDNS_NONE 0.10)
X-AntiVirus: Email Clean
X-dipinfo-MailScanner-ID: q1M9glNb019105
X-dipinfo-MailScanner-Information: Please contact Department of Computer
	Science technical staff for more information
Received: from pianeta.di.unito.it ([130.192.156.1])
	by pianeta.di.unito.it (INFO-DIP) with ESMTP id q1M9glNb019105
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO
	AuthenticatedUser=bettini ) for <help-source-highlight@gnu.org>;
	Wed, 22 Feb 2012 10:42:47 +0100 (CET)
X-DKIM: OpenDKIM Filter v2.4.1 pianeta.di.unito.it q1M9glNb019105
Message-ID: <4F44B897.2090608@dsi.unifi.it>
Date: Wed, 22 Feb 2012 10:42:47 +0100
From: Lorenzo Bettini <bettini@dsi.unifi.it>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F2AC33B.4090008@gmail.com> <4F369CCA.1070705@dsi.unifi.it>
	<4F44A6F8.5020500@gmail.com>
In-Reply-To: <4F44A6F8.5020500@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 130.192.156.1
Subject: Re: [Help-source-highlight] conditional highlight (without losing
 other definitions)
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 22 Feb 2012 09:43:04 -0000

On 02/22/2012 09:27 AM, Federico Bruni wrote:
> Il 11/02/2012 17:52, Lorenzo Bettini ha scritto:
>> On 02/02/2012 06:09 PM, Federico Bruni wrote:
>>> Hi,
>>>
>>> I'm trying to find a smarter way to highlight some strings:
>>>
>>> All the "\strings" inside \markup{ ... } should have a different colour
>>> of \strings occurences in other parts of the input.
>>> How can I achieve that in a smart way (i.e. without using a list of all
>>> the \strings which can occur inside a \markup{} block)?
>>>
>>> I want to preserve all the other highlighting definitions. Maybe
>>> state|environment is not the right tool? Because in Doc 7.9 it says:
>>>
>>> "When entering a state/environment, however, the definitions given
>>> outside the state/environment are not matched. "
>>>
>>> Let's do an example:
>>>
>>> \markup {
>>> \override #'(box-padding . 1.0) \override #'(baseline-skip . 2.7) \box
>>> \center-column {
>>> \small \line { Sheet music from \with-url
>>> #"http://www.MutopiaProject.org"
>>> \line { \teeny www. \hspace #-0.5 MutopiaProject \hspace #-0.5 \teeny
>>> .org \hspace #0.5 }
>>> }
>>> }
>>> }
>>>
>>> I want to match only: \override \box \center-column \small \line
>>> \with-url \teeny \hspace
>>>
>>> The following environment:
>>>
>>> environment markup delim '\\markup\s*\{' "}" multiline nested begin
>>> environment markup delim "{" "}" multiline nested begin
>>> markup_command = '\\[[:alpha:]-]+'
>>> end
>>> end
>>>
>>> can see the relevant block and highlight the \strings correctly, but at
>>> the same time it breaks something, in particular some elements lose
>>> their highlighting (as documentations says):
>>>
>>> 1) \markup
>>> 2) {}
>>> 3) #......
>>>
>>> So I guess that state|environment is not the solution here. Or I'm
>>> missing something?
>>
>> these elements lose highlighting since they are in a new environment as
>> you said, but you can put in the environment the definitions that you
>> want to be valid; instead of repeating them you might want to use
>> variables, for instance the definition for #... can be put in a variable
>> and have the definition outside the environment and inside...
>>
>> for instance
>>
>> vardef SCHEME_VALUE = '##(t|f)', '#{1,2}\'?[[:alnum:]\.:+-]+'
>>
>> scheme_value = $SCHEME_VALUE
>>
>> environment markup delim '\\markup\s*\{' "}" multiline nested begin
>> environment markup delim "{" "}" multiline nested begin
>> scheme_value = $SCHEME_VALUE
>> markup_command = '\\[[:alpha:]-]+'
>> end
>> end
>>
>> though, from what I understand, what you said, it should be
>>
>> environment markup delim '\\markup\s*\{' "}" multiline nested begin
>> scheme_value = $SCHEME_VALUE
>> markup_command = '\\[[:alpha:]-]+'
>> environment markup delim "{" "}" multiline nested begin
>> scheme_value = $SCHEME_VALUE
>> markup_command = '\\[[:alpha:]-]+'
>> end
>> end
>>
>
> Yes, the second is better.
> I don't like the repetition, but it's necessary.
>
> One more question: how can I create a variable of a delimiter?
> For example:
>
> string delim "\"" "\"" multiline
>
> Should I rephrase it as a regexp?
> Or there's a better way?
> I've tried the following regexp but I can't make it working multiline.
>
> #string delim "\"" "\"" multiline
> vardef STRING = '".*"'
> string = $STRING
>

If I remember correctly, you can create a variable for the single 
delimiter and then use the variable twice (in your case), for instance 
(not tested)

vardef STRING = "\""
string delim $STRING $STRING multiline

using

vardef STRING = '".*"'

will not let you use the environment mechanisms and will surely eagerly 
try to match everything till it finds another "

cheers
	Lorenzo


-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


From MAILER-DAEMON Wed Feb 22 17:57:15 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S0L7b-0002vo-G1
	for mharc-help-source-highlight@gnu.org; Wed, 22 Feb 2012 17:57:15 -0500
Received: from eggs.gnu.org ([140.186.70.92]:38207)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1S0L7Y-0002uL-SZ
	for help-source-highlight@gnu.org; Wed, 22 Feb 2012 17:57:13 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1S0L7X-0002dS-Ub
	for help-source-highlight@gnu.org; Wed, 22 Feb 2012 17:57:12 -0500
Received: from mail-ey0-f169.google.com ([209.85.215.169]:64730)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1S0L7X-0002dM-Pd
	for help-source-highlight@gnu.org; Wed, 22 Feb 2012 17:57:11 -0500
Received: by eaag11 with SMTP id g11so257783eaa.0
	for <help-source-highlight@gnu.org>;
	Wed, 22 Feb 2012 14:57:10 -0800 (PST)
Received-SPF: pass (google.com: domain of fedelogy@gmail.com designates
	10.14.48.8 as permitted sender) client-ip=10.14.48.8; 
Authentication-Results: mr.google.com;
	spf=pass (google.com: domain of fedelogy@gmail.com
	designates 10.14.48.8 as permitted sender)
	smtp.mail=fedelogy@gmail.com;
	dkim=pass header.i=fedelogy@gmail.com
Received: from mr.google.com ([10.14.48.8])
	by 10.14.48.8 with SMTP id u8mr16926412eeb.37.1329951430741 (num_hops =
	1); Wed, 22 Feb 2012 14:57:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:user-agent:mime-version:to:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=qhEP6T1svSdrTcuThBHQodfV6HelTHzAsdjay+aHhZ8=;
	b=AA+XTscT8qjO/aUOZntGR87PIE1c6b9Ul+2Y24QanjingaM77QDHLmr8+t+bUMDir0
	X+vT0gBjwokl+Arozn4IJoafut2kPf2PDDs6zzSCRFv/6cK1NuVN25DXbnuvWhxtY8cO
	CR2pIIZDWLHcHXpg2SC1iGiDDwSaMQQJyipG0=
Received: by 10.14.48.8 with SMTP id u8mr13579859eeb.37.1329951430659;
	Wed, 22 Feb 2012 14:57:10 -0800 (PST)
Received: from [192.168.1.130] (2-231-9-43.ip204.fastwebnet.it. [2.231.9.43])
	by mx.google.com with ESMTPS id
	u9sm90693691eem.11.2012.02.22.14.57.09 (version=SSLv3 cipher=OTHER);
	Wed, 22 Feb 2012 14:57:09 -0800 (PST)
Message-ID: <4F4574A9.1010701@gmail.com>
Date: Thu, 23 Feb 2012 00:05:13 +0100
From: Federico Bruni <fedelogy@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F2AC33B.4090008@gmail.com> <4F369CCA.1070705@dsi.unifi.it>
	<4F44A6F8.5020500@gmail.com> <4F44B897.2090608@dsi.unifi.it>
In-Reply-To: <4F44B897.2090608@dsi.unifi.it>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.215.169
Subject: Re: [Help-source-highlight] conditional highlight (without losing
 other definitions)
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 22 Feb 2012 22:57:13 -0000

Il 22/02/2012 10:42, Lorenzo Bettini ha scritto:
> If I remember correctly, you can create a variable for the single
> delimiter and then use the variable twice (in your case), for instance
> (not tested)
>
> vardef STRING = "\""
> string delim $STRING $STRING multiline
>
> using
>
> vardef STRING = '".*"'
>
> will not let you use the environment mechanisms and will surely eagerly
> try to match everything till it finds another "

I was interested in variables because I wanted to type less.
The variable above is useless for me.

And I've just realized that I can't use variables for environment 
definitions, which is what I would really need to "shorten".
For example:

environment scheme delim '#\'?\(' ")" multiline nested begin
   environment scheme delim "(" ")" multiline nested begin
     include "url.lang"
   end
   environment string delim "\"" "\"" multiline begin
     include "url.lang"
   end
end

I think I'll go back and use the list.
Thanks anyway for your advices,
Federico


From MAILER-DAEMON Sun Feb 26 04:22:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S1aJZ-00071r-OA
	for mharc-help-source-highlight@gnu.org; Sun, 26 Feb 2012 04:22:45 -0500
Received: from eggs.gnu.org ([208.118.235.92]:50538)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1S1aJR-0006yI-6D
	for help-source-highlight@gnu.org; Sun, 26 Feb 2012 04:22:44 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1S1aJK-0008IA-4t
	for help-source-highlight@gnu.org; Sun, 26 Feb 2012 04:22:37 -0500
Received: from mail-ey0-f169.google.com ([209.85.215.169]:44003)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <fedelogy@gmail.com>) id 1S1aJJ-0008I0-Tk
	for help-source-highlight@gnu.org; Sun, 26 Feb 2012 04:22:30 -0500
Received: by eaag11 with SMTP id g11so1625799eaa.0
	for <help-source-highlight@gnu.org>;
	Sun, 26 Feb 2012 01:22:28 -0800 (PST)
Received-SPF: pass (google.com: domain of fedelogy@gmail.com designates
	10.213.26.216 as permitted sender) client-ip=10.213.26.216; 
Authentication-Results: mr.google.com;
	spf=pass (google.com: domain of fedelogy@gmail.com
	designates 10.213.26.216 as permitted sender)
	smtp.mail=fedelogy@gmail.com;
	dkim=pass header.i=fedelogy@gmail.com
Received: from mr.google.com ([10.213.26.216])
	by 10.213.26.216 with SMTP id f24mr1981354ebc.16.1330248148469
	(num_hops = 1); Sun, 26 Feb 2012 01:22:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:user-agent:mime-version:to:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=pijZ16XR/bOFqagnrUhQu25ja1AaLtPvsvAKqFH9ujs=;
	b=lqE2dW/t9i/E6i62JY6NZ54ZkIJDofDqVK4kP9nFykfcHC3Hk0qvwqF22PjKGQqxoD
	t3WFs2lwLiT9XLPt8oNyjyiXPpMmBwOv0+5QRRoxjAG8yFgvmTwta6+a7W0WTU6+OCBO
	nBpQkqsl+icJEVDTkH8vAWIlnoxNPjeCYh0Gs=
Received: by 10.213.26.216 with SMTP id f24mr1507014ebc.16.1330248148375;
	Sun, 26 Feb 2012 01:22:28 -0800 (PST)
Received: from [192.168.1.130] (2-231-9-43.ip204.fastwebnet.it. [2.231.9.43])
	by mx.google.com with ESMTPS id
	n17sm42644455eei.3.2012.02.26.01.22.26 (version=SSLv3 cipher=OTHER);
	Sun, 26 Feb 2012 01:22:27 -0800 (PST)
Message-ID: <4F49FBBB.8000106@gmail.com>
Date: Sun, 26 Feb 2012 10:30:35 +0100
From: Federico Bruni <fedelogy@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F2AC33B.4090008@gmail.com> <4F369CCA.1070705@dsi.unifi.it>
	<4F44A6F8.5020500@gmail.com> <4F44B897.2090608@dsi.unifi.it>
	<4F4574A9.1010701@gmail.com>
In-Reply-To: <4F4574A9.1010701@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.215.169
Subject: Re: [Help-source-highlight] conditional highlight (without losing
 other definitions)
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 26 Feb 2012 09:22:44 -0000

Il 23/02/2012 00:05, Federico Bruni ha scritto:
> I was interested in variables because I wanted to type less.
> The variable above is useless for me.
>
> And I've just realized that I can't use variables for environment
> definitions, which is what I would really need to "shorten".
> For example:
>
> environment scheme delim '#\'?\(' ")" multiline nested begin
>    environment scheme delim "(" ")" multiline nested begin
>      include "url.lang"
>    end
>    environment string delim "\"" "\"" multiline begin
>      include "url.lang"
>    end
> end
>
> I think I'll go back and use the list.

I changed my mind again: I prefer the environment, even if it gets huge 
(see below).
The only problem is: the delimiters "\markup {" and "}" are not 
highlighted: "}" should be highlighted as cbracket and "\markup" same 
colour as markup_command.

There's a workaround?

# Markup commands (any \command inside \markup{})
environment markup delim '\\markup\s*\{' "}" multiline nested begin
   # definitions I want to preserve in this environment
   cbracket = $CBRACKET
   string delim "\"" "\"" multiline
   comment delim "%{" "%}" multiline nested
   comment start "%"
   scheme_value = $SCHEME_VALUE
   environment scheme delim '#\'?\(' ")" multiline nested begin
     environment scheme delim "(" ")" multiline nested begin
       include "url.lang"
     end
     environment string delim "\"" "\"" multiline begin
       include "url.lang"
     end
   end
   # actual definition
   markup_command = '\\[[:alpha:]-]+'

   # needed for nested blocks inside \markup{}
   environment markup delim "{" "}" multiline nested begin
     cbracket = $CBRACKET
     string delim "\"" "\"" multiline
     comment delim "%{" "%}" multiline nested
     comment start "%"
     scheme_value = $SCHEME_VALUE
     environment scheme delim '#\'?\(' ")" multiline nested begin
       environment scheme delim "(" ")" multiline nested begin
         include "url.lang"
       end
       environment string delim "\"" "\"" multiline begin
         include "url.lang"
       end
     end
     markup_command = '\\[[:alpha:]-]+'
   end
end


From MAILER-DAEMON Sun Feb 26 05:01:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S1avX-00047Q-IX
	for mharc-help-source-highlight@gnu.org; Sun, 26 Feb 2012 05:01:59 -0500
Received: from eggs.gnu.org ([208.118.235.92]:56660)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1S1avS-000443-9Z
	for help-source-highlight@gnu.org; Sun, 26 Feb 2012 05:01:58 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1S1avN-0004MY-1z
	for help-source-highlight@gnu.org; Sun, 26 Feb 2012 05:01:54 -0500
Received: from pianeta.di.unito.it ([130.192.156.1]:46557)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bettini@dsi.unifi.it>) id 1S1avM-0004Lm-NA
	for help-source-highlight@gnu.org; Sun, 26 Feb 2012 05:01:48 -0500
X-MailScanner-From: bettini@dsi.unifi.it
X-SpamCheck: not spam, SpamAssassin (not cached, score=-103.125, required 3,
	autolearn=not spam, AUTHENTICATEDUSER -100.00, AWL 0.37,
	BAYES_00 -2.60, RCVD_IN_DNSWL_LOW -1.00, RDNS_NONE 0.10)
X-AntiVirus: Email Clean
X-dipinfo-MailScanner-ID: q1QA1YIM002906
X-dipinfo-MailScanner-Information: Please contact Department of Computer
	Science technical staff for more information
Received: from pianeta.di.unito.it ([130.192.156.1])
	by pianeta.di.unito.it (INFO-DIP) with ESMTP id q1QA1YIM002906
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO
	AuthenticatedUser=bettini ) for <help-source-highlight@gnu.org>;
	Sun, 26 Feb 2012 11:01:34 +0100 (CET)
X-DKIM: OpenDKIM Filter v2.4.1 pianeta.di.unito.it q1QA1YIM002906
Message-ID: <4F4A02FD.3050109@dsi.unifi.it>
Date: Sun, 26 Feb 2012 11:01:33 +0100
From: Lorenzo Bettini <bettini@dsi.unifi.it>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version: 1.0
To: help-source-highlight@gnu.org
References: <4F2AC33B.4090008@gmail.com> <4F369CCA.1070705@dsi.unifi.it>
	<4F44A6F8.5020500@gmail.com> <4F44B897.2090608@dsi.unifi.it>
	<4F4574A9.1010701@gmail.com> <4F49FBBB.8000106@gmail.com>
In-Reply-To: <4F49FBBB.8000106@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 130.192.156.1
Subject: Re: [Help-source-highlight] conditional highlight (without losing
 other definitions)
X-BeenThere: help-source-highlight@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: discussion list for source-highlight <help-source-highlight@gnu.org>
List-Id: discussion list for source-highlight <help-source-highlight.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-source-highlight>
List-Post: <mailto:help-source-highlight@gnu.org>
List-Help: <mailto:help-source-highlight-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-source-highlight>, 
	<mailto:help-source-highlight-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 26 Feb 2012 10:01:58 -0000

On 02/26/2012 10:30 AM, Federico Bruni wrote:
> I changed my mind again: I prefer the environment, even if it gets huge
> (see below).
> The only problem is: the delimiters "\markup {" and "}" are not
> highlighted: "}" should be highlighted as cbracket and "\markup" same
> colour as markup_command.
>
> There's a workaround?

from what I see, the only expression that deals with "\markup {" and "}" 
is the following one

environment markup delim '\\markup\s*\{' "}" multiline nested begin

thus both strings will be highlighted as markup...

>
> # Markup commands (any \command inside \markup{})
> environment markup delim '\\markup\s*\{' "}" multiline nested begin
> # definitions I want to preserve in this environment
> cbracket = $CBRACKET
> string delim "\"" "\"" multiline
> comment delim "%{" "%}" multiline nested
> comment start "%"
> scheme_value = $SCHEME_VALUE
> environment scheme delim '#\'?\(' ")" multiline nested begin
> environment scheme delim "(" ")" multiline nested begin
> include "url.lang"
> end
> environment string delim "\"" "\"" multiline begin
> include "url.lang"
> end
> end
> # actual definition
> markup_command = '\\[[:alpha:]-]+'
>
> # needed for nested blocks inside \markup{}
> environment markup delim "{" "}" multiline nested begin
> cbracket = $CBRACKET
> string delim "\"" "\"" multiline
> comment delim "%{" "%}" multiline nested
> comment start "%"
> scheme_value = $SCHEME_VALUE
> environment scheme delim '#\'?\(' ")" multiline nested begin
> environment scheme delim "(" ")" multiline nested begin
> include "url.lang"
> end
> environment string delim "\"" "\"" multiline begin
> include "url.lang"
> end
> end
> markup_command = '\\[[:alpha:]-]+'
> end
> end
>
> _______________________________________________
> Help-source-highlight mailing list
> Help-source-highlight@gnu.org
> https://lists.gnu.org/mailman/listinfo/help-source-highlight


-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


