lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Lynx and metamail (was: Passing internal data to external handl


From: Klaus Weide
Subject: lynx-dev Lynx and metamail (was: Passing internal data to external handlers)
Date: Sun, 29 Nov 1998 22:15:15 -0600 (CST)

On Sun, 29 Nov 1998 address@hidden wrote:
> I've pondered doing something similar.  In particular, I'd like Lynx to
> invoke helper apps defined in .mailcap with the same environment variables
> provided by metamail.  A brief exploration of the code led me to believe
> that:
> 
> o The headers are traversed by a state machine which ignores what it
>   isn't interested in; there's no simple way to capture the complete
>   header text, which is one of the variables metamail places in the
>   environment.

You could modify HTMIME_put_character to save the incoming bytes, while
not in me->state == MIME_TRANSPARENT mode, into a HTChunk or similar
(in addition to parsing them, of course).  But you would probably want
to make at least line-ends canonical, maybe handle continuation lines.
Also, metamail expects mail headers, not HTTP headers, so this doesn't
seem very useful in general. (It's going to miss MIME-Version, for one 
thing.)

> o The alternative of piping the document to metamail itself isn't
>   easily achieved; again, Lynx discards the headers which metamail
>   expects, and passes only the body to the application.

This may give you some ideas:  put

    www/mime; less %s

in your mailcap file and see what happens.

> o Likewise "Lynx -source <URL> | metamail" discards the headers, and I
>   see no easy way to preserve them.

Try lynx -mime_header.

> o I haven't investigated EXTERNALS.  Is this a prospect for coupling
>   Lynx to metamail for all unsupported document types?  Again, the headers
>   would need to be preserved.

You could invoke a separate lynx process from EXTERNAL.

Rather than having full metamail behavior, I would be more interested in
having lynx parse the mailcap files as described in the metamail man page
(and probably the relevant RFC), with correct substitutions for %s, %t,
and %{...}.  They should also be substituted in the test string.  That
would mean that Lynx may have to run the tests many times, instead of
just once at startup.  (The newer libwww treats Presenters that way.)


   Klaus

reply via email to

[Prev in Thread] Current Thread [Next in Thread]