help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

automatically decompiling a class file from jar.


From: jdijkmeijer
Subject: automatically decompiling a class file from jar.
Date: Sat, 4 Oct 2003 12:41:03 +0200

Hi I thought it would be nice to automatically decompile a class file when
opening it from a jar. I already found decompile.el and that works fine on
class files loaded from a directory.
It's been a while since I wrote my last lisp program, and anyway I have
never been a real Lisp programmer but...
Looking into decompile.el I found an add-hook

    ;; a hook to be able to automatically decompile-find-file .class files
    (add-hook
     'find-file-hooks
     (lambda ()
       (let ((file (buffer-file-name)))
         (cond ((and file (string= (substring file -6) ".class"))
                (progn (jdc-buffer) (jde-mode)))))))

Which i deducted to be responsible for running the jad command on the file
to be opened. Now I wonder how difficult (or easy) is it to provide a hook
for opening a class file from a jar?
Going further into this, dreaming of some more really kewl emacs features It
would be really, really, really nice if you than could make changes to this
decompiled java file, compile it and place it back updated and compiled in
the jar file.
Of course classpath issues are lurking round the corner but...
Anyway lets stop dreaming, and back to some coding (yes on a Saturday
afternoon).
kind regards.
Jeroen.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]