unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Hadron <hadronquark@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: code for closing compilation buffers
Date: Wed, 11 Jul 2007 16:08:50 +0200	[thread overview]
Message-ID: <87fy3v58y5.fsf@gmail.com> (raw)


I googled up some code and then modified it to use the more recent
compilation-finish-functions hook.

Could someone take a peek that I did the "if then else" part right.

If errors then jump to first error, else close the window. It *works* I
would just be grateful if someone could comment on whether its done
right:


(add-hook 'compilation-finish-functions
      (lambda (buf str)
        (if (string-match "exited abnormally" str) 
	    (next-error)
          ;;no errors, make the compilation window go away in a few seconds
          (run-at-time "2 sec" nil 'delete-windows-on (get-buffer-create "*compilation*"))
          (message "No Compilation Errors!")
	  )
	))

             reply	other threads:[~2007-07-11 14:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-11 14:08 Hadron [this message]
2007-07-16  1:34 ` code for closing compilation buffers Xu Weijiang
2007-07-16 15:34 ` J. David Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fy3v58y5.fsf@gmail.com \
    --to=hadronquark@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).