diff options
| author | Dave Love | 2000-02-23 11:40:06 +0000 |
|---|---|---|
| committer | Dave Love | 2000-02-23 11:40:06 +0000 |
| commit | 4ced66fd688c0e13c622e5943ca3ce361dff01ca (patch) | |
| tree | fc138ad80063294ebf5b8fc677bce23c86ae21c2 | |
| parent | d1e103b2985e7f674f878add05429fc4d24702af (diff) | |
| download | emacs-4ced66fd688c0e13c622e5943ca3ce361dff01ca.tar.gz emacs-4ced66fd688c0e13c622e5943ca3ce361dff01ca.zip | |
(define-key-after): Default AFTER to t. Doc fix.
| -rw-r--r-- | lisp/subr.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index beee692229b..39108374b88 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." | |||
| 339 | (car scan))))) | 339 | (car scan))))) |
| 340 | (setq scan (cdr scan))))) | 340 | (setq scan (cdr scan))))) |
| 341 | 341 | ||
| 342 | (defun define-key-after (keymap key definition after) | 342 | (defun define-key-after (keymap key definition &optional after) |
| 343 | "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding. | 343 | "Add binding in KEYMAP for KEY => DEFINITION, right after AFTER's binding. |
| 344 | This is like `define-key' except that the binding for KEY is placed | 344 | This is like `define-key' except that the binding for KEY is placed |
| 345 | just after the binding for the event AFTER, instead of at the beginning | 345 | just after the binding for the event AFTER, instead of at the beginning |
| 346 | of the map. Note that AFTER must be an event type (like KEY), NOT a command | 346 | of the map. Note that AFTER must be an event type (like KEY), NOT a command |
| 347 | \(like DEFINITION). | 347 | \(like DEFINITION). |
| 348 | 348 | ||
| 349 | If AFTER is t, the new binding goes at the end of the keymap. | 349 | If AFTER is t or omitted, the new binding goes at the end of the keymap. |
| 350 | 350 | ||
| 351 | KEY must contain just one event type--that is to say, it must be | 351 | KEY must contain just one event type--that is to say, it must be a |
| 352 | a string or vector of length 1. | 352 | string or vector of length 1, but AFTER should be a single event |
| 353 | type--a symbol or a character, not a sequence. | ||
| 353 | 354 | ||
| 354 | The order of bindings in a keymap matters when it is used as a menu." | 355 | Bindings are always added before any inherited map. |
| 355 | 356 | ||
| 357 | The order of bindings in a keymap matters when it is used as a menu." | ||
| 358 | (unless after (setq after t)) | ||
| 356 | (or (keymapp keymap) | 359 | (or (keymapp keymap) |
| 357 | (signal 'wrong-type-argument (list 'keymapp keymap))) | 360 | (signal 'wrong-type-argument (list 'keymapp keymap))) |
| 358 | (if (> (length key) 1) | 361 | (if (> (length key) 1) |