diff options
| author | Stefan Monnier | 2013-10-29 17:05:35 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-10-29 17:05:35 -0400 |
| commit | 4c9797cb77cee0d72084567ed8a7e97fcf41abff (patch) | |
| tree | 265ecd2bdf1b46c832f48c3a7a4ffe1378c20ffd | |
| parent | dcd163ac993757af6afa129b8625e3ea1c43973a (diff) | |
| download | emacs-4c9797cb77cee0d72084567ed8a7e97fcf41abff.tar.gz emacs-4c9797cb77cee0d72084567ed8a7e97fcf41abff.zip | |
* src/keyboard.c (command_loop_1): If command is nil, call `undefined'.
* lisp/subr.el (undefined): Add missing behavior from the C code for
unbound keys.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/subr.el | 10 | ||||
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 23 |
4 files changed, 18 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 988047c9bc0..f15ba16da11 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2013-10-29 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2013-10-29 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * subr.el (undefined): Add missing behavior from the C code for | ||
| 4 | unbound keys. | ||
| 5 | |||
| 3 | * rect.el: Use lexical-binding. Add new rectangular region support. | 6 | * rect.el: Use lexical-binding. Add new rectangular region support. |
| 4 | (rectangle-mark): New command. | 7 | (rectangle-mark): New command. |
| 5 | (rectangle--region): New var. | 8 | (rectangle--region): New var. |
diff --git a/lisp/subr.el b/lisp/subr.el index ae1db6652db..0267366f1a8 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -586,7 +586,15 @@ saving keyboard macros (see `edmacro-mode')." | |||
| 586 | (defun undefined () | 586 | (defun undefined () |
| 587 | "Beep to tell the user this binding is undefined." | 587 | "Beep to tell the user this binding is undefined." |
| 588 | (interactive) | 588 | (interactive) |
| 589 | (ding)) | 589 | (ding) |
| 590 | (message "%s is undefined" (key-description (this-single-command-keys))) | ||
| 591 | (setq defining-kbd-macro nil) | ||
| 592 | (force-mode-line-update) | ||
| 593 | ;; If this is a down-mouse event, don't reset prefix-arg; | ||
| 594 | ;; pass it to the command run by the up event. | ||
| 595 | (setq prefix-arg | ||
| 596 | (when (memq 'down (event-modifiers last-command-event)) | ||
| 597 | current-prefix-arg))) | ||
| 590 | 598 | ||
| 591 | ;; Prevent the \{...} documentation construct | 599 | ;; Prevent the \{...} documentation construct |
| 592 | ;; from mentioning keys that run this command. | 600 | ;; from mentioning keys that run this command. |
diff --git a/src/ChangeLog b/src/ChangeLog index b06279b1a0a..7dab8c0d64e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-10-29 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * keyboard.c (command_loop_1): If command is nil, call `undefined'. | ||
| 4 | |||
| 1 | 2013-10-29 Paul Eggert <eggert@cs.ucla.edu> | 5 | 2013-10-29 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 6 | ||
| 3 | * insdel.c: Fix minor problems found by static checking. | 7 | * insdel.c: Fix minor problems found by static checking. |
diff --git a/src/keyboard.c b/src/keyboard.c index 0ff4cda034a..6831f4d2cad 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1510,27 +1510,8 @@ command_loop_1 (void) | |||
| 1510 | already_adjusted = 0; | 1510 | already_adjusted = 0; |
| 1511 | 1511 | ||
| 1512 | if (NILP (Vthis_command)) | 1512 | if (NILP (Vthis_command)) |
| 1513 | { | 1513 | /* nil means key is undefined. */ |
| 1514 | /* nil means key is undefined. */ | 1514 | call0 (Qundefined); |
| 1515 | Lisp_Object keys = Fvector (i, keybuf); | ||
| 1516 | keys = Fkey_description (keys, Qnil); | ||
| 1517 | bitch_at_user (); | ||
| 1518 | message_with_string ("%s is undefined", keys, 0); | ||
| 1519 | kset_defining_kbd_macro (current_kboard, Qnil); | ||
| 1520 | update_mode_lines = 1; | ||
| 1521 | /* If this is a down-mouse event, don't reset prefix-arg; | ||
| 1522 | pass it to the command run by the up event. */ | ||
| 1523 | if (EVENT_HAS_PARAMETERS (last_command_event)) | ||
| 1524 | { | ||
| 1525 | Lisp_Object breakdown | ||
| 1526 | = parse_modifiers (EVENT_HEAD (last_command_event)); | ||
| 1527 | int modifiers = XINT (XCAR (XCDR (breakdown))); | ||
| 1528 | if (!(modifiers & down_modifier)) | ||
| 1529 | kset_prefix_arg (current_kboard, Qnil); | ||
| 1530 | } | ||
| 1531 | else | ||
| 1532 | kset_prefix_arg (current_kboard, Qnil); | ||
| 1533 | } | ||
| 1534 | else | 1515 | else |
| 1535 | { | 1516 | { |
| 1536 | /* Here for a command that isn't executed directly. */ | 1517 | /* Here for a command that isn't executed directly. */ |