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

replacing <reply> with <save><reply> (was: save-message from a reply-hook)



Thanks for your time and interest!

also sprach Rado S <list-rado@xxxxxx> [2007.08.04.1345 +0200]:
> c) In that case you could aswell use a macro to replace "reply" with
> "<save-message>...<enter><reply>"

I have tried this now and it would do the work, but I am still one
step short from happiness. Right now I have the following macro for
list-reply:

  ":set my_resolve=$resolve<enter>:unset resolve<enter>
   <save-message>=store<enter>
   :set resolve=$my_resolve<enter>
   <list-reply>"

The problem with this is that the message is filed even if I don't
actually reply then (if the machine crashes or I simply decide to
write later). Thus I tried:

  "<list-reply><save-message>=store<enter>"

but this has the problem that <save-message> is now executed in the
context of the compose view and thus tries to save the main
attachment to the mailbox, which is clearly not what I want.

I thus would like to achieve two things:

  1. only save the message when <list-reply> returns to the
     pager/index, but not if mutt says "Message not sent".

  2. execute <save-message> only after returning to the pager/index
     from where the macro was called.

> See http://WIKI.mutt.org/?MuttGuide -> /Syntax + /Actions (and all
> the rest, too ;), and also DebugConfig for clues about quoting and
> hooks.

I read up on those but have not really found an answer to either
question.

> > Short of rebinding the r/g/L reply keys to macros, can you think of
> > other approaches?
> 
> mbox-hook, fcc-hook.

fcc-hook is for sent mail. Once a mail is sent, it goes to =store
anyway. I don't need any distinctions and thus no hooks here.

mbox-hook doesn't square with my workflow since I may read a message
and then keep it in my inbox until it's dealt with.

Now, if mbox-hook would actually let me use mutt patterns and
I could say things like '~Q !~N' as a condition to move messages to
=store, then I'd have almost exactly what I want, except for the
rare cases when I'd 'exit' mutt or e.g. the ssh session die, so the
mbox-hook would never be executed. I think I could live with those.

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:"; net@madduck
 
"... (ethik und ästhetik sind eins.)"
                                                       -- wittgenstein
 
spamtraps: madduck.bogus@xxxxxxxxxxx

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)