On Thu 2000-11-16 (18:10), Ulf Erikson wrote:
> I use a macro to do just this. except for the extra 'fixed' header, but
> you should be able to add that one easily.  All the tricks are in formail 
> and the fairly new <edit> command, which lets you edit the raw message.  
> Not sure what version is needed though.. at least 1.2.something?

Thanks, this does a great job.
However, I don't understand the details properly.

As far as I understand, you write the message id of the current message to a
tmp file.

Then you define cat as editor with certain options, edit the tagged files
and are almost done.

But how do those %s and $$ work?


Am I right that you extract the former References and insert the
<Message-ID> from the file?

formail -i "References <Message-ID> [<old message ids>]"

How is the file number defined (e.g. mutt-fix.7567)? What's the function of
this move operation to %s?


> Using your example I would tag msg#123, move to msg#100, hit ",T" to
> fix the threading, and just reopen the mailbox to have it shown.
> 
> #--
> macro index ,T "\
> <pipe-message>formail -x Message-ID > /tmp/mutt-msgID<enter>\
> <enter-command>set editor=\
> 'cat %s |\
>  formail -i \"References:\
>  \`cat /tmp/mutt-msgID;\
>    cat %s | formail -x References\`\"\
>  > /tmp/mutt-fix.$$;\
>  mv /tmp/mutt-fix.$$ %s; sleep 1; touch %s'<enter>\
> <tag-prefix><edit>\
> <shell-escape>rm /tmp/mutt-msgID<enter>\
> <enter-command>set editor=vim<enter>" \
>  "insert current message's \"Message-ID\" into the tagged messages'\
>  \"References:\" headers"
> #--


It seems cumbersome to pipe all those commands to cat separately.
Could formail be called more directly?

Thanks
Martin

PS: otherwise your script works just perfectly!

Reply via email to