[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TAB character

From: Benjamin Rutt
Subject: Re: TAB character
Date: Fri, 22 Nov 2002 16:56:42 -0500
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (sparc-sun-solaris2.8)

Stirling Olson <> writes:

> How can I make the TAB key just enter a TAB character and never have
> that TAB character turn into spaces?
> While editing .java files and other files hitting the TAB key seems to
> follow some indenting conventions that I don't understand and don't
> prefer.  It often enters spaces and sometimes won't even let me enter a
> further tab.  I just want to have a tab character entered in the buffer
> when I hit TAB and when I backspace or delete a tab in the buffer I
> don't want it to turn into spaces.

In this case, I think you want to pick a number (like 4) that you want
to use for the distance between your tab stops.

Then, I believe you need to synchronize several variables based off of
that number:

(add-hook 'java-mode-hook
          (lambda ()
            (setq tab-width 4)
            (setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40)
            (setq c-basic-offset 4))))

Future TAB presses should indent your code only to the tab stop list,
and therefore no spaces will be inserted.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]