From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hadron Newsgroups: gmane.emacs.help Subject: Re: help with c-mode-common-hook Date: Thu, 03 May 2007 02:24:14 +0200 Message-ID: <87y7k6rbyp.fsf@gmail.com> References: <87vefb3y2e.fsf@gmail.com> <1178130129.512841.259390@y5g2000hsa.googlegroups.com> <87647b3wdu.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1178152436 30318 80.91.229.12 (3 May 2007 00:33:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 3 May 2007 00:33:56 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 03 02:33:55 2007 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 1HjPGb-0003xG-EU for geh-help-gnu-emacs@m.gmane.org; Thu, 03 May 2007 02:33:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HjPN3-0004xv-AO for geh-help-gnu-emacs@m.gmane.org; Wed, 02 May 2007 20:40:33 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-X-Trace: individual.net xA3xVcWHcD4ZZOMigm+IGAWPcgy/cJMpTwcgwDxSo3hVFtzCC8 X-Orig-Path: news.individual.net!news User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.99 (gnu/linux) X-Face: 2h#||Cd#d%F*NCm59[_6/{1a@jy%; |j>{D~4^gKg(^i%7j0IK?+,/GmW&:CD5fEKb_! Cancel-Lock: sha1:kCXXiyQSp2R1rxbh2L3AtRtInvw= Original-Xref: shelby.stanford.edu gnu.emacs.help:147958 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:43560 Archived-At: Hadron writes: > Robert Thorpe writes: > >> On May 2, 7:00 pm, Hadron wrote: >>> I put "message" calls in so I know the functions are calling each other >>> but for some reason the compile command is staying at the default "make >>> -k" even if there is no makefile in the c files directory. What have I >>> broken? It used to work. Or something similar used to work.... >> >> You're going to have to describe the problem more. The code you've >> shown doesn't change the command "M-x compile" as far as I can see. > > It doesnt. It changes the compile-command variable. AFAIK - I am not a > lisp programmer. > >> >> Are the messages you put in seen? >> > > Yes - I mentioned that I think. To answer (or provide a solution) my own issue, it works now. I simply added the my-compile extract directly as a c-mode-hook e.g ,---- | (add-hook 'c-mode-common-hook | (lambda () | (unless (or (file-exists-p "makefile") | (file-exists-p "Makefile")) | (set (make-local-variable 'compile-command) | ;; $(CC) -c -o $@ $(GTKFLAGS) $(CPPFLAGS) $(CFLAGS) $< | (let ((file (file-name-nondirectory buffer-file-name))) | (format "%s -o %s %s %s %s %s" | (or (getenv "CC") "gcc") | (file-name-sans-extension file) | (or (getenv "GTKFLAGS") "") | (or (getenv "CPPFLAGS")"-DDEBUG=9") | (or (getenv "CFLAGS") "-std=c99 -pedantic -Wall -Werror -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -g") | file))))) | ) `---- Which suggests something strange with make-local-variable?