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

Re: detect from mailcap whether called for view or reply



On 30Jan2009 15:19, Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx> wrote:
| On Friday, January 30 at 04:15 PM, quoth Aron Griffis:
| >I guess the answer is, "Nobody on the mutt-users list can think
| >of a way to do this."  Right? ;-)
| 
| Right. There's nothing inherent in the mailcap mechanism that you can 
| use for this. The closest you may be able to get is to find a way to 
| make mutt export some environment variables so that you can make your 
| dumptext program detect what's going on. But that'll require some 
| hand-coding on your part, there's nothing I know of that's built in.

You could get your reply keystroke macro to set some state before commencing
the reply, for example. Untested (and this hould be one line):

  macro index,pager r '<shell-escape>touch 
$HOME/var/flag/80-cols<enter><reply><shell-escape>rm -f 
$HOME/var/flag/80-cols<enter>'

Ugly, and as written won't work for concurrent mutts or anything.
But you get the idea - set a flag as a filesystem entry, clear it later.

I was all set up to suggest a message-hook or tweaking $editor, but the
former fires for both reply/forward _and_ display and the latter happens
too late:-(

This woud be a lot slicker if mutt had a setenv/unsetenv command.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

The US government can't make a penny for a penny.  How can we make  RFID
tags for a penny?
- overhead by WIRED at the Intelligent Printing conference Oct2006