This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
some handy emacs code
- From: Tom Tromey <tromey at redhat dot com>
- To: GCJ mailing list <java at gcc dot gnu dot org>
- Date: 06 Aug 2003 14:11:00 -0600
- Subject: some handy emacs code
- Reply-to: tromey at redhat dot com
For those of you using Emacs, here's some handy code I wrote for
looking inside .jar files.
Put this in .emacs, and then when visiting a .jar or .zip file, you
can use "?" to run jcf-dump on the class.
Tom
(defun tjt-view-class-file ()
(interactive)
(if (eq archive-subtype 'zip)
(let* ((descr (archive-get-descr))
(ename (aref descr 0))
(iname (aref descr 1))
;; strip ".class"
(class (substring iname 0 -6)))
(if (string-equal (substring iname -6) ".class")
(shell-command (concat "jcf-dump -c -I"
(buffer-file-name)
" "
class))))))
(add-hook 'archive-mode-hook
(function
(lambda ()
(define-key archive-mode-map "?" 'tjt-view-class-file))))