emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/keyboard.c


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/src/keyboard.c
Date: Wed, 06 Feb 2002 17:59:56 -0500

Index: emacs/src/keyboard.c
diff -c emacs/src/keyboard.c:1.653 emacs/src/keyboard.c:1.654
*** emacs/src/keyboard.c:1.653  Wed Feb  6 17:41:43 2002
--- emacs/src/keyboard.c        Wed Feb  6 17:59:56 2002
***************
*** 373,378 ****
--- 373,382 ----
  /* This is like Vthis_command, except that commands never set it.  */
  Lisp_Object real_this_command;
  
+ /* If the lookup of the command returns a binding, the original
+    command is stored in this-original-command.  It is nil otherwise.  */
+ Lisp_Object Vthis_original_command;
+ 
  /* The value of point when the last command was executed.  */
  int last_point_position;
  
***************
*** 1503,1508 ****
--- 1507,1523 ----
         reset it before we execute the command. */
        Vdeactivate_mark = Qnil;
  
+       /* Remap command through active keymaps */
+       Vthis_original_command = cmd;
+       if (is_command_symbol (cmd))
+       {
+         Lisp_Object cmd1;
+ 
+         cmd1 = Fkey_binding (cmd, Qnil, Qt);
+         if (!NILP (cmd1) && is_command_symbol (cmd1))
+           cmd = cmd1;
+       }
+ 
        /* Execute the command.  */
  
        Vthis_command = cmd;
***************
*** 6947,6953 ****
        Lisp_Object prefix;
  
        if (!NILP (tem))
!       tem = Fkey_binding (tem, Qnil);
  
        prefix = AREF (item_properties, ITEM_PROPERTY_KEYEQ);
        if (CONSP (prefix))
--- 6962,6968 ----
        Lisp_Object prefix;
  
        if (!NILP (tem))
!       tem = Fkey_binding (tem, Qnil, Qnil);
  
        prefix = AREF (item_properties, ITEM_PROPERTY_KEYEQ);
        if (CONSP (prefix))
***************
*** 6993,6999 ****
              && SYMBOLP (XSYMBOL (def)->function)
              && ! NILP (Fget (def, Qmenu_alias)))
            def = XSYMBOL (def)->function;
!         tem = Fwhere_is_internal (def, Qnil, Qt, Qnil);
          XSETCAR (cachelist, tem);
          if (NILP (tem))
            {
--- 7008,7014 ----
              && SYMBOLP (XSYMBOL (def)->function)
              && ! NILP (Fget (def, Qmenu_alias)))
            def = XSYMBOL (def)->function;
!         tem = Fwhere_is_internal (def, Qnil, Qt, Qnil, Qt);
          XSETCAR (cachelist, tem);
          if (NILP (tem))
            {
***************
*** 9408,9414 ****
        && NILP (Vexecuting_macro)
        && SYMBOLP (function))
      bindings = Fwhere_is_internal (function, Voverriding_local_map,
!                                  Qt, Qnil);
    else
      bindings = Qnil;
  
--- 9423,9429 ----
        && NILP (Vexecuting_macro)
        && SYMBOLP (function))
      bindings = Fwhere_is_internal (function, Voverriding_local_map,
!                                  Qt, Qnil, Qnil);
    else
      bindings = Qnil;
  
***************
*** 10634,10639 ****
--- 10649,10660 ----
  The command can set this variable; whatever is put here
  will be in `last-command' during the following command.  */);
    Vthis_command = Qnil;
+ 
+   DEFVAR_LISP ("this-original-command", &Vthis_original_command,
+              doc: /* If non-nil, the original command bound to the current 
key sequence.
+ The value of `this-command' is the result of looking up the original
+ command in the active keymaps.  */);
+   Vthis_original_command = Qnil;
  
    DEFVAR_INT ("auto-save-interval", &auto_save_interval,
              doc: /* *Number of input events between auto-saves.



reply via email to

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