changeset 10907:1e9ffdb9980c

(read_char_minibuf_menu_prompt): orig_defn_macro is now Lisp_Object, not int. (init_perdisplay): Initialize some of the new members. (wipe_perdisplay): Free kbd_macro_buffer.
author Karl Heuer <kwzh@gnu.org>
date Fri, 03 Mar 1995 05:01:27 +0000
parents 7601ae23cf92
children b09674057bb2
files src/keyboard.c
diffstat 1 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Fri Mar 03 02:50:16 1995 +0000
+++ b/src/keyboard.c	Fri Mar 03 05:01:27 1995 +0000
@@ -1173,7 +1173,7 @@
 	{
 	  /* nil means key is undefined.  */
 	  bitch_at_user ();
-	  defining_kbd_macro = 0;
+	  current_perdisplay->defining_kbd_macro = Qnil;
 	  update_mode_lines = 1;
 	  clear_prefix_arg ();
 	}
@@ -1392,7 +1392,7 @@
     finalize:
       /* Install chars successfully executed in kbd macro.  */
 
-      if (defining_kbd_macro && NILP (Vprefix_arg))
+      if (!NILP (current_perdisplay->defining_kbd_macro) && NILP (Vprefix_arg))
 	finalize_kbd_macro_chars ();
 
 #ifdef MULTI_PERDISPLAY
@@ -4581,7 +4581,7 @@
       int i = nlength;
       Lisp_Object obj;
       int ch;
-      int orig_defn_macro ;
+      Lisp_Object orig_defn_macro;
 
       /* Loop over elements of map.  */
       while (i < width)
@@ -4676,12 +4676,12 @@
 	 is pressed.  Help characters are not recorded because menu prompting
 	 is not used on replay.
 	 */
-      orig_defn_macro = defining_kbd_macro ;
-      defining_kbd_macro = 0 ;
+      orig_defn_macro = current_perdisplay->defining_kbd_macro;
+      current_perdisplay->defining_kbd_macro = Qnil;
       do
 	obj = read_char (commandflag, 0, 0, Qnil, 0);
       while (BUFFERP (obj));
-      defining_kbd_macro = orig_defn_macro ;
+      current_perdisplay->defining_kbd_macro = orig_defn_macro;
 
       if (!INTEGERP (obj))
 	return obj;
@@ -4692,8 +4692,8 @@
 	  && (!INTEGERP (menu_prompt_more_char)
 	      || ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char))))))
 	{
-	  if ( defining_kbd_macro )
-	    store_kbd_macro_char(obj) ;
+	  if (!NILP (current_perdisplay->defining_kbd_macro))
+	    store_kbd_macro_char (obj);
 	  return obj;
 	}
       /* Help char - go round again */
@@ -6038,7 +6038,7 @@
 Also cancel any kbd macro being defined.")
   ()
 {
-  defining_kbd_macro = 0;
+  current_perdisplay->defining_kbd_macro = Qnil;
   update_mode_lines++;
 
   Vunread_command_events = Qnil;
@@ -6422,6 +6422,9 @@
   perd->immediate_echo = 0;
   perd->echoptr = perd->echobuf;
   perd->echo_after_prompt = -1;
+  perd->kbd_macro_buffer = 0;
+  perd->kbd_macro_bufsize = 0;
+  perd->defining_kbd_macro = Qnil;
 }
 
 /*
@@ -6433,8 +6436,8 @@
 wipe_perdisplay (perd)
      PERDISPLAY *perd;
 {
-  /* Free anything that was malloc'd in init_perdisplay.  */
-  /* Placeholder -- currently no action required.  */
+  if (perd->kbd_macro_buffer)
+    xfree (perd->kbd_macro_buffer);
 }
 
 init_keyboard ()