From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "jdijkmeijer" Newsgroups: gmane.emacs.help Subject: automatically decompiling a class file from jar. Date: Sat, 4 Oct 2003 12:41:03 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3f7ea2bb$0$58703$e4fe514c@news.xs4all.nl> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1065264406 13861 80.91.224.253 (4 Oct 2003 10:46:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 4 Oct 2003 10:46:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 04 12:46:44 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A5jvw-0001i2-00 for ; Sat, 04 Oct 2003 12:46:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A5jvT-0003Xg-M5 for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Oct 2003 06:46:15 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!transit.news.xs4all.nl!not-for-mail Original-Newsgroups: gnu.emacs.help X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Original-Lines: 29 Original-NNTP-Posting-Date: 04 Oct 2003 12:36:43 CEST Original-NNTP-Posting-Host: 194.109.233.136 Original-X-Trace: 1065263803 news.xs4all.nl 58703 194.109.233.136:2036 Original-X-Complaints-To: abuse@xs4all.nl Original-Xref: shelby.stanford.edu gnu.emacs.help:117056 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12985 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12985 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.