From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: C++-Mode Date: Wed, 08 Jan 2003 11:18:02 -0700 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3E1C6B5A.5050703@ihs.com> References: <3e1af127@news.uni-ulm.de> <3e1c001c@news.uni-ulm.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1042050055 12879 80.91.224.249 (8 Jan 2003 18:20:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 8 Jan 2003 18:20:55 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18WKoi-0003KV-00 for ; Wed, 08 Jan 2003 19:20:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18WKob-0006fD-07 for gnu-help-gnu-emacs@m.gmane.org; Wed, 08 Jan 2003 13:20:33 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: 170.207.51.80 Original-X-Trace: fu-berlin.de 1042049876 16896365 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us Original-Xref: shelby.stanford.edu gnu.emacs.help:108746 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5275 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5275 Boris H. wrote: > kgold wrote: >>The default for emacs using M-x compile is to call make. >> >>While you could change the default, experienced programmers typically >>create a makefile. > > I know, but since I only write small programms, there's no real need for a > makefile. make has implicit rules to build an executable from its source file. So all you should need to do in the foo.cc buffer is `M-! make foo'. If that works, it's just a matter of how you want to automate it: 1. Use the `M-x compile' command, with the compile-command customized as described in its doc string. 2. Write your own `M-x compile-buffer' command: (defun compile-buffer (&optional buffer) "Compile the file visited in BUFFER (by default, the selected buffer)." (interactive "bCompile buffer: ") (or buffer (setq buffer (selected-buffer))) (save-excursion (set-buffer buffer) (compile (format "make %s" (file-name-sans-extension (file-name-nondirectory buffer-file-name)))))) > In Ada-mode, there are commands ada-compile-application and > ada-run-application. I want this facility in C++-mode, too. Can those be easily adapted to C++? If not, you can use the compile-buffer example above; just use shell-command or term instead of compile. -- Kevin Rodgers