On Fri, Jan 25, 2013 at 09:28:05AM -0500, Alan McConnell wrote:
> First, generically: I feel it is a source of difficulty that
> mutt relies on two config files, .muttrc and .mailcap.  Perhaps
> one of the experts could give us a short exposition of the
> use of each of these files, and what to do when they conflict.
> That would help me get my second, personal, issue resolved.

.muttrc is Mutt's configuration.  It is specific to Mutt.

.mailcap is a general-purpose configuration file for anything that
wants to know what you would like done with certain types of content.
Lots of other tools also use .mailcap and /etc/mailcap.

This is why they are separate.  One belongs to Mutt and the other
belongs to the world (including Mutt, which can use it).

> Second(personal issue):  I'm still having problems with
> getting my html-mail to open(in a new tab) in my browser,
> which is Firefox(Debianers call it iceweasel).  Often,
> when I use 'v' on an entry in my mutt display, and then
> Arrow down to "3 . . . . [text/html . . . .", and then
> press Enter, a new Tab does open in my browser, and I see
> the html-mail displayed nicely.  Even then I get, in my
> browser-Tab: "file:///home/alan/tmp/mutt.html", but there
> is no such file in my ~/tmp directory!
> 
> But, too often, I get a quick new tab, a tenth of a second
> look at the html I want to see, and then mutt "thinks better
> of it" and I get a screen:  
>    File not found  Iceweasel can't find the file at
>    /home/alan/tmp/mutt.html
> 
> The decision which way mutt will go between these two
> alternatives is, as far as I can see, quite arbitrary.

You probably need to add "; needsterminal" to your .mailcap entry for
"text/html" so that Mutt will ask you to hit a key when the external
program (Iceweasel) is finished.  For more on .mailcap and how Mutt
interprets it, see:

  http://www.mutt.org/doc/manual/manual-5.html

especially the section "Optional Fields".

Background:

This sounds like what is usually called a "race condition".  Two
processes are trying to use the same resource without sufficient
coordination.  Some times one process completes first, other times the
other completes first.  This causes differing behavior at different
times.

Here, I expect that Mutt is writing out that temporary file, invoking
Iceweasel, and then cleaning up the temporary file without concerning
itself with whether Iceweasel has had time to start itself and open
the file.  If Iceweasel already has the file open, then Mutt can
delete it now and it will go away when Iceweasel closes it.  Otherwise
Iceweasel goes to open the file it was told to show, and the file is
not there, because it was already deleted by Mutt.

There are at least two ways to cure a race.  The simple one is to get
one process to wait for the other to finish, or at least fully start.
The more complex (but preferred if it is not too difficult) way is to
have the processes tell each other how they're proceeding so that each
can make good decisions.  The simple way here is to get Mutt to wait
until you tell it to proceed.

-- 
Mark H. Wood, Lead System Programmer   mw...@iupui.edu
There's an app for that:  your browser

Attachment: pgpomO_goarDy.pgp
Description: PGP signature

Reply via email to