David T-G wrote:
> Steve --
>
> ...and then Steve Talley said...
>
> > If mutt has the ability to allow the user to edit a message, and
> > then automatically save it to the mail folder, and delete the
> > orignal, why shouldn't it be able to do the same with an arbitrary
> > shell script?
>
> It can -- just as you've defined it within your macro :-)
>
> Seriously, though, what's wrong with the macro? Once it's defined
> it's taken care of and you never have to look back at it. Is the
> idea of using a macro somehow distasteful, or something else? I
> really don't get it, so sell me on the idea.
The problem I see is that it can get a bit ugly.
Suppose my default $editor is something ridiculously long, like:
vi -o2 -e -b '+/^subject' '+s/^subject/SuBJeCt/i' '+/^$/'
Then I have to reset it in every macro:
macro index F :set editor="sleep 1; mailformat -m -t -s -c -q -i"<return>e:set
editor="vi -o2 -e -b +/^subject +s/^subject/SuBJeCt/i +/^$/"<return>
macro index G :set editor="sleep 1; grep -v blah"<return>e:set editor="vi -o2 -e
-b +/^subject +s/^subject/SuBJeCt/i +/^$/"<return>
...
And yes, I could probably change it to:
macro index F :set editor="sleep 1; mailformat -m -t -s -c -q -i"<return>e:source
~/.mutt/reseteditor<return>
macro index G :set editor="sleep 1; grep -v blah"<return>e:source
~/.mutt/reseteditor<return>
...
but that's just as ugly.
> If you had such a filter-message command, you'd still have to tell
> it what script to use for the filter, so you'd probably end up
> writing a macro anyway.
Yes, but the macros would be much simpler:
macro index F "<filter-message>mailformat -m -t -s -c -q -i\n"
macro index G "<filter-message>grep -v blah\n"
...
Thanks,
Steve