Suppose you have some HTML text in a buffer which is not visiting a
file, or embedded in another (non-html) file. In this case, the
functions "browse-url-of-buffer" and "browse-url-of-region" will
generate a temporary file and pass a file url to the browser of
choice.
In the case that that browser is W3, even if the file is a valid HTML
document, the source rather than formatted HTML is shown. This seems
to be happening because the temporary filename does not have a .html
extension. In Netscape, even without the .hmtl, a formatted document,
rather than source, is shown. Apparently Netscape sees the <html>
header and decides the document is HTML, regardless of file extension.
Kludging browse-url.el to append ".html" to the temporary file name
causes formatted HTML to be shown... however this kludge hardly seems
like the Right Thing.
But, I can't really see in this situation what the Right Thing would
be. Should "browse-url" look for a <html> or <HTML> tag in the
document and generate a temp file name with .html extension in this
case? Is this too crufty?
(PS. I noticed this trying to use a package called PyLibLookup; you
press a key and the Python Library documentation for the function at
point is shown in a web-browser, courtesy of browse-url. A subprocess
generates the html into a temporary buffer and calls
browse-url-of-buffer. Works great with Netscape, shows HTML source
when using W3).
Show replies by date