From: Xu Weijiang <wjxu@mail.ustc.edu.cn>
To: help-gnu-emacs@gnu.org
Subject: Re: code for closing compilation buffers
Date: Mon, 16 Jul 2007 09:34:42 +0800 [thread overview]
Message-ID: <u7ip1xhal.fsf@mail.ustc.edu.cn> (raw)
In-Reply-To: 87fy3v58y5.fsf@gmail.com
Hadron <hadronquark@gmail.com> writes:
> 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!")
> )
> ))
It works great, Thanks.
Best regards
Xu Weijiang
--
everything has its rules!
next prev parent reply other threads:[~2007-07-16 1:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-11 14:08 code for closing compilation buffers Hadron
2007-07-16 1:34 ` Xu Weijiang [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=u7ip1xhal.fsf@mail.ustc.edu.cn \
--to=wjxu@mail.ustc.edu.cn \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.