[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Force Insert Tab (\t) in a new mode
From: |
Nikolaj Schumacher |
Subject: |
Re: Force Insert Tab (\t) in a new mode |
Date: |
Thu, 06 Nov 2008 23:31:58 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin) |
Saptarshi <saptarshi.guha@gmail.com> wrote:
> 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))
You can write this a little cleaner like this:
(defvar fin-mode-map
(let ((map (make-keymap)))
(define-key map [tab] 'self-insert-command)
map)
"'fin-mode' keymap.")
And if I recall correctly, there's no need for:
(use-local-map fin-mode-map)
because `define-derived-mode' does this implicitly.
regards,
Nikolaj Schumacher