all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: nullius.filius@gmail.com
To: help-gnu-emacs@gnu.org
Subject: Re: tidy up code
Date: Fri, 21 Dec 2007 04:07:05 -0800 (PST)	[thread overview]
Message-ID: <1a7b6c7f-f885-4c70-bf05-4e4c87099c47@b1g2000pra.googlegroups.com> (raw)
In-Reply-To: fkg7mr$383$1@aioe.org

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.

  reply	other threads:[~2007-12-21 12:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21  9:04 tidy up code Umar
2007-12-21  9:29 ` Jason Rumney
2007-12-21 10:23   ` Umar
2007-12-21 10:41     ` Torben Knudsen
2007-12-21 11:00       ` Umar Said
2007-12-21 11:18     ` Martin Bealby
2007-12-21 11:23       ` Umar Said
2007-12-21 12:07         ` nullius.filius [this message]
2007-12-21 12:30           ` Umar Said
2007-12-23  6:01             ` Gabriel Parrondo
     [not found]             ` <mailman.5343.1198389653.18990.help-gnu-emacs@gnu.org>
2007-12-26  3:02               ` Umar Said

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=1a7b6c7f-f885-4c70-bf05-4e4c87099c47@b1g2000pra.googlegroups.com \
    --to=nullius.filius@gmail.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.