all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nikolaj Schumacher <n_schumacher@web.de>
To: "Balaji V. Iyer" <bviyer@ncsu.edu>
Cc: help-gnu-emacs@gnu.org
Subject: Re: help with makefile command line
Date: Wed, 26 Mar 2008 17:20:36 +0100	[thread overview]
Message-ID: <m2myol4fu3.fsf@nschum.de> (raw)
In-Reply-To: <000001c88e79$86451340$33160e98@ece.ncsu.edu> (Balaji V. Iyer's message of "Tue\, 25 Mar 2008 09\:09\:56 -0400")

"Balaji V. Iyer" <bviyer@ncsu.edu> wrote:

> 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))))))

You create an (nameless) function that will set a new `compile-command'.
However, you don't call the function, therefore you don't see any
effect.

If you did
(funcall (lambda () ...
the function would be executed immediately and do what you want.

Certainly you'll want it to execute automatically:
(add-hook 'c-mode-hook (lambda () ...
will automatically call your function when you open a C file.


regards,
Nikolaj Schumacher




  parent reply	other threads:[~2008-03-26 16:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 13:09 help with makefile command line Balaji V. Iyer
2008-03-25 14:04 ` William Xu
2008-03-26  4:19 ` Eli Zaretskii
2008-03-26  4:25   ` Mike Mattie
2008-03-26  4:42   ` Mike Mattie
2008-03-26  4:57     ` Mike Mattie
2008-03-26 16:20 ` Nikolaj Schumacher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-03-25 13:11 Help " Balaji V. Iyer
2008-03-26  4:17 ` Mike Mattie
2008-03-26  9:05 ` Andreas Schwab
2008-03-26 13:50 ` Stefan Monnier
     [not found] <mailman.9409.1206451688.18990.help-gnu-emacs@gnu.org>
2008-03-27 15:36 ` help " step
2008-03-27 17:28 ` Richard G Riley
2008-03-28  2:51   ` stan
2008-03-28  3:01     ` Richard G Riley
2008-03-28  7:11       ` stan
2008-03-28 12:57         ` Richard G Riley
2008-03-28 20:33           ` stan
2008-03-29 13:18             ` Richard G Riley
2008-03-29 15:33     ` Kevin Rodgers

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=m2myol4fu3.fsf@nschum.de \
    --to=n_schumacher@web.de \
    --cc=bviyer@ncsu.edu \
    --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.