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

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

Re: automatically decompiling a class file from jar.


From: Kevin Rodgers
Subject: Re: automatically decompiling a class file from jar.
Date: Mon, 06 Oct 2003 11:31:10 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

jdijkmeijer wrote:

    ;; 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)))))))


Slightly cleaner:
(add-hook 'find-file-hooks
          (lambda ()
            (when (equal (file-name-extension buffer-file-name) "class")
              (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?


What is the value of buffer-file-name when you open a class file from a jar?

--
Kevin Rodgers



reply via email to

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