From 4ced66fd688c0e13c622e5943ca3ce361dff01ca Mon Sep 17 00:00:00 2001 From: Dave Love Date: Wed, 23 Feb 2000 11:40:06 +0000 Subject: (define-key-after): Default AFTER to t. Doc fix. --- lisp/subr.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lisp/subr.el') diff --git a/lisp/subr.el b/lisp/subr.el index beee692229..39108374b8 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -339,20 +339,23 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP." (car scan))))) (setq scan (cdr scan))))) -(defun define-key-after (keymap key definition after) +(defun 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, the new binding goes at the end of the keymap. +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. +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. -The order of bindings in a keymap matters when it is used as a menu." +Bindings are always added before any inherited map. +The order of bindings in a keymap matters when it is used as a menu." + (unless after (setq after t)) (or (keymapp keymap) (signal 'wrong-type-argument (list 'keymapp keymap))) (if (> (length key) 1) -- cgit v1.2.3