jed-users mailing list

[2002 Date Index] [2002 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [jed-users] Regexp question


Hi Guido,

Guido Gonzato <ggonza@xxxxxx> wrote:

> a tricky question about regular expressions. The following line defines a
> rule that highlights everything between curly brackets:

>   dfa_define_highlight_rule ("{.*}", "keyword1", name);

Replace the rule by "{[^}]*}", otherwise multiple braces on one line
will be highlightes as once. Like here:

  see \ref{reference1} and \ref{reference2}.
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The highlighting would reach from the first '{' to the last '}' on
this line.

> What can I use to match any character including newline? How can I modify
> the rule?

I have no idea, but I would like such a feature too. I had a quick
look at NEdit, which can do this. It uses separate rules for the
beginning and the end of such a highlighting rule.

And NEdit also can nest such rules, i.e. things like that:

  \section{This is the \emph{most} important chapter}
  
Here, the words \section and \emph are highlighted by the rule for
these keywords and the rest is highlighted by the rule for text in
curly braces. In jed all text within the outer braces is highlighted
in the same colour.

On the other hand, this nested highlighting in NEdit is very slow. It
halts my 200MHz Pentium-I for at least a second whenever the rule
changes, i.e. when I type '{', '}' or '\'. This is quite disturbing
for quick-typing-people.

Martin

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2002 date index] [2002 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]