This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Quick Emacs hack
- To: Java Discuss List <java-discuss at sourceware dot cygnus dot com>
- Subject: Quick Emacs hack
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 03 Feb 2000 12:11:37 -0700
- Reply-To: tromey at cygnus dot com
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