* how to change the indentation style of emacs
@ 2011-01-22 15:22 Anand Dhanakshirur
2011-01-23 12:56 ` suvayu ali
0 siblings, 1 reply; 6+ messages in thread
From: Anand Dhanakshirur @ 2011-01-22 15:22 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
I am using emacs for c and c++ files.
1. Presently(default), In a C program,
after "for" loop, the next line(the next line starting with
"{" is indented(shifted) by 2 spaces.
I want to change this.
I want the next line is not shifted by 2 spaces when i press TAB key.(for indentation)
basically
Now it is, for (i=0;i<10; i++)
{
}
I want this to be changed as
for (i=0; i<10;i++)
2 .One more thing want to do.
after opening for loop of if condition,
the next line is getting shiftedby 2 spaces.
I want the next line to be shifted by 4 spaces.
How to do these 2 things?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to change the indentation style of emacs
2011-01-22 15:22 how to change the indentation style of emacs Anand Dhanakshirur
@ 2011-01-23 12:56 ` suvayu ali
[not found] ` <102513.20309.qm@web30901.mail.mud.yahoo.com>
0 siblings, 1 reply; 6+ messages in thread
From: suvayu ali @ 2011-01-23 12:56 UTC (permalink / raw)
To: Anand Dhanakshirur; +Cc: help-gnu-emacs
On Sat, Jan 22, 2011 at 4:22 PM, Anand Dhanakshirur
<adhanakshirur@yahoo.com> wrote:
> Hi,
> I am using emacs for c and c++ files.
>
> 1. Presently(default), In a C program,
> after "for" loop, the next line(the next line starting with
> "{" is indented(shifted) by 2 spaces.
> I want to change this.
> I want the next line is not shifted by 2 spaces when i press TAB key.(for indentation)
> basically
> Now it is, for (i=0;i<10; i++)
> {
> }
>
> I want this to be changed as
> for (i=0; i<10;i++)
>
> 2 .One more thing want to do.
> after opening for loop of if condition,
> the next line is getting shiftedby 2 spaces.
> I want the next line to be shifted by 4 spaces.
>
> How to do these 2 things?
>
You can choose indentation styles by using `C-c . <RET> STYLE <RET>'
where style can be tab completed. For more details you can look in the
info manual section 26.3.5 (Programs > Program Indent > Custom C
Indent > Customising C Indentation). If nothing suits you, I think you
can even define your own style.
--
Suvayu
Open source is the future. It sets us free.
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <mailman.23.1295774749.8897.help-gnu-emacs@gnu.org>]
* Re: how to change the indentation style of emacs
[not found] <mailman.23.1295774749.8897.help-gnu-emacs@gnu.org>
@ 2011-01-23 9:37 ` rusi
0 siblings, 0 replies; 6+ messages in thread
From: rusi @ 2011-01-23 9:37 UTC (permalink / raw)
To: help-gnu-emacs
On Jan 22, 8:22 pm, Anand Dhanakshirur <adhanakshi...@yahoo.com>
wrote:
> Hi,
> I am using emacs for c and c++ files.
>
> 1. Presently(default), In a C program,
> after "for" loop, the next line(the next line starting with
> "{" is indented(shifted) by 2 spaces.
> I want to change this.
> I want the next line is not shifted by 2 spaces when i press TAB key.(for indentation)
> basically
> Now it is, for (i=0;i<10; i++)
> {
> }
>
> I want this to be changed as
> for (i=0; i<10;i++)
>
> 2 .One more thing want to do.
> after opening for loop of if condition,
> the next line is getting shiftedby 2 spaces.
> I want the next line to be shifted by 4 spaces.
>
> How to do these 2 things?
Have you seen and tried http://www.emacswiki.org/emacs/IndentingC
(especially different styles)?
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-02-07 20:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-22 15:22 how to change the indentation style of emacs Anand Dhanakshirur
2011-01-23 12:56 ` suvayu ali
[not found] ` <102513.20309.qm@web30901.mail.mud.yahoo.com>
2011-01-24 8:07 ` suvayu ali
[not found] ` <577605.6548.qm@web30901.mail.mud.yahoo.com>
2011-01-24 14:43 ` Suvayu Ali
2011-02-07 20:22 ` PJ Weisberg
[not found] <mailman.23.1295774749.8897.help-gnu-emacs@gnu.org>
2011-01-23 9:37 ` rusi
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.