all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Need Help: insert tab(8 characters) for every tabstroke
@ 2011-08-08 14:05 amit mehta
  2011-08-08 21:41 ` Jai Dayal
  2011-08-08 23:45 ` PJ Weisberg
  0 siblings, 2 replies; 4+ messages in thread
From: amit mehta @ 2011-08-08 14:05 UTC (permalink / raw)
  To: help-gnu-emacs

I'm a complete n00b and hence please don't shower your wrath upon me.
I'm finding it little difficult to use TABS in my 'C' programs. I've been a vim
user till last week and have slowly started to migrate towards mighty emacs.
In vim, I usually indent my code with tabs, where each tab stroke replaces the
cursor by 8 columns, but in an emacs buffer, a tab stroke doesn't work this
way by default. I did some text search and based on that, have added the
following line under $HOME/.emacs:

(setq indent-tabs-mode t)

but this doesn't work(i mean, hitting the TAB key on my keyboard doesn't
move forward the cursor to 8 columns to the right), so every time i need a TAB,
I've to use C-q <tab>. this is overkill.

Then I tried putting just this entry in $HOME/.emacs, but this too doesn't work
(setq default-tab-width 8);


Please help.

-amit



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Need Help: insert tab(8 characters) for every tabstroke
  2011-08-08 14:05 Need Help: insert tab(8 characters) for every tabstroke amit mehta
@ 2011-08-08 21:41 ` Jai Dayal
  2011-08-09  4:56   ` amit mehta
  2011-08-08 23:45 ` PJ Weisberg
  1 sibling, 1 reply; 4+ messages in thread
From: Jai Dayal @ 2011-08-08 21:41 UTC (permalink / raw)
  To: amit mehta; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1140 bytes --]

Try fiddling with c-set-style

http://www.phys.ufl.edu/docs/emacs/emacs_254.html

Here's a list of built in c-styles

http://www.delorie.com/gnu/docs/emacs/cc-mode_24.html

On Mon, Aug 8, 2011 at 8:05 AM, amit mehta <gmate.amit@gmail.com> wrote:

> I'm a complete n00b and hence please don't shower your wrath upon me.
> I'm finding it little difficult to use TABS in my 'C' programs. I've been a
> vim
> user till last week and have slowly started to migrate towards mighty
> emacs.
> In vim, I usually indent my code with tabs, where each tab stroke replaces
> the
> cursor by 8 columns, but in an emacs buffer, a tab stroke doesn't work this
> way by default. I did some text search and based on that, have added the
> following line under $HOME/.emacs:
>
> (setq indent-tabs-mode t)
>
> but this doesn't work(i mean, hitting the TAB key on my keyboard doesn't
> move forward the cursor to 8 columns to the right), so every time i need a
> TAB,
> I've to use C-q <tab>. this is overkill.
>
> Then I tried putting just this entry in $HOME/.emacs, but this too doesn't
> work
> (setq default-tab-width 8);
>
>
> Please help.
>
> -amit
>
>

[-- Attachment #2: Type: text/html, Size: 1700 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Need Help: insert tab(8 characters) for every tabstroke
  2011-08-08 14:05 Need Help: insert tab(8 characters) for every tabstroke amit mehta
  2011-08-08 21:41 ` Jai Dayal
@ 2011-08-08 23:45 ` PJ Weisberg
  1 sibling, 0 replies; 4+ messages in thread
From: PJ Weisberg @ 2011-08-08 23:45 UTC (permalink / raw)
  To: amit mehta; +Cc: help-gnu-emacs

On Mon, Aug 8, 2011 at 7:05 AM, amit mehta <gmate.amit@gmail.com> wrote:

> but this doesn't work(i mean, hitting the TAB key on my keyboard doesn't
> move forward the cursor to 8 columns to the right), so every time i need a TAB,
> I've to use C-q <tab>. this is overkill.

Try (setq tab-always-indent nil)

-PJ



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Need Help: insert tab(8 characters) for every tabstroke
  2011-08-08 21:41 ` Jai Dayal
@ 2011-08-09  4:56   ` amit mehta
  0 siblings, 0 replies; 4+ messages in thread
From: amit mehta @ 2011-08-09  4:56 UTC (permalink / raw)
  To: Jai Dayal; +Cc: help-gnu-emacs

On Tue, Aug 9, 2011 at 3:11 AM, Jai Dayal <dayalsoap@gmail.com> wrote:
> Try fiddling with c-set-style
>
> http://www.phys.ufl.edu/docs/emacs/emacs_254.html
>
> Here's a list of built in c-styles
>
> http://www.delorie.com/gnu/docs/emacs/cc-mode_24.html
>
> On Mon, Aug 8, 2011 at 8:05 AM, amit mehta <gmate.amit@gmail.com> wrote:
>>
>> I'm a complete n00b and hence please don't shower your wrath upon me.
>> I'm finding it little difficult to use TABS in my 'C' programs. I've been
>> a vim
>> user till last week and have slowly started to migrate towards mighty
>> emacs.
>> In vim, I usually indent my code with tabs, where each tab stroke replaces
>> the
>> cursor by 8 columns, but in an emacs buffer, a tab stroke doesn't work
>> this
>> way by default. I did some text search and based on that, have added the
>> following line under $HOME/.emacs:
>>
>> (setq indent-tabs-mode t)
>>
>> but this doesn't work(i mean, hitting the TAB key on my keyboard doesn't
>> move forward the cursor to 8 columns to the right), so every time i need a
>> TAB,
>> I've to use C-q <tab>. this is overkill.
>>
>> Then I tried putting just this entry in $HOME/.emacs, but this too doesn't
>> work
>> (setq default-tab-width 8);
>>
>>
>> Please help.
>>
>> -amit
>>
>
>
Thank you very much. This one very much solved my issue:
http://www.delorie.com/gnu/docs/emacs/cc-mode_39.html

-amit



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-09  4:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08 14:05 Need Help: insert tab(8 characters) for every tabstroke amit mehta
2011-08-08 21:41 ` Jai Dayal
2011-08-09  4:56   ` amit mehta
2011-08-08 23:45 ` PJ Weisberg

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.