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

Re: macro for mailman moderation?



* On 2005.09.20, in <20050920192701.GI13423@xxxxxxxxxxxxxxxxxxxxxxx>,
*       "Will Yardley" <mutt-users@xxxxxxxxxxxxxxxxx> wrote:
> Right - that's what I do. The problem (w/ writing a macro) is that it's
> the last messaage/rfc822 attachment - I think in most cases, it's the
> second, so I guess I could search twice.

<last-entry>
<search-reverse>

:)


> What I'm most confused about is how to do the editor thing. I tried "set
> editor=builtin<enter><reply>.<enter>

If you're looking for full automation, that's always tedious.  I think
the suggestion is almost always to write a script that performs the
edits you want (i.e., the moderation task) and saves the file back to
the location it was read from.

If you don't need to make changes in the draft message, then that can be
as simple as sleeping one second, then touching the file.

I'm afraid I know little about the built-in editor.



> Also, is there an easy way to reset my editor back without having to put
> the same thing as the contents of "set editor"?

Traditionally, not really.  This is one of the reasons my muttrc is
processed by m4....

This is serious hack territory, but you could:

- create multiple scripts that do all your editing tasks, including one
  that just runs your editor with suitable arguments;
- use <shell-escape> to rewrite a symlink to choose which script you want
  to be your editor;
- set $editor to that symlink, and leave it that way.

It's no simpler in the long run, but at least there's only one place
that contains your preferred editor configuration.


Probably, with one of the setenv patches applied to a recent CVS mutt,
you could assign your $editor to an environment variable, then pull it
back out later.  Michael Elkins has a setenv patch, I think.  I don't
recall its merits, though I seem to recall that it had some.  I have one
at http://home.uchicago.edu/~dgc/sw/mutt/patch-1.5.8.dgc.setenv.1 .

-- 
 -D.    dgc@xxxxxxxxxxxx        NSIT    University of Chicago