From: Dale Snell <ddsnell@frontier.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Compilation in C and ADA
Date: Sat, 23 Jul 2016 10:52:53 -0700 [thread overview]
Message-ID: <20160723105253.74246630@zothique.localdomain> (raw)
In-Reply-To: <1D8794DF-16FD-43C6-8F74-43EAFC1B6D0A@comcast.net>
On Sat, 23 Jul 2016 10:22:22 -0400, in message
1D8794DF-16FD-43C6-8F74-43EAFC1B6D0A@comcast.net, Francis Belliveau
wrote:
>
> If I see a command like "compile" in a menu, I expect it to call the
> compiler for me, not attempt to "make" my project.
But which compiler would that be? There are lots of different
compilers out there, for lots of different languages. Emacs is
capable of many things, but it cannot read minds. You have to
tell it which compiler to use. It gives you the opportunity to do
when you select "Compile..." from the menu:
"Compile command: make -k "
appears in the mini-buffer. Delete the "make -k " and replace it
with whatever command line runs your compiler of choice. Emacs
will retain this command until it is explicitly changed, or until
you restart Emacs.
You could create a Makefile that will call your compiler, but for
a single file project that's a bit of overkill, IMO. If you're
going to be repeatedly compiling a single file, you could add
a file-local variable. For example, put
// -*- mode: compile-command: "compile prognam.c > prognam.o" -*-
in the first line of your program file, substituting whatever
values of compile and prognam you require. (Replace the leading
"//" with whatever comment delimiter you need.) That will set the
compile command to whatever you need when the program file is
loaded. (Note that it won't change if you change the file-local
variable _after_ you've loaded the file.)
I hope this helps.
--Dale
--
Pessimist: The glass is half empty.
Optimist: The glass is half full.
Engineer: The glass is twice as big as it needs to be.
next prev parent reply other threads:[~2016-07-23 17:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-19 11:11 Compilation in C and ADA Edward Zacharek
2016-07-19 17:36 ` B.V. Raghav
2016-07-20 2:50 ` Francis Belliveau
2016-07-20 4:30 ` B.V. Raghav
2016-07-23 14:22 ` Francis Belliveau
2016-07-23 17:52 ` Dale Snell [this message]
[not found] ` <mailman.1937.1469296394.26859.help-gnu-emacs@gnu.org>
2016-07-23 20:08 ` Emanuel Berg
[not found] ` <mailman.1922.1469283823.26859.help-gnu-emacs@gnu.org>
2016-07-23 15:05 ` Emanuel Berg
2016-07-24 4:20 ` Francis Belliveau
[not found] ` <mailman.1955.1469334108.26859.help-gnu-emacs@gnu.org>
2016-07-24 12:48 ` Emanuel Berg
2016-07-23 16:23 ` Kendall Shaw
[not found] <mailman.1680.1468936015.26859.help-gnu-emacs@gnu.org>
2016-07-20 3:43 ` Rusi
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=20160723105253.74246630@zothique.localdomain \
--to=ddsnell@frontier.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.