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

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

Re: compiling in C mode and the compilation buffer


From: Benjamin Rutt
Subject: Re: compiling in C mode and the compilation buffer
Date: Wed, 28 Jul 2004 17:41:18 -0400
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Shug Boabie <address@hidden> writes:

> if this function were made more advanced... like parsing the whole output,
> it would allow warning detection AND also auto jump-to the first line of
> warnings/errors that the compile command produces. but thats an exercise
> for the more confident elisp user :-)

I can't help with the warning detection, but at least the following
version will teleport you to the error line (I personally hated this
when I had it this way though):

(defun my-compilation-finish-function-standard (buf str)
  ;; avoid doing this for buffers created from M-x grep
  (when (string-match "*compilation.*" (buffer-name buf))
    (if (string-match "exited abnormally" str)

        ;;there were errors
        (progn
          (message "compilation errors, press C-x ` to visit")
          (next-error 1))

      ;;no errors, make the compilation window go away
      (run-at-time 0.5 nil 'delete-windows-on buf)
      (message "NO COMPILATION ERRORS!"))))
-- 
Benjamin Rutt


reply via email to

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