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

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

Re: Problem: Keymap not working...


From: Kevin Rodgers
Subject: Re: Problem: Keymap not working...
Date: Mon, 07 Feb 2005 11:53:09 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

upro wrote:
> IU am writing a small mode for my daily work, but the keymap is not
> working. Can someone please tell me, why?
>
> I am using emacs 21.3 (btw: How do I get the minibuffer output
> [e. g. on M-x emacs.version] to point in the main buffer?).
>
> This is my smal function:
>
> (defvar musman-mode-map
>   (let ((musman-mode-map (make-sparse-keymap)))
> ;  (if musman-mode-map ()
> ;  (setq musman-mode-map (make-sparse-keymap))
>     (define-key musman-mode-map "\C-ck" 'musman-Konzert)
>     (define-key musman-mode-map "\C-ct" 'musman-Termin)
>     (define-key musman-mode-map "\C-ca" 'musman-Anrufen)
>     (define-key musman-mode-map "\C-c\C-g" 'musman-Angerufen)
>     (define-key musman-mode-map "\C-c n" 'musman-N?chster)
>     (define-key musman-mode-map "\C-c t" 'musman-Terminauswahl)
>     (define-key musman-mode-map "\C-c v" 'musman-Vertrag)
>     (define-key musman-mode-map "\C-c z" 'musman-Zur?ckrufen)))

You need to return the keymap from the let form, so that it is bound to
the variable.  Also, it's not a bug but it is a little confusing to use
the name of the global variable as the name of the local variable:

(defvar musman-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key musman-mode-map "\C-ck" 'musman-Konzert)
...
    (define-key musman-mode-map "\C-c z" 'musman-Zurückrufen)
    map))

--
Kevin Rodgers

reply via email to

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