gnu.emacs.help
[Top] [All Lists]

Re: TAB key to insert tab character

Subject: Re: TAB key to insert tab character
From: Eli Zaretskii
Date: Sun, 10 Feb 2008 06:14:27 +0200
Newsgroups: gnu.emacs.help

> From: Blake McBride <blake@xxxxxxxxxxxx>
> Date: Sat, 09 Feb 2008 14:56:02 -0600
> 
> > You could do what I do - bind Ctrl-Tab to insert an ASCII <tab>:
> > 
> >   (global-set-key [C-tab] (lambda () (interactive) (insert-char 9 1)))
> > 
> > - Will
> 
> I don't want to globally set anything.  I like the way the TAB key works 
> in C and Lisp modes.  I just want to change its behavior in TEXT and 
> FUNDAMENTAL modes.

Did you actually try that?  I think mode-specific key bindings always
override global bindings, so the above will not affect C mode. for
example.

But if you want to bind TAB in Text mode, then try the below:

  (define-key text-mode-map "\C-i" 'self-insert-command)

You will need to do this in a text-mode-hook.



<Prev in Thread] Current Thread [Next in Thread>