unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Problem: Keymap not working...
@ 2005-02-06 17:36 upro
  2005-02-06 19:49 ` Neon Absentius
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: upro @ 2005-02-06 17:36 UTC (permalink / raw)


Hi!

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)))

Thank you in advance!

-- 
Michael

r-znvy: zvpunry.wryqra  jro.qr (chg gur "@" jurer vg svgf...)
ab fcnz cyrnfr

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem: Keymap not working...
  2005-02-06 17:36 Problem: Keymap not working upro
@ 2005-02-06 19:49 ` Neon Absentius
  2005-02-07 18:53 ` Kevin Rodgers
       [not found] ` <mailman.1043.1107720238.2841.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Neon Absentius @ 2005-02-06 19:49 UTC (permalink / raw)


On Sun, Feb 06, 2005 at 06:36:05PM +0100, upro wrote:
>(btw: How do I get the minibuffer output
> [e. g. on M-x emacs.version] to point in the main buffer?).

Maybe there is a smarter way but this works. Use eval-expression with
an argument.  "eval-expression" is bound to "M-:". Thus 

M-3 M-: emacs-version RET

should work. At least it works in my emacs: "21.3.1".
 

> Thank you in advance!
> 

-- 
Charity in capitalism is like urinating to extinguish a forest fire.
    -- Neon Absentius
absent a.in.cirle sdf period lonestar period org
SDF Public Access UNIX System - http://sdf.lonestar.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem: Keymap not working...
  2005-02-06 17:36 Problem: Keymap not working upro
  2005-02-06 19:49 ` Neon Absentius
@ 2005-02-07 18:53 ` Kevin Rodgers
  2005-02-07 20:37   ` Kevin Rodgers
       [not found] ` <mailman.1043.1107720238.2841.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 5+ messages in thread
From: Kevin Rodgers @ 2005-02-07 18:53 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem: Keymap not working...
  2005-02-07 18:53 ` Kevin Rodgers
@ 2005-02-07 20:37   ` Kevin Rodgers
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2005-02-07 20:37 UTC (permalink / raw)


Kevin Rodgers wrote:
 > 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))

Oops, that should be:

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

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Problem: Keymap not working...
       [not found] ` <mailman.1043.1107720238.2841.help-gnu-emacs@gnu.org>
@ 2005-03-02 15:59   ` David Combs
  0 siblings, 0 replies; 5+ messages in thread
From: David Combs @ 2005-03-02 15:59 UTC (permalink / raw)


In article <mailman.1043.1107720238.2841.help-gnu-emacs@gnu.org>,
Neon Absentius  <absent@sdf.lonestar.org> wrote:
>On Sun, Feb 06, 2005 at 06:36:05PM +0100, upro wrote:
>>(btw: How do I get the minibuffer output
>> [e. g. on M-x emacs.version] to point in the main buffer?).
>
>Maybe there is a smarter way but this works. Use eval-expression with
>an argument.  "eval-expression" is bound to "M-:". Thus 
>
>M-3 M-: emacs-version RET
>
>should work. At least it works in my emacs: "21.3.1".

Why the "3" prefix-arg?

Thanks,

David

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-03-02 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-06 17:36 Problem: Keymap not working upro
2005-02-06 19:49 ` Neon Absentius
2005-02-07 18:53 ` Kevin Rodgers
2005-02-07 20:37   ` Kevin Rodgers
     [not found] ` <mailman.1043.1107720238.2841.help-gnu-emacs@gnu.org>
2005-03-02 15:59   ` David Combs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).