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

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

Re: define-key OK; defiune-key-after won't evaluate


From: Kevin Rodgers
Subject: Re: define-key OK; defiune-key-after won't evaluate
Date: Tue, 21 Feb 2006 09:18:41 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

RD. wrote:
I can define a menu button in the menu bar, placed to the left of the
File button, thus:

(define-key global-map [menu-bar rsave] '("Save" . save-buffer))

But I don't know how to use define-key-after.  I get a Lisp error:

(define-key-after global-map [menu-bar rsave]
   '("Save" . save-buffer) 'tools)
Debugger entered--Lisp error: (error "multi-event key specified in
`define-key-after'")

Is it obvious what's wrong?

,----[ C-h f define-key-after RET ]
| define-key-after is a compiled Lisp function in `subr'.
| (define-key-after KEYMAP KEY DEFINITION &optional AFTER)
|
| Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding.
| This is like `define-key' except that the binding for KEY is placed
| just after the binding for the event AFTER, instead of at the beginning
| of the map. Note that AFTER must be an event type (like KEY), NOT a command
| (like DEFINITION).
|
| If AFTER is t or omitted, the new binding goes at the end of the keymap.
|
| KEY must contain just one event type--that is to say, it must be a
| string or vector of length 1, but AFTER should be a single event
| type--a symbol or a character, not a sequence.
|
| Bindings are always added before any inherited map.
|
| The order of bindings in a keymap matters when it is used as a menu.
`----

Does this work?

(define-key-after (lookup-key global-map [menu-bar]) [rsave]
  '("Save" . save-buffer) 'tools)

--
Kevin Rodgers





reply via email to

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