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

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

Re: hooking jode to emacs


From: kgold
Subject: Re: hooking jode to emacs
Date: 22 Dec 2003 14:47:32 GMT

Kevin Rodgers <ihs_4664@yahoo.com> writes:
> 
> It works the same way as file-name-extension, which you use.  What happens if
> you just replace the reference to file in (shell-command ...) with
> (file-name-sans-extension file)?

Thanks.  The below worked.  It turns out that jode also wants the file
name without the directory path.

Two more (since emacs can do anything)

- How can I automatically set the resulting *Shell Command Output*
  buffer to java-mode.  M-x java-mode works interactively.

  My attempts at variations of this didn't work.

        (execute-extended-command 'java-mode)

- The author of jode sends two lines (his name and email address, and
  the name of the class file) to stdout.  How can I trim these two
  lines out of the buffer?

~~~~~~~~~~~~~~~~~~

(defun decompile-class-file (&optional file)
   "Run `class-file-decompile-command' on FILE, but only if it's a .class file.
 If FILE is nil, run it on `buffer-file-name'."
   (interactive "fFile: ")
   (or file (setq file buffer-file-name))
   (and (equal (file-name-extension file) "class")
        (shell-command (concat class-file-decompile-command " " 
                               (file-name-nondirectory 
(file-name-sans-extension file))))))

-- 


reply via email to

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