From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Shug Boabie Newsgroups: gmane.emacs.help Subject: Re: compiling in C mode and the compilation buffer Date: Wed, 28 Jul 2004 01:40:05 +0000 (UTC) Organization: BT Openworld Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <20040728023945.2d3d1697@localhost> References: <20040724233448.3eab8cfa@localhost> <878yd766ol.fsf@osu.edu> <20040728022342.1a999383@localhost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1090978926 18106 80.91.224.253 (28 Jul 2004 01:42:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Jul 2004 01:42:06 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 28 03:42:02 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BpdSE-0007TQ-00 for ; Wed, 28 Jul 2004 03:42:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BpdVL-00055H-Le for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Jul 2004 21:45:15 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!feed.news.tiscali.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.stueberl.de!newsr1.ipcore.viaginterkom.de!news-peer1!btnet-feed5!btnet!news.btopenworld.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: host217-42-154-36.range217-42.btcentralplus.com Original-X-Trace: sparta.btinternet.com 1090978805 11075 217.42.154.36 (28 Jul 2004 01:40:05 GMT) Original-X-Complaints-To: news-complaints@lists.btinternet.com Original-NNTP-Posting-Date: Wed, 28 Jul 2004 01:40:05 +0000 (UTC) X-Newsreader: Sylpheed-Claws 0.9.12 (GTK+ 1.2.10; powerpc-unknown-linux-gnu) Original-Xref: shelby.stanford.edu gnu.emacs.help:124514 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:19849 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19849 Shug Boabie wrote: > excellent, however i would still like the window to remain open upon > detection of warnings as well [in order to force me to write ISO C99 code > :-)]. i use the compile command exclusively for C code, so a grep for > "warning:" should be sufficient. however, my attempts to customise your > function have failed. any further hints? for the record, here is what i have been trying to do, but it is not working: (defun sam-compile (buf str) (when (string-match "*compilation.*" (buffer-name buf)) (if (string-match "exited abnormally" str) (progn (message "compilation errors, press C-x ` to view")) (if (string-match "warning:" str) (progn (message "compilation warnings, press C-x ` to view")) (run-at-time 0.5 nil 'delete-windows-on buf) (message "no compile errors or warnings"))))) i have tried to do if (grep==error) error else if (grep==warning) warning else everything ok but my elisp is not the best