emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114851: * src/keyboard.c (command_loop_1): If comma


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r114851: * src/keyboard.c (command_loop_1): If command is nil, call `undefined'.
Date: Tue, 29 Oct 2013 21:05:32 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114851
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2013-10-29 17:05:35 -0400
message:
  * 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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/subr.el                   subr.el-20091113204419-o5vbwnq5f7feedwu-151
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/keyboard.c                 keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-10-29 16:11:50 +0000
+++ b/lisp/ChangeLog    2013-10-29 21:05:35 +0000
@@ -1,5 +1,8 @@
 2013-10-29  Stefan Monnier  <address@hidden>
 
+       * subr.el (undefined): Add missing behavior from the C code for
+       unbound keys.
+
        * rect.el: Use lexical-binding.  Add new rectangular region support.
        (rectangle-mark): New command.
        (rectangle--region): New var.

=== modified file 'lisp/subr.el'
--- a/lisp/subr.el      2013-10-29 16:11:50 +0000
+++ b/lisp/subr.el      2013-10-29 21:05:35 +0000
@@ -586,7 +586,15 @@
 (defun undefined ()
   "Beep to tell the user this binding is undefined."
   (interactive)
-  (ding))
+  (ding)
+  (message "%s is undefined" (key-description (this-single-command-keys)))
+  (setq defining-kbd-macro nil)
+  (force-mode-line-update)
+  ;; If this is a down-mouse event, don't reset prefix-arg;
+  ;; pass it to the command run by the up event.
+  (setq prefix-arg
+        (when (memq 'down (event-modifiers last-command-event))
+          current-prefix-arg)))
 
 ;; Prevent the \{...} documentation construct
 ;; from mentioning keys that run this command.

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-10-29 18:40:54 +0000
+++ b/src/ChangeLog     2013-10-29 21:05:35 +0000
@@ -1,3 +1,7 @@
+2013-10-29  Stefan Monnier  <address@hidden>
+
+       * keyboard.c (command_loop_1): If command is nil, call `undefined'.
+
 2013-10-29  Paul Eggert  <address@hidden>
 
        * insdel.c: Fix minor problems found by static checking.

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2013-10-18 13:33:25 +0000
+++ b/src/keyboard.c    2013-10-29 21:05:35 +0000
@@ -1510,27 +1510,8 @@
       already_adjusted = 0;
 
       if (NILP (Vthis_command))
-       {
-         /* nil means key is undefined.  */
-         Lisp_Object keys = Fvector (i, keybuf);
-         keys = Fkey_description (keys, Qnil);
-         bitch_at_user ();
-         message_with_string ("%s is undefined", keys, 0);
-         kset_defining_kbd_macro (current_kboard, Qnil);
-         update_mode_lines = 1;
-         /* If this is a down-mouse event, don't reset prefix-arg;
-            pass it to the command run by the up event.  */
-         if (EVENT_HAS_PARAMETERS (last_command_event))
-           {
-             Lisp_Object breakdown
-               = parse_modifiers (EVENT_HEAD (last_command_event));
-             int modifiers = XINT (XCAR (XCDR (breakdown)));
-             if (!(modifiers & down_modifier))
-               kset_prefix_arg (current_kboard, Qnil);
-           }
-         else
-           kset_prefix_arg (current_kboard, Qnil);
-       }
+       /* nil means key is undefined.  */
+       call0 (Qundefined);
       else
        {
          /* Here for a command that isn't executed directly.  */


reply via email to

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