Re: save-message to ? and then sync the folder
* On 2008.11.27, in <20081127132013.GA17151@dracona>,
* "trance202@xxxxxx" <trance202@xxxxxx> wrote:
>
> Hello
>
> how can I sync the mailbox after save a message to any folder like this:
>
> macro s "<save-message>?"
>
> the above works great, but after this save mutt should sync
> automatically. Like this:
>
> macro s "<save-message>?<sync-mailbox>"
This works for me.
macro index S '<enter-command>set my_folder=`mutt-prompt "Save to folder" \\`;
push <refresh><save-message>$my_folder\<enter\><sync-mailbox><enter>'
Be sure to enter it in only one line. The backslashes are wacky, but so
are mutt's quoting rules. This is no typo; it really does work on my
system.
A "mutt-prompt" script is required; see attachment.
--
-D. dgc@xxxxxxxxxxxx NSIT University of Chicago
#!/bin/sh
##
## usage: mutt-prompt "prompt text"
##
## In muttrc:
## set my_var=`mutt-prompt "Folder"`
##
# save current tty state
s=`stty -g`
# redirect default i/o, saving current stdout in fd 5
exec 5>&1
exec >/dev/tty </dev/tty
# reset tty state
stty icanon sane onlcr
# position cursor at bottom of screen
rows=`tput lines`
rows=`expr $rows - 1`
tput cup $rows 0
# print prompt and read response
printf "${1}: "
read answer
# return response to mutt
echo "$answer" >&5
# reset tty state
stty "$s"