unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: GVK <vamsee_k@nospam.iiit.net>
Subject: Re: auto complile the C program in the current buffer
Date: Wed, 16 Feb 2005 14:10:00 +0530	[thread overview]
Message-ID: <cuv0qj$re8$1@domitilla.aioe.org> (raw)
In-Reply-To: 37etouF55h81jU1@individual.net

Kevin Rodgers wrote:
>
> 
> 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))))))
> 

Thanks a lot. I added the following lines in my .emacs and it's working.

(if
     (or (file-exists-p "makefile") (file-exists-p "Makefile"))
     (set 'compile-command "make -k ")
   (set 'compile-command (concat "gcc " buffer-file-name)))


Regards,
GVK

      parent reply	other threads:[~2005-02-16  8:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-13 18:51 auto complile the C program in the current buffer GVK
2005-02-14 18:41 ` Kevin Rodgers
2005-02-15  4:17   ` GVK
2005-02-15 18:36     ` Kevin Rodgers
2005-02-15 22:40       ` Hendrik Sattler
2005-02-16  8:40       ` GVK [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='cuv0qj$re8$1@domitilla.aioe.org' \
    --to=vamsee_k@nospam.iiit.net \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).