How to set the color for slrn-like verbatim marks in mail body

This is a discussion on How to set the color for slrn-like verbatim marks in mail body within the Mutt forums in Other Technologies category; Hello, I was wondering if it is possible to setup mutt to print parts of a mail body, enclosed by slrn-like verbatim marks #v+ and #v-, in a different color than the default, say green. For those how don't know slrn-like verbatim marks: they may be used to mark a part of text as verbatim, e.g. a code listing. #v+ on a single line is used to introduce a verbatim text block and #v- on a single line is use to end a verbatim text block. For example, if the following text appears on a news posting in slrn, the ...

Go Back   Application Development Forum > Other Technologies > Mutt

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 05-07-2004, 10:01 PM
Daniel Schoemer
Guest
 
Default How to set the color for slrn-like verbatim marks in mail body

Hello,

I was wondering if it is possible to setup mutt to print parts of a mail
body, enclosed by slrn-like verbatim marks #v+ and #v-, in
a different color than the default, say green.

For those how don't know slrn-like verbatim marks: they may be used to
mark a part of text as verbatim, e.g. a code listing. #v+ on a single
line is used to introduce a verbatim text block and #v- on a single
line is use to end a verbatim text block. For example, if the following
text appears on a news posting in slrn, the three lines are printed in
in green (on my computer).

#v+
some meaningless code sample ...
#v-

Now I want to tell mutt to print such text blocks in a different color
than the default mail body color. First I've tried to create a regular
expression with vim (because it can highlight the match during typing
the expression). For vim, the regular expression

\(^#v+$\)\(\n\|\r\|.\)\{-}\(^#v-$\)

matches the lines as I expect, though it might not be optimal. After
translation to the mutt syntax, I get the following regular expression,
which should match nearly the same as above:

(^#v\\+$)(\n|\r|.)*(^#v-$)
^
The main difference is here --'. In the vim expression, I used \{-} to
match (\n|\r|.) zero or more times, but as few as possible. Since
I found no similar token in mutt's regular expression syntax
description, I used *.

Now, if I put the following line in my .muttrc, the verbatim marks #v+
and #v- are printed in green, if on a single line, that's OK. But the
lines between the verbatim marks are not printed in green but in the
default color.

color body green default "(^#v\\+$)(\n|\r|.)*(^#v-$)"

The only explanation of this behaviour I can think of, is that mutt
always matches regular expressions on a single line or the line-break
and/or carridge-return characters in my expression are not correct.

I searched Google and Google Groups for "mutt slrn verbatim marks", but
there were no suitable results.

So, is there anybody who can tell me what is wrong with my approach? Is
it possible at least?

Regards,
Daniel Schoemer
--
All messages to the from: address are deleted immediately. To contact
my in private, please use reply-to. Replace " d-o-t " and " a-t ".
Reply With Quote
  #2  
Old 05-10-2004, 02:49 PM
Paul Walker
Guest
 
Default Re: How to set the color for slrn-like verbatim marks in mail body

On Sat, 8 May 2004 04:01:39 +0200, Daniel Schoemer wrote:

> So, is there anybody who can tell me what is wrong with my approach? Is
> it possible at least?


I don't think regexps in mutt can span lines, but the manual doesn't seem to
say either way. Sorry. If you're really curious, you could always check the
source. ;-)

--
Paul
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 05:32 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.