From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: nullius.filius@gmail.com Newsgroups: gmane.emacs.help Subject: Re: tidy up code Date: Fri, 21 Dec 2007 04:07:05 -0800 (PST) Organization: http://groups.google.com Message-ID: <1a7b6c7f-f885-4c70-bf05-4e4c87099c47@b1g2000pra.googlegroups.com> References: <8fe575ee-5f12-4e70-9818-34d7b3769336@e25g2000prg.googlegroups.com> <1116db7a-9821-4383-9529-9637460e8b5e@e23g2000prf.googlegroups.com> <87wsr8qoso.fsf@muscle.bealbywm.plus.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1198250270 20484 80.91.229.12 (21 Dec 2007 15:17:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Dec 2007 15:17:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 21 16:17:59 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J5jdH-00010S-NB for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Dec 2007 16:17:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J5jcx-00011q-HJ for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Dec 2007 10:17:31 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!b1g2000pra.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 124.182.7.101 Original-X-Trace: posting.google.com 1198238825 1637 127.0.0.1 (21 Dec 2007 12:07:05 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 21 Dec 2007 12:07:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b1g2000pra.googlegroups.com; posting-host=124.182.7.101; posting-account=eC1DvgoAAADSFXX7sf_iRJJOD8mR2PMk User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9b2) Gecko/2007121120 Firefox/3.0b2,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:154853 X-Mailman-Approved-At: Fri, 21 Dec 2007 10:09:13 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:50280 Archived-At: X-no-archive: Yes Umar Said wrote: > > Yes I'm new to Emacs and confused with it. [I'm try to format] > > int main(void) > { > int a = 1; > if (a == 1) > cout << "true" << endl; > else > cout << "false" << endl; > return 0 > } > > I've also tried M-x indent-region and other indent command, but still no > success. You have to give a hint to emacs that you want to format a c++ file. You do that by naming the file before you try and format it. Go to the file menu and click on the menu item 'Visit new File' go to the directory you want to save your file, and type in your file name (test.cpp) and click the open button. Now paste your code into emacs. Once emacs has a hint on what type of file it is formatting, then it can format it.