[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev Lynx vs. metamail
From: |
pg |
Subject: |
lynx-dev Lynx vs. metamail |
Date: |
Sat, 8 Aug 1998 16:22:38 -0600 (MDT) |
Hello, Lyncei,
The recent discussion of lynx's handling of temp-files provokes me
to wonder whether lynx might benefit by using metamail as a generic
external viewer. The arguments I see:
1) Modularity. Metamail has done the work; why should lynx
duplicate the effort. This may be offset by a continuing
need to process the .mailcap file in lynx because either
some sites may not have access to metamail or metamail's
handling of unknown types may not be suitable for lynx's
purposes.
2) Consistency. Lynx's interpretation of .mailcap semantics
don't always perfectly match metamail's; sometimes lynx
selects a different viewer from what metamail would choose
with the same MIME headers. So I carefully tune my
.mailcap file to produce the desired results with both
elm and tin (which use metamail), only to find that lynx
selects quite a different viewer. I believe that any
effort one might be tempted to spend duplicating
metamail's semantics in lynx would better be spent creating
an interface from lynx to metamail.
3) Function: pipes. Metamail, if no "%s" substitution sequence
appears in the command, pipes the file to the viewer. This
might in some cases alleviate the temp space problems recently
discussed here. Lynx, if it finds no "%s" merely fails.
4) Function: headers. When metamail invokes a viewer it sets
several environment variables to contain the complete set
of headers plus the most useful headers parsed out. I
exploit this facility in some of my viewers. In particular,
most of my "viewers" are actually downloaders which
retrieve the original filename from variables that
metamail sets. Lynx fails to provide this facility for
me.
I looked into this attempting to do this a while ago. I
might either set the same environment variables
in lynx that metamail would set, or call metamail
itself to invoke the viewer. The obstacle that I found to
either approach was in lynx's header parsing. Apparently
the headers are never available intact, either to set in
environment variables for a viewer or to pass to metamail
which requires them (of course). Rather, the parser
calls one or more get character routines from many places;
I see no single place where I could readily insert code
to accumulate the headers.
But I might yet try again, especially if someone can
help me with some advice. Does anyone know a good
place where I might capture the MIME headers and save
them, either in a memory buffer or in a file to pass
to metamail or a viewer?
Thanks,
gil