<<< Date Index >>>     <<< Thread Index >>>

Re: [Mutt] #1463: document quote_regexp and quotedN colorization



#1463: document quote_regexp and quotedN colorization behaviour

Changes (by brendan):

  * component:  mutt => doc
  * milestone:  => 1.6

Old description:

> {{{
> Package: mutt
> Version: 1.4i
> Severity: normal
>
> -- Please type your report below this line
>
> I have found a weirdness in quote_regexp.
>
> In order to see it, first set the style for quotedN to something
> different from quoted, say:
>
> color   quoted          green           black
> color   quoted1         cyan            black
> color   quoted2         cyan            black
> color   quoted3         cyan            black
> color   quoted4         cyan            black
> color   quoted5         cyan            black
> color   quoted6         cyan            black
> color   quoted7         cyan            black
> color   quoted8         cyan            black
> color   quoted9         cyan            black
>
> Then, let's take an example:
>
> >foo
> > foo
> >  foo
> >>bar
> > >bar
> > > bar
> > >  bar
> > >             bar
>
> I would like the first free line to be in quoted style, and the rest
> in quoted1.
>
> I set my quote_regexp to a sensible value which would work for most
> people:
>
>   set quote_regexp="^(>[ \t]*)+"
>
> but it doesn't have the expected effect.
>
> I experimented a little with this, and found the following:
> 1. quote_regexp="^(>[ \t]*)+" does not work as I expected.
> 2. quote_regexp="^(> *)+" works, although it doesn't detect tabs.
> 3. quote_regexp="^(>[ ]*)+" works too.
> 4. quote_regexp="^(> *\t* *)+" works as I expected.
> 5. quote_regexp="^([ \t]*>)+" works, but is slightly different.
>
> My guess is that "[ \t]" is internally interpreted the same way my
> (...)+ is interpreted and makes it fail. I had expected that the
> outermost repeated pattern (if that makes any sense) would be the one
> used for quotedN.
>
> Is this a bug? If not, what is the rule for computing N for quotedN,
> and could you please add it into the documentation (unless I
> overlooked, there are just 3 lines under 6.3.176. quote_regexp talking
> about it)?
>
> Thank you.
>
> Regards,
>
> Hugo
>
> Received: (at submit) by bugs.guug.de; 29 Aug 2001 16:32:06 +0000
> From volker@xxxxxxxxxxxxx Wed Aug 29 18:32:06 2001
> Received: from mout03.kundenserver.de ([195.20.224.218])
>         by trithemius.gnupg.org with esmtp (Exim 3.12 #1 (Debian))
>         id 15c8G6-0000BL-00
>         for <submit@xxxxxxxxxxxx>; Wed, 29 Aug 2001 18:32:06 +0200
> Received: from [195.20.224.220] (helo=mrvdom04.kundenserver.de)
>         by mout03.kundenserver.de with esmtp (Exim 2.12 #2)
>         id 15c8Er-0006zg-00
>         for submit@xxxxxxxxxxxx; Wed, 29 Aug 2001 18:30:49 +0200
> Received: from moell.tops.net ([212.79.185.16] helo=sam.die-moells.de)
>         by mrvdom04.kundenserver.de with esmtp (Exim 2.12 #2)
>         id 15c8Eo-0005wE-00
>         for submit@xxxxxxxxxxxx; Wed, 29 Aug 2001 18:30:46 +0200
> Received: (from moell@localhost)
>         by sam.die-moells.de (8.11.2/8.11.2) id f7TGUui13873;
>         Wed, 29 Aug 2001 18:30:56 +0200
> Date: Wed, 29 Aug 2001 18:30:56 +0200
> From: Volker Moell <volker@xxxxxxxxxxxxx>
> Message-Id: <200108291630.f7TGUui13873@xxxxxxxxxxxxxxxxx>
> Organization: 10 HOME / 20 SWEET / 30 HOME
> Subject: mutt-1.3.21i: Curious colorization when using quotedN
> To: submit@xxxxxxxxxxxx
>
> Package: mutt
> Version: 1.3.21i
> Severity: normal
>
> -- Please type your report below this line
>
> On the following configuration
>    ------------------------(snipp)---------------------
>    color        quoted          red             default
>    color        quoted1         magenta         default
>    color        quoted2         green           default
>    color        quoted3         yellow          default
>    ------------------------(snipp)---------------------
>
> the different quoting levels are colorized randomly in varying the color
> when scrolling through the mail in the pager, and finally the color is
> not always the one which is specified in the muttrc.
>
> I tried it with the following test mail:
>
> ---------------------------------(snipp)------------------------------------
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> > > > > > > sechs
> >>>>>> sechs
> > > > > > fuenf
> >>>>> fuenf
> > > > > vier
> >>>> vier
> > > > drei
> >>> drei
> > > zwo
> >> zwo
> > eins
> null
>

> X> > > drei
> X> > zwo
> X> eins
>
> XY> AB> CD> drei
> XY> > > drei
> XY> AB> zwo
> XY> > zwo
> XY> eins
> ---------------------------------(snapp)------------------------------------
>

> -- Mutt Version Information
>
> Mutt 1.3.21i (2001-08-21)
>
> set quote_regexp="^([A-Z \t]{0,2}[\|>:}#])+"
> color   quoted          red             default
> color   quoted1         magenta         default
> color   quoted2         green           default
> color   quoted3         yellow          default
> >How-To-Repeat:
> >Fix:
> Mutt uses "quote_regexp" to identify which lines are quotes.
> It keeps track of the exact(!) matching string to compare
> different quote levels for the "quotedN" coloring items,
> it does not(!) ignore white space when comparing:
> ' > >' is the _not_ the same as '>>'.
> Even though both have the same numerical quote level (2),
> different quote strings are typically produced by different
> authors, therefore should be treated as separate quote level.
> }}}

New description:

 {{{
 Package: mutt
 Version: 1.4i
 Severity: normal

 -- Please type your report below this line

 I have found a weirdness in quote_regexp.

 In order to see it, first set the style for quotedN to something
 different from quoted, say:

 color   quoted          green           black
 color   quoted1         cyan            black
 color   quoted2         cyan            black
 color   quoted3         cyan            black
 color   quoted4         cyan            black
 color   quoted5         cyan            black
 color   quoted6         cyan            black
 color   quoted7         cyan            black
 color   quoted8         cyan            black
 color   quoted9         cyan            black

 Then, let's take an example:

 >foo
 > foo
 >  foo
 >>bar
 > >bar
 > > bar
 > >  bar
 > >             bar

 I would like the first free line to be in quoted style, and the rest
 in quoted1.

 I set my quote_regexp to a sensible value which would work for most
 people:

   set quote_regexp="^(>[ \t]*)+"

 but it doesn't have the expected effect.

 I experimented a little with this, and found the following:
 1. quote_regexp="^(>[ \t]*)+" does not work as I expected.
 2. quote_regexp="^(> *)+" works, although it doesn't detect tabs.
 3. quote_regexp="^(>[ ]*)+" works too.
 4. quote_regexp="^(> *\t* *)+" works as I expected.
 5. quote_regexp="^([ \t]*>)+" works, but is slightly different.

 My guess is that "[ \t]" is internally interpreted the same way my
 (...)+ is interpreted and makes it fail. I had expected that the
 outermost repeated pattern (if that makes any sense) would be the one
 used for quotedN.

 Is this a bug? If not, what is the rule for computing N for quotedN,
 and could you please add it into the documentation (unless I
 overlooked, there are just 3 lines under 6.3.176. quote_regexp talking
 about it)?

 Thank you.

 Regards,

 Hugo

 Received: (at submit) by bugs.guug.de; 29 Aug 2001 16:32:06 +0000
 From volker@xxxxxxxxxxxxx Wed Aug 29 18:32:06 2001
 Received: from mout03.kundenserver.de ([195.20.224.218])
         by trithemius.gnupg.org with esmtp (Exim 3.12 #1 (Debian))
         id 15c8G6-0000BL-00
         for <submit@xxxxxxxxxxxx>; Wed, 29 Aug 2001 18:32:06 +0200
 Received: from [195.20.224.220] (helo=mrvdom04.kundenserver.de)
         by mout03.kundenserver.de with esmtp (Exim 2.12 #2)
         id 15c8Er-0006zg-00
         for submit@xxxxxxxxxxxx; Wed, 29 Aug 2001 18:30:49 +0200
 Received: from moell.tops.net ([212.79.185.16] helo=sam.die-moells.de)
         by mrvdom04.kundenserver.de with esmtp (Exim 2.12 #2)
         id 15c8Eo-0005wE-00
         for submit@xxxxxxxxxxxx; Wed, 29 Aug 2001 18:30:46 +0200
 Received: (from moell@localhost)
         by sam.die-moells.de (8.11.2/8.11.2) id f7TGUui13873;
         Wed, 29 Aug 2001 18:30:56 +0200
 Date: Wed, 29 Aug 2001 18:30:56 +0200
 From: Volker Moell <volker@xxxxxxxxxxxxx>
 Message-Id: <200108291630.f7TGUui13873@xxxxxxxxxxxxxxxxx>
 Organization: 10 HOME / 20 SWEET / 30 HOME
 Subject: mutt-1.3.21i: Curious colorization when using quotedN
 To: submit@xxxxxxxxxxxx

 Package: mutt
 Version: 1.3.21i
 Severity: normal

 -- Please type your report below this line

 On the following configuration
    ------------------------(snipp)---------------------
    color        quoted          red             default
    color        quoted1         magenta         default
    color        quoted2         green           default
    color        quoted3         yellow          default
    ------------------------(snipp)---------------------

 the different quoting levels are colorized randomly in varying the color
 when scrolling through the mail in the pager, and finally the color is
 not always the one which is specified in the muttrc.

 I tried it with the following test mail:

 ---------------------------------(snipp)------------------------------------
 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 > > > > > > sechs
 >>>>>> sechs
 > > > > > fuenf
 >>>>> fuenf
 > > > > vier
 >>>> vier
 > > > drei
 >>> drei
 > > zwo
 >> zwo
 > eins
 null


 X> > > drei
 X> > zwo
 X> eins

 XY> AB> CD> drei
 XY> > > drei
 XY> AB> zwo
 XY> > zwo
 XY> eins
 ---------------------------------(snapp)------------------------------------


 -- Mutt Version Information

 Mutt 1.3.21i (2001-08-21)

 set quote_regexp="^([A-Z \t]{0,2}[\|>:}#])+"
 color   quoted          red             default
 color   quoted1         magenta         default
 color   quoted2         green           default
 color   quoted3         yellow          default
 >How-To-Repeat:
 >Fix:
 Mutt uses "quote_regexp" to identify which lines are quotes.
 It keeps track of the exact(!) matching string to compare
 different quote levels for the "quotedN" coloring items,
 it does not(!) ignore white space when comparing:
 ' > >' is the _not_ the same as '>>'.
 Even though both have the same numerical quote level (2),
 different quote strings are typically produced by different
 authors, therefore should be treated as separate quote level.
 }}}

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/1463#comment:7>