In message <[EMAIL PROTECTED]>, Paul Kinnucan w
rites:
: At 04:23 PM 6/16/00 -0700, you wrote:
: >
: >I would really like to customize JDE in the following way:
: >At present, the jde-compile command creates a compilation buffer and fills
: >it with the output of the compile command.  I would instead like
: >jde-compile to create a compilation buffer only if error/warning messages
: >are returned by the compiler.  If no errors/warnings are produced the
: >only visible result should be a message printed in the minibuffer saying
: >something like "Compilation succesful", or "Compiling... done".
: >
: >I have been through the FAQ and user guide trying to find a way to do
: >this, to no avail.  I'd implement it myself, but unfortunately I am not
: >yet a lisp programmer.
: >
: >Is there a way to do this that I am missing?
: >
: 
: No. It would require a fair amount of research and coding to implement.
: Perhaps someone else may be interested in undertaking to create such an
: option. If so, I'd be happy to incorporate it into the JDE.

Here's a half-baked attempt - suggestions from better lisp programmers
welcome:

Compilation mode has a customizable variable "compilation-finish-function."
Install the following defun and set compilation-finish-function to it.
Note: if you use multiple emacs windows, this will almost certainly *not*
do what you want it to do.  Caveat programmer!

Tested only on linux + xemacs, and not very extensively at that.

(defun half-baked-compilation-finish-function
  (buffer mesg)
  "When compilation terminates with successfully, switch back to the
other buffer, kill the compilation buffer, and delete all other windows.
You will *not* like this if you're using multiple windows, so don't
bother trying it if that's how you work."
  (if (string= mesg "finished\n")
      (progn
        (other-window 1)
        (delete-other-windows)
        (kill-buffer "*compilation*")
        (message "Compilation finished OK")
        )
    (message "Compilation errors")))

Eric

Reply via email to