From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Problem: Keymap not working... Date: Mon, 07 Feb 2005 11:53:09 -0700 Message-ID: <36promF53us79U1@individual.net> References: <87braxzj3u.fsf@lux99.localhost> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1107802563 9676 80.91.229.2 (7 Feb 2005 18:56:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Feb 2005 18:56:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 07 19:56:02 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1CyE30-0004BI-6v for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Feb 2005 19:55:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CyEHB-0003tz-5o for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Feb 2005 14:10:25 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-X-Trace: individual.net hfc7neEEN7zAbMv7CN+6TAV7xWsnQQ0F3N+WWK3++Ph7rXs8A= User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: <87braxzj3u.fsf@lux99.localhost> Original-Xref: shelby.stanford.edu gnu.emacs.help:128426 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: main.gmane.org gmane.emacs.help:23946 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23946 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