On 13-Jan-2002 18:49 David T-G wrote: | | I take it you want to be sure that the dates are accurate and not from | startup, right? This is a common problem for headers and such (good old | uptime) and the answer is usually to put the parsed half in single quotes | to prevent mutt from executing the innards until the hook is called. | I should think that that would work for you, too, and would be a lot | easier to maintain than your patch. Of course, it's not as cool... :-)
Yes, I do keep mutt running for days at a time. Based on my perusal of the code, the mbox-hook hooks are "loaded" once at run-time, and ``-enclosed strings/commands are executed at that time. What you propose is quoting these ``-enclosed strings/commands in the hopes of deferring their execution to when they are resolved (through use). This _might_ be true for other hooks -- and I think it is for {folder,message,account}-hook -- but mx_close_mailbox() does not treat the hook entry this way; it is expanded as a path and doesn't allow any back tick tricks. Even if you could defer them, they would only be resolved when you closed the mailbox. Cases would still exist where the behaviour I want is not exhibited. For example, if I'm reading messages that have arrived shortly before midnight on 31 January and additional messages arrive after midnight, then closing the mailbox would result in messages stored based on the 1 February date. This example assumes you want to store messages in folders where the smallest unit of time is month. Smaller units of time will increase the likelihood of temporal boundary issues. Okay, that was a long-winded way of disagreeing with your suggestion. The short one goes like this: I'm very confident that the mbox-hook command won't allow back tick deferrals by quoting them as you propose. That being said, printf-style sequences might be useful for more than solving my trivial problems. Of course, other than perhaps message score, I really can't think of any other uses, but at least my problem is solved. ;) -- -Dale