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

Re: simulating "Aborted unmodified message" condition



On 2006-09-11, William Yardley <mutt-users@xxxxxxxxxxxxxxxxx> wrote:
> On Mon, Sep 11, 2006 at 02:38:31PM -0700, Gary Johnson wrote:
> > On 2006-09-11, William Yardley <mutt-users@xxxxxxxxxxxxxxxxx> wrote:
> 
> > > I was wondering if there's an easy way to simulate the condition for
> > > "Aborted unmodified message" within a shell or perl script. 
> > > 
> > > I have a perl script that I use for moderating a mailman list (something
> > > like: http://veggiechinese.net/mutt_mailman_approve.txt), and I want to
> > > be able to 
> > > 
> > > (from send.c)
> > > if (mtime == st.st_mtime && !msg->content->next &&
> > >      query_quadoption (OPT_ABORT, _("Abort unmodified message?"))
> > > 
> > > Simply removing the message-file doesn't seem to work...
> > > 
> > > Any good examples that do something similar, or gentle pointers in the
> > > right direction would be appreciated.
> > > 
> > > I'm thinking that just writing a patch for mutt might be easier, since
> > > the macro approach is less than graceful if the macro fails in the
> > > middle. There isn't any way to make the whole macro process fail if one
> > > component exits, is there?
> > 
> >     :set editor="true"
> > 
> > Is that what you had in mind?
> 
> No, because I already have to set editor to be my script. I want to make
> it fail after opening the message with my "editor".

I don't really understand what you're trying to do.  If you want 
that message, then the modification time of the message file when 
your script ends needs to be the same as the modification time when 
mutt wrote the file.  So your script needs to either not modify the 
file, or to restore the original modification time.

Regards,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA