proper .emacs for gcc code?

Tom Tromey
Mon Feb 25 07:55:00 GMT 2002

>>>>> "Andrew" == Andrew Haley <> writes:

Andrew> 	       (c-set-style "gnu")

Yeah, I set this elsewhere I think.

Also here's a function I use when hacking libgcj or Classpath.  It
lets you jump from a standard class' buffer to its online
documentation.  It also works if you're editing a (actually most but
not all) nat*.cc file in libgcj.

I think I posted an older version of this a few years ago.

With the Emacs I use there isn't an easy way to dig out the current
method's name (so ChangeLogs don't work quite right, bleah), so this
code only does the class and doesn't take you right to the method

(defun tjt-java-class-help ()
  "Get help on the current Java class."
  (let ((found nil))
    ;; Use initial `.*' to suck up as much leading text as possible.
     ((string-match "^.*\\(libjava\\|classpath\\)/\\(.*\\)\\.java$"
      (setq found
	    (substring buffer-file-name (match-beginning 2) (match-end 2))))
     ((string-match "^.*libjava/\\(.*\\)/nat\\(.*\\)\\.cc$"
      (setq found
	    (concat (substring buffer-file-name (match-beginning 1)
			       (match-end 1))
		    (substring buffer-file-name (match-beginning 2)
			       (match-end 2))))))
    (if found
	(funcall browse-url-browser-function
      (message "Doesn't look like Java buffer"))))


More information about the Java mailing list