Quick Emacs hack

Tom Tromey tromey@cygnus.com
Sat Apr 1 00:00:00 GMT 2000


Anthony suggested I send this to the list.  I use this bit of Emacs
code to pull up the JDK docs corresponding to whatever class I happen
to be working on at the moment.

(defun tjt-java-class-help ()
  "Get help on the current Java class."
  (interactive)
  (string-match "libjava/\\(.*\\)\\.java$" buffer-file-name)
  (funcall browse-url-browser-function
	   (concat
	    " http://java.sun.com/products/jdk/1.2/docs/api/ "
	    (substring buffer-file-name (match-beginning 1) (match-end 1))
	    ".html")))

It would be possible to go directly to the appropriate function, if
java-mode had a way to find the current function's name.  I don't
think it does (or else add-change-log-entry would work).

Tom


More information about the Java mailing list