On 18Dec2014 16:50, Bernard Massot <bmas...@free.fr> wrote:
On Thu, Dec 11, 2014 at 04:44:12PM +0100, Joachim Saul wrote:
in one particular folder I collect messages for which I would like
to display the date in the index as UTC. In all other folders I
want to keep my local time zone.
Dates in the index are built following the index_format variable. For
this purpose, index_format uses the strftime function's string
expansion mechanism, which doesn't provide means to show time as UTC.
However the "date" program can build UTC dates, and mutt can use
external programs to build configuration variables.
[... skip Bernard's shell escape solution ...]

strftime can be told to work entirely in UTC, though, but it requires setting the environment variables that indicate your timezone.

Since mutt itself provides no direct mechanism to do that, you can't do it in a folder-hook as such. However, you can do it in a wrapper script which tweaks things and then invokes mutt.

As it happens I pretty much never switch folders within mutt; I always fire up mutt form the shell via a wrapper script (named "+", so "+ mutt" for example). This means I could set my timezone to UTC in the wrapper script for specific folders. Note that a sifde effect of that would be that _all_ programs invoked from within that mutt instance would work in UTC by default. Not necessarily what you want; your call there.

_If_ you went that way (for the index performance; as Bernard points out his approach invokes an outside script for every index line - though probably only for every _displayed_ index line, not the whole mail folder at once), _and_ you wanted to keep your "stay in mutt and switch folders there" current practice, it would be possible to write a macro setting 'c' (<change-folder>?) to something that ran a "submutt" as a command and end exited the current one, allowing you to use a wrapper script for the switch.

Just a thought.

Cheers,
Cameron Simpson <c...@zip.com.au>

quantum-dot anti-counterfeiting
- overhead by WIRED at the Intelligent Printing conference Oct2006

Reply via email to