From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: step Newsgroups: gmane.emacs.help Subject: Re: help with makefile command line Date: Thu, 27 Mar 2008 08:36:15 -0700 (PDT) Organization: http://groups.google.com Message-ID: <691c0113-1c66-45e2-a88d-9a429d94f9c0@s12g2000prg.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1206664963 22200 80.91.229.12 (28 Mar 2008 00:42:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Mar 2008 00:42:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 28 01:43:14 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jf2ga-0002Od-7E for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2008 01:43:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jf2fy-0002yQ-Hy for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Mar 2008 20:42:34 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s12g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: 125.122.53.134 Original-X-Trace: posting.google.com 1206632175 31925 127.0.0.1 (27 Mar 2008 15:36:15 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 27 Mar 2008 15:36:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s12g2000prg.googlegroups.com; posting-host=125.122.53.134; posting-account=36-j9AoAAAC2cBASboXsNT86-OhbxFJB User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.8.1.3) Gecko/20070310 Iceweasel/2.0.0.3 (Debian-2.0.0.3-1), gzip(gfe), gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:157375 X-Mailman-Approved-At: Thu, 27 Mar 2008 20:35:23 -0400 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52757 Archived-At: On 3=D4=C225=C8=D5, =CF=C2=CE=E79=CA=B109=B7=D6, "Balaji V. Iyer" wrote: > Hello Everyone, > I use the compile option extenstively in emacs. When I type "M-x > compile" the default line is "make -k" Many times I do not have a make > file thus I would lke the default line to be > > "gcc -ansi -O4 -Wall " > > How do I do this? > > I tried the following command but it doesn't seem to work (If anyone > have a better idea please let me know). > > (function > (lambda () > (unless (or (file-exists-p "makefile") > (file-exists-p "Makefile")) > (setq compile-command > (concat "gcc -Wall -O3 -o" > (file-name-sans-extension (file-name-nondirectory > buffer-file -name)) > " " > (file-name-nondirectory buffer-file-name)))))) > > Any help is greatly appreciated. > > Thanks, > > -- > > Balaji V. Iyer > PhD Student, > Center for Efficient, Scalable and Reliable Computing, > Department of Electrical and Computer Engineering, > North Carolina State University. why don't use the smart-compile.el for emacs=A3=BF