[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Force Insert Tab (\t) in a new mode
From: |
Saptarshi |
Subject: |
Force Insert Tab (\t) in a new mode |
Date: |
Wed, 5 Nov 2008 20:43:53 -0800 (PST) |
User-agent: |
G2/1.0 |
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.
What I have done is
(define-key map (kbd "tab") 'self-insert-command)
but this doesn't work.
Can someone suggest a change?
Regards
Saptarshi
FIN MODE
(defvar fin-mode-hook nil)
(defvar fin-font-lock-keywords-1
(list
'("^#.*" . font-lock-comment-face)
)
"Minimal highlighting expressions for fin mode")
(defvar fin-font-lock-keywords
fin-font-lock-keywords-1)
(defvar fin-mode-map nil "'fin-mode' keymap.")
(let ((map (make-keymap)))
(define-key map (kbd "tab") 'self-insert-command)
(setq fin-mode-map map))
(define-derived-mode fin-mode text-mode "Finance"
"A major mode for editing Finance files."
(set (make-local-variable 'comment-start) "#")
(set (make-local-variable 'font-lock-defaults)
'(fin-font-lock-keywords))
(use-local-map fin-mode-map)
)
(provide 'fin)
;;; fin.el ends here
- Force Insert Tab (\t) in a new mode,
Saptarshi <=