Jim Weirich <jweirich / one.net> writes:

> >>>>> "Bill" == Bill Tj <billtj / glue.umd.edu> writes:
> 
>     Bill> By the way, in the C or C++ mode, hitting TAB at the
>     Bill> beginning of the line causes Emacs to auto indent while
>     Bill> hitting TAB in the middle of the line inserts regular tab.
>     Bill> However, in Ruby mode, hitting TAB in the middle of the line
>     Bill> causes Emacs to auto indent and I cannot insert a regular
>     Bill> TAB.  Is there any way to make TAB behavior in Ruby the same
>     Bill> as in C/C++?  Thanks.
> 
> Hmmm ... my C++ mode in emacs does autoindent nomatter where you are
> on the line, just like the Ruby mode.

(setq c-tab-always-indent nil)	; either 'nil' (false) or 't' (true)

From the documentation for the variable c-tab-always-indent:

    Documentation:
    *Controls the operation of the TAB key.
    If t, hitting TAB always just indents the current line. If nil, hitting
    TAB indents the current line if point is at the left margin or in the
    line's indentation, otherwise it insert a `real' tab character (see
    note). If the symbol `other', then tab is inserted only within literals
    -- defined as comments and strings -- and inside preprocessor
    directives, but the line is always reindented.

    Note: The value of `indent-tabs-mode' will determine whether a real tab
    character will be inserted, or the equivalent number of space. When
    inserting a tab, actually the function stored in the variable
    `c-insert-tab-function' is called.

    Note: indentation of lines containing only comments is also controlled
    by the `c-comment-only-line-offset' variable.

    You can customize this variable.

    Defined in `cc-vars'.

Jim
-- 
Jim Menard, jimm / io.com, http://www.io.com/~jimm/
As a math major, I don't have to be able to add -- I just have to be able
to PROVE that I can add.