help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: TAB key to insert tab character


From: Blake McBride
Subject: Re: TAB key to insert tab character
Date: Mon, 11 Feb 2008 08:27:04 -0600
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

Eli Zaretskii wrote:
From: Blake McBride <blake@mcbride.name>
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.



Okay, I added the following line:

        (define-key text-mode-map (kbd "TAB") 'self-insert-command)

This fixed the problem in TEXT mode. I didn't seem to have to use it in a text-mode-hook. Now the problem is how to fix thins in FUNDAMENTAL mode (the mode used when no special file extension is used)?

Thanks.

Blake McBride


reply via email to

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