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: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/src/keyboard.c
Date: Mon, 17 Feb 2003 02:51:10 -0500

Index: emacs/src/keyboard.c
diff -c emacs/src/keyboard.c:1.726 emacs/src/keyboard.c:1.727
*** emacs/src/keyboard.c:1.726  Wed Feb 12 18:13:43 2003
--- emacs/src/keyboard.c        Mon Feb 17 02:51:08 2003
***************
*** 145,150 ****
--- 145,154 ----
  Lisp_Object this_command_keys;
  int this_command_key_count;
  
+ /* 1 after calling Freset_this_command_lengths.
+    Usually it is 0.  */
+ int this_command_key_count_reset;
+ 
  /* This vector is used as a buffer to record the events that were actually 
read
     by read_key_sequence.  */
  Lisp_Object raw_keybuf;
***************
*** 1373,1378 ****
--- 1377,1383 ----
  
    nonundocount = 0;
    this_command_key_count = 0;
+   this_command_key_count_reset = 0;
    this_single_command_key_start = 0;
  
    if (NILP (Vmemory_full))
***************
*** 1505,1510 ****
--- 1510,1516 ----
        {
          cancel_echoing ();
          this_command_key_count = 0;
+         this_command_key_count_reset = 0;
          this_single_command_key_start = 0;
          goto finalize;
        }
***************
*** 1784,1789 ****
--- 1790,1796 ----
          current_kboard->Vreal_last_command = real_this_command;
          cancel_echoing ();
          this_command_key_count = 0;
+         this_command_key_count_reset = 0;
          this_single_command_key_start = 0;
        }
  
***************
*** 2384,2389 ****
--- 2391,2398 ----
        goto reread_for_input_method;
      }
  
+   this_command_key_count_reset = 0;
+ 
    if (!NILP (Vexecuting_macro))
      {
        /* We set this to Qmacro; since that's not a frame, nobody will
***************
*** 2949,2955 ****
        && (unsigned) XINT (c) < 256)
      {
        Lisp_Object keys;
!       int key_count;
        struct gcpro gcpro1;
        int count = SPECPDL_INDEX ();
  
--- 2958,2964 ----
        && (unsigned) XINT (c) < 256)
      {
        Lisp_Object keys;
!       int key_count, key_count_reset;
        struct gcpro gcpro1;
        int count = SPECPDL_INDEX ();
  
***************
*** 2971,2976 ****
--- 2980,2986 ----
  
        /* Save the this_command_keys status.  */
        key_count = this_command_key_count;
+       key_count_reset = this_command_key_count_reset;
  
        if (key_count > 0)
        keys = Fcopy_sequence (this_command_keys);
***************
*** 2980,2985 ****
--- 2990,2996 ----
  
        /* Clear out this_command_keys.  */
        this_command_key_count = 0;
+       this_command_key_count_reset = 0;
  
        /* Now wipe the echo area.  */
        if (!NILP (echo_area_buffer[0]))
***************
*** 3002,3007 ****
--- 3013,3019 ----
        /* Restore the saved echoing state
         and this_command_keys state.  */
        this_command_key_count = key_count;
+       this_command_key_count_reset = key_count_reset;
        if (key_count > 0)
        this_command_keys = keys;
  
***************
*** 3051,3057 ****
        goto retry;
      }
  
!   if (this_command_key_count == 0 || ! reread)
      {
  
        /* Don't echo mouse motion events.  */
--- 3063,3070 ----
        goto retry;
      }
  
!   if (! reread || this_command_key_count == 0
!       || this_command_key_count_reset)
      {
  
        /* Don't echo mouse motion events.  */
***************
*** 9404,9409 ****
--- 9417,9423 ----
    if (NILP (continue_echo))
      {
        this_command_key_count = 0;
+       this_command_key_count_reset = 0;
        this_single_command_key_start = 0;
      }
  
***************
*** 9463,9468 ****
--- 9477,9483 ----
    if (NILP (continue_echo))
      {
        this_command_key_count = 0;
+       this_command_key_count_reset = 0;
        this_single_command_key_start = 0;
      }
  
***************
*** 9656,9661 ****
--- 9671,9677 ----
      int i;
  
      this_command_key_count = 0;
+     this_command_key_count_reset = 0;
      this_single_command_key_start = 0;
  
      keys = XVECTOR (saved_keys)->contents;
***************
*** 9891,9914 ****
  
  DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,
         Sreset_this_command_lengths, 0, 0, 0,
!        doc: /* Used for complicated reasons in `universal-argument-other-key'.
  
  `universal-argument-other-key' rereads the event just typed.
  It then gets translated through `function-key-map'.
! The translated event gets included in the echo area and in
! the value of `this-command-keys' in addition to the raw original event.
! That is not right.
! 
! Calling this function directs the translated event to replace
! the original event, so that only one version of the event actually
! appears in the echo area and in the value of `this-command-keys'.  */)
       ()
  {
    this_command_key_count = before_command_key_count;
    if (this_command_key_count < this_single_command_key_start)
      this_single_command_key_start = this_command_key_count;
    echo_truncate (before_command_echo_length);
  
    return Qnil;
  }
  
--- 9907,9934 ----
  
  DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,
         Sreset_this_command_lengths, 0, 0, 0,
!        doc: /* Make the unread events replace the last command and echo.
! Used in `universal-argument-other-key'.
  
  `universal-argument-other-key' rereads the event just typed.
  It then gets translated through `function-key-map'.
! The translated event has to replace the real events,
! both in the value of (this-command-keys) and in echoing.
! To achieve this, `universal-argument-other-key' calls
! `reset-this-command-lengths', which discards the record of reading
! these events the first time.  */)
       ()
  {
    this_command_key_count = before_command_key_count;
    if (this_command_key_count < this_single_command_key_start)
      this_single_command_key_start = this_command_key_count;
+ 
    echo_truncate (before_command_echo_length);
  
+   /* Cause whatever we put into unread-command-events
+      to echo as if it were being freshly read from the keyboard.  */
+   this_command_key_count_reset = 1;
+ 
    return Qnil;
  }
  
***************
*** 9923,9928 ****
--- 9943,9949 ----
    int i;
  
    this_command_key_count = 0;
+   this_command_key_count_reset = 0;
  
    if (NILP (keep_record))
      {




reply via email to

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