[Users] The reply mark in subject (R: Re:) recognition

Michael Gmelin freebsd at grem.de
Wed Aug 8 11:42:33 CEST 2012



On Wed, 8 Aug 2012 11:08:26 +0200
Slavko <linux at slavino.sk> wrote:

> Hi Michael,

Hi,

> 
> thanks a lot!
> 
> Dňa Tue, 7 Aug 2012 23:53:20 +0200 Michael Gmelin <freebsd at grem.de>
> napísal:
> 
> > with the following content:
> > 
> > #!/usr/bin/env python
> > # save this as ~/.claws-mail/python-scripts/auto/compose_any
> > # Workaround for R: in reply headers
> > 
> > import re
> > 
> > clawsmail.compose_window.set_subject(re.sub(
> >   r"^(Re|Fwd|Fw): R:", r"\1:",
> >   clawsmail.compose_window.get_subject()
> > ))
> 
> I tried it today and it works for me! :-)
> 
> I only improve the regexp to:
> 
> r"^(Re|Fwd|Fw):( Re?:)+"
> 
> because your solution don't works with the subject in format "R: Re:
> Subject" and produces the "Re: Re: Subject" line. Now it works for any
> "R: Re" combination:
> 
> Subject 		-> Re: Subject
> R: Subject 		-> Re: Subject
> R: Re: Subject 		-> Re: Subject
> Re: R: Re: Subject 	-> Re: Subject
> R: Re: R: Re: Subject 	-> Re: Subject 
> 

I see what you did there :)

> Only one thing is left - the subject manipulating changes the content
> and closing compose window without any other change invokes the
> confirmation dialog (Save, Concept, Cancel) - of course, only when
> the subject line was changed. Is here solution to prevent showing
> this confirmation from this script, please? Same flag, or something
> else, i don't know.

I checked the claws python source, unfortunately there seems to be no
way of doing this (it's probably done in the widgets anyway?). The
claws python plugin is relatively limited in what it can do.
save_message_to seemed a likely candidate, but that selects only where
the message gets saved after it has been sent. So I assume you have to
live with this for the moment (fortunately it should only kick in when
you actually changed the subject line, which seems to be only one person
you're mailing with at the moment ;)

> 
> > As an alternative, in case you want to recompile claws yourself and
> > maintaining a patch to it, you could also change utils.c, since as I
> > learned, the German versions are already covered by claws mail.
> > This is done in utils.c around line 3740, where it reads:
> 
> Thanks, but I prefer to use the distribution packages, because the
> maintainers maintain the updates for me, and building own version
> only for one people - i encounter this only now in years…

Understandable.

> 
> regards
> 



-- 
Michael Gmelin



More information about the Users mailing list