help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto complile the C program in the current buffer


From: Kevin Rodgers
Subject: Re: auto complile the C program in the current buffer
Date: Tue, 15 Feb 2005 11:36:11 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

GVK wrote:
> Kevin Rodgers wrote:
>> `C-h v compile-command' has that very example.
>
> compile-command's value is "gcc "
>
> Documentation:
> not documented as a variable.

I don't know how you could have deleted compile-command's doc string,
but in `emacs-21.3 -q --no-site-file -l compile`:

compile-command's value is "make -k "

Documentation:
*Last shell command used to do a compilation; default for next compilation.

Sometimes it is useful for files to supply local values for this variable.
You might also use mode hooks to specify it in certain modes, like this:

    (add-hook 'c-mode-hook
       (lambda ()
         (unless (or (file-exists-p "makefile")
                     (file-exists-p "Makefile"))
           (set (make-local-variable 'compile-command)
                (concat "make -k "
                        (file-name-sans-extension buffer-file-name))))))

You can customize this variable.

Defined in `compile'.

--
Kevin Rodgers

reply via email to

[Prev in Thread] Current Thread [Next in Thread]