From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dale Snell Newsgroups: gmane.emacs.help Subject: Re: Compilation in C and ADA Date: Sat, 23 Jul 2016 10:52:53 -0700 Organization: Organization? Me? ROFL!! Message-ID: <20160723105253.74246630@zothique.localdomain> References: <87shv5sf78.fsf@ram.bvr.dp.lan> <4781A7A0-F110-47CC-A19D-0C9F1619FD23@comcast.net> <87y44xors9.fsf@ram.bvr.dp.lan> <1D8794DF-16FD-43C6-8F74-43EAFC1B6D0A@comcast.net> Reply-To: ddsnell@frontier.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1469296434 6771 80.91.229.3 (23 Jul 2016 17:53:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2016 17:53:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 23 19:53:44 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bR17N-0002q4-LX for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 19:53:41 +0200 Original-Received: from localhost ([::1]:53174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR17J-0005ez-LX for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 13:53:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR16t-0005Zn-RP for help-gnu-emacs@gnu.org; Sat, 23 Jul 2016 13:53:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR16p-0001cs-LJ for help-gnu-emacs@gnu.org; Sat, 23 Jul 2016 13:53:10 -0400 Original-Received: from filter01.dlls.pa.frontiernet.net ([199.224.80.228]:47342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR16p-0001co-Gy for help-gnu-emacs@gnu.org; Sat, 23 Jul 2016 13:53:07 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by filter01.dlls.pa.frontiernet.net (Postfix) with ESMTP id B262C85FA1 for ; Sat, 23 Jul 2016 17:53:04 +0000 (UTC) Original-Received: from relay04.dlls.pa.frontiernet.net ([199.224.80.247]) by localhost (filter01.dlls.pa.frontiernet.net [199.224.80.228]) (amavisd-new, port 10024) with LMTP id cp5r76Ha2_VQ for ; Sat, 23 Jul 2016 17:52:53 +0000 (UTC) X-Originating-IP: [50.109.233.188] X-Previous-IP: 50.109.233.188 Original-Received: from zothique.localdomain (unknown [50.109.233.188]) by relay04.dlls.pa.frontiernet.net (Postfix) with ESMTPA id A6BAE4382A for ; Sat, 23 Jul 2016 17:52:52 +0000 (UTC) In-Reply-To: <1D8794DF-16FD-43C6-8F74-43EAFC1B6D0A@comcast.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 199.224.80.228 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110912 Archived-At: 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.