Hi,

I need some feedback on how the JDEE should support w3m, the text-mode
browser that, when used with the emacs-w3m package, enables Emacs to
render HTML in a buffer.

First, some background. The current version of the JDEE uses the
Emacs lisp function browse-url to display HTML documentation, e.g.,
Javadoc for the class at point and the JDEE user's guide. browse-url
in turn uses the function specified by the customization variable
browse-url-browser-function to display HTML. On Windows, this variable
is set to browse-url-default-windows-browser which uses the Windows
default browser, which is Internet Exploer by default. On Unix,
browse-url-browser-function is browse-url-default-browser, which
searches for the presence of one of a predetermined list of browsers
(gnome, Mozilla, Galeon, Netscape, etc.) and uses the first that it finds.

The JDEE does not display Javadoc pages directly. Instead, it creates
an intermediate  HTML file on the fly, name jde_meta.html. This URL-transfer
file causes the browser to load the target page. The original reason
for doing this was to work around a bug in the Emacs windows
implementation of browse-url-default-windows-browser that caused Emacs
to fail to forward the anchor portion of an HTML address. Later, the
intermediate file approach was used to implement display of the
multiframe view for displaying Javadoc.

Currently it is possible for you to configure the JDEE to use the w3m
browser simply by setting browse-url-browser-function to 
w3m-browse-url. However, there are problems with this approach:

  1. There seems to be a bug in the w3m implementation of URL
     forwarding on Windows. At least, the forwarding does not
     work in the latest version of emacs-w3m.el installed on
     my machine. As a result, when you ask the JDEE to display
     Javadoc for the symbol at point, the jde_meta.html, file
     appears in the buffer, with the link to the target page
     highlighted. You need to click the link to display the 
     target page.

  2. Users have reported that the Unix version of w3m cannot
     handle the URL format that the JDEE uses for Javadoc files
     stored on the local system.

  3. w3m is incapable of rendering the JDEE User's Guide because
     it uses an applet to display its TOC.

Several days ago I submitted a fix to CVS for problem 1. That fix
uses the intermediate file only if browse-url-browser-function
is set to browse-url-default-windows-browser, i.e., Internet Explorer.
The problem with that fix is that it disables the frames mode
display for all other browsers. As I happen to like the frames
mode display, I intend to back this fix out of CVS.

So now the problem is to find an easy-to-use fix for all three
problems. My inclination is to add a JDEE customization variable,
jde-help-browser-function, that would allow you to choose:

   * browse-url (default)
   * w3m-browse-url 
   * other

If you choose w3m browse-url, the JDEE will pass the target URL to
w3m-browse-url. In the other cases, it will pass the URL of the
URL-transfer file to the browser, causing the browser to load the
target file in frames or non-frame mode depending on the setting of
jde-help-use-frames. Regardless of the setting of
jde-help-browser-function, the JDEE would use
browse-url-default-windows-browser or browse-url-default-browser to
display the JDEE User's Guide.

Does this approach seem reasonable? Is there an easier way to
handle these problems?

I'd also appreciate it if someone who is using w3m on Unix would
take a look at the URL that the JDEE generates for local files and
tell me what's wrong with it and what URL would be acceptable
to w3m.


Paul



Reply via email to