Can the 'compilation-old-error-list' or 'compilation-error-list' variables
be used to detect presence or absense of error messages in the compilation
buffer instead of string-match in the code below ?

Here are the doc strings for the variables -

compilation-old-error-list's value is nil

Documentation:
Value of `compilation-error-list' after errors were parsed.

Defined in `compile'.

compilation-error-list's value is nil

Documentation:
List of error message descriptors for visiting erring functions.
Each error descriptor is a cons (or nil).  Its car is a marker pointing to
an error message.  If its cdr is a marker, it points to the text of the
line the message is about.  If its cdr is a cons, it is a list
((DIRECTORY . FILE) LINE [COLUMN]).  Or its cdr may be nil if that
error is not interesting.

The value may be t instead of a list; this means that the buffer of
error messages should be reparsed the next time the list of errors is
wanted.

Some other commands (like `diff') use this list to control the error
message tracking facilities; if you change its structure, you should make
sure you also change those packages.  Perhaps it is better not to change
it at all.

Defined in `compile'.

regards,
sandip

--
Sandip V. Chitale                               181, Metro Drive
Principal Software Engineer             San Jose, CA 95110, USA
work:  (408) 535 1791                   Suite 600
email: [EMAIL PROTECTED]      web: http://www.fairisaac.com

Original message:
-----------------

I added this to my .emacs ... It displays the compile buffer for a few
seconds, but if there are no errors removes the compile buffer.


(defun my-jde-compile-fin-hook (buf str)
  " Removes the jde-compile window after a few seconds if no errors "
  (if (null (or (string-match ".*exited abnormally.*" str) 
                (string-match ".*BUILD FAILED.*" str)))
      ;;no errors, make the compilation window go away in a few seconds
      (progn
        (run-at-time
         "2 sec" nil 'delete-windows-on
         (get-buffer-create "*compilation*"))
        (message "No compilation errors"))
    ;;there were errors, so jump to the first error
    (next-error)))



Add the method to "jde-compile-finish-hook".

(jde-compile-finish-hook (quote (jde-compile-finish-refresh-speedbar
jde-compile-finish-flush-completion-cache my-jde-compile-fin-hook)))

Reply via email to