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

Re: [issue] mailbox is not saved upon signal recv (esp. SIGHUP)




Hi David,

> * On 2005.01.27, in <20050127183026.GG8391@xxxxxxxxxxxxxxxxxxxxxxxx>,
> *     "Tomas Telensky" <tomas@xxxxxxxxx> wrote:
> > 
> > I actually think mutt shall allow to save the mailbox upon signal exiting,
> > especially for SIGHUP. There could be a configuration option for it.
> 
> I'm not sure about this as a required behavior, and others have spoken
> against it in the past. Generally they vehemently recommend using
> "screen". However...

Well, not only screen users, but also ssh users. The way how me and my
friends use mutt is that we logon to server from different places (work,
home...) using ssh and read mails. It often happens that the connection is
lost. Or, you are at home and you already have one mutt running from work -
so you must kill it. And we are here! :-)

If it's not required, you can always set default to "No", however .....

> 
> 
> > Or, there could be a setting which function which could be called upon
> > exiting, and the user could set "sync-mailbox" fuction for it. (Don't know
> 
> ... I do like the idea of an exit-hook (or quit-hook, if you prefer),
> and coding mutt to call exit-hook on SIGHUP seems fair to me. It would
> also be an easy configuration option to make this behavior optional.
> It's a way to provide this feature with existing tools.

... if you like this more, than why not?

OK, if anybody starts to make a patch for it, please let me know. Otherwise,
when my patience times out, I'll do it when I have time ;-)

> 
> 
> > whether mutt allows to group functions together into custom functions, in
> > that case it would be useful).
> 
> Macros?

Unfortunatelly, macros are not that case. Macros has to be used in a tricky
way to achieve the effect I'd like to have, e.g.:

macro index \Cxt :set<space>sort=threads<enter>
macro index \Cxd :set<space>sort=date-received<enter>

Pretty tricky ;-))

It would be nice to define function
set_thread_sort { set sort=threads }
and then bind a key for it.

Then you could do also
my_func { sync-mailbox ; other-func ; quit }
And set the exit-hook to my_func... 

That's what I meant with that note.

        Tomas