changeset 18886:c24b5da01b1f

(Fcommand_execute): gcpro c.
author Richard M. Stallman <rms@gnu.org>
date Sun, 20 Jul 1997 17:46:17 +0000
parents f7b6579204b8
children 63da9a245413
files src/keyboard.c
diffstat 1 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Sun Jul 20 17:44:22 1997 +0000
+++ b/src/keyboard.c	Sun Jul 20 17:46:17 1997 +0000
@@ -1698,18 +1698,22 @@
      Lisp_Object prev_event;
      int *used_mouse_menu;
 {
-  register Lisp_Object c;
+  Lisp_Object c;
   int count;
   jmp_buf local_getcjmp;
   jmp_buf save_jump;
   int key_already_recorded = 0;
   Lisp_Object tem, save;
   Lisp_Object also_record;
+  struct gcpro gcpro1;
+
   also_record = Qnil;
 
   before_command_key_count = this_command_key_count;
   before_command_echo_length = echo_length ();
 
+  GCPRO1 (c);
+
  retry:
 
   if (CONSP (Vunread_command_events))
@@ -1766,7 +1770,7 @@
 	  || executing_macro_index >= XFASTINT (Flength (Vexecuting_macro)))
 	{
 	  XSETINT (c, -1);
-	  return c;
+	  RETURN_UNGCPRO (c);
 	}
 
       c = Faref (Vexecuting_macro, make_number (executing_macro_index));
@@ -1929,7 +1933,7 @@
       /* Now that we have read an event, Emacs is not idle.  */
       timer_stop_idle ();
 
-      return c;
+      RETURN_UNGCPRO (c);
     }
 
   /* Maybe autosave and/or garbage collect due to idleness.  */
@@ -2104,12 +2108,10 @@
  non_reread_1:
 
   /* Buffer switch events are only for internal wakeups
-     so don't show them to the user.  */
-  if (BUFFERP (c))
-    return c;
-
-  if (key_already_recorded)
-    return c;
+     so don't show them to the user.
+     Also, don't record a key if we already did.  */
+  if (BUFFERP (c) || key_already_recorded)
+    RETURN_UNGCPRO (c);
 
   /* Process special events within read_char
      and loop around to read another event.  */
@@ -2143,7 +2145,7 @@
     {
       /* If kbd_buffer_get_event gave us an EOF, return that.  */
       if (XINT (c) == -1)
-	return c;
+	RETURN_UNGCPRO (c);
 
       if (STRINGP (Vkeyboard_translate_table)
 	  && XSTRING (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c))
@@ -2189,8 +2191,11 @@
   if (! NILP (also_record))
     record_char (also_record);
 
+  UNGCPRO;
+
  from_macro:
  reread_first:
+
   before_command_key_count = this_command_key_count;
   before_command_echo_length = echo_length ();
 
@@ -2247,7 +2252,7 @@
 	}
     }
 
-  return c;
+  RETURN_UNGCPRO (c);
 }
 
 /* Record a key that came from a mouse menu.