This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Quick Emacs hack


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]