help-source-highlight
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-source-highlight] conditional highlight (without losing other


From: Federico Bruni
Subject: Re: [Help-source-highlight] conditional highlight (without losing other definitions)
Date: Sun, 26 Feb 2012 10:30:35 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]