all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hadron <hadronquark@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: help with c-mode-common-hook
Date: Thu, 03 May 2007 02:24:14 +0200	[thread overview]
Message-ID: <87y7k6rbyp.fsf@gmail.com> (raw)
In-Reply-To: 87647b3wdu.fsf@gmail.com

Hadron <hadronquark@gmail.com> writes:

> Robert Thorpe <rthorpe@realworldtech.com> writes:
>
>> On May 2, 7:00 pm, Hadron <hadronqu...@gmail.com> 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?

  reply	other threads:[~2007-05-03  0:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-02 18:00 help with c-mode-common-hook Hadron
2007-05-02 18:22 ` Robert Thorpe
2007-05-02 18:37   ` Hadron
2007-05-03  0:24     ` Hadron [this message]
2007-05-03  6:26       ` Kevin Rodgers
     [not found]       ` <mailman.158.1178174006.32220.help-gnu-emacs@gnu.org>
2007-05-03 10:08         ` Hadron
2007-05-03 14:09           ` Kai Grossjohann
     [not found]           ` <mailman.175.1178201800.32220.help-gnu-emacs@gnu.org>
2007-05-03 14:48             ` Hadron
2007-05-03 15:42               ` Kai Grossjohann
2007-05-03 17:11               ` Robert Thorpe
     [not found]               ` <mailman.180.1178207394.32220.help-gnu-emacs@gnu.org>
2007-05-06 18:29                 ` Hadron

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=87y7k6rbyp.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.
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.