You're right. TAB in emacs does not insert a TAB by default. It is used for indentation.
The behavior is controlled by the setting of the variable
indent-line-function. Type:
C-h v indent-line-function to learn more.
C-h v means "help on variable". (I also recommend typing
C-h ? and exploring the extensive help system if you haven't already).
By default its value is
indent-relative, which moves the cursor to the column of the next character following whitespace on the previous line. This is generally considered a good all-purpose mode.
There are a few other candidates defined:
(setq indent-line-function 'tab-to-tab-stop) and you can edit the tab stops with
M-x edit-tab-stops. This will give you the behavior of jumping to the next "tab stop" whenever you hit TAB.
(setq indent-line-function 'insert-tab) basically just inserts TAB or tab-sized number of spaces.
I highly recommend NOT using tab characters because it leads to trouble down the road in various ways. Emacs will always substitute spaces for tabs if you set
(setq indent-tabs-mode nil)
If you really want to insert a LITERAL character without any further interpretation, you can always prefix it with
C-q. For example,
C-q TAB always inserts a literal TAB character.
Finally, for a whole slew of information, see
http://www.emacswiki.org/cgi-b...ki/CategoryIndentation
Edit: apparently "highlighting" text does not work.