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

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

Re: Force Insert Tab (\t) in a new mode


From: Saptarshi
Subject: Re: Force Insert Tab (\t) in a new mode
Date: Wed, 5 Nov 2008 20:55:43 -0800 (PST)
User-agent: G2/1.0

On Nov 5, 11:43 pm, Saptarshi <saptarshi.g...@gmail.com> wrote:
> Hello,
> I tried searching on this group but none of the solutions work.
> I am entering some tabular data of the form
>
> Col1 \t Col2 \t Col3 \t Col4
> Col1 \t Col2 \t Col3 \t Col4
>
> Every time I press TAB I want to insert a \t character into the file.
> In other words I would like to remap C-q TAB to just TAB for this
> mode.

Got it:
(defvar fin-mode-map nil "'fin-mode' keymap.")
(let ((map (make-keymap)))
;;  (define-key map (kbd "TAB") 'self-insert-command)
  (define-key map [tab]
                (lambda () (interactive) (insert "\t")))
  (setq fin-mode-map map))

Hope it helps
Saptarshi




reply via email to

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