comparison src/keyboard.c @ 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 70de58691fd2
children 4d587fff2aa0
comparison
equal deleted inserted replaced
10906:7601ae23cf92 10907:1e9ffdb9980c
1171 1171
1172 if (NILP (this_command)) 1172 if (NILP (this_command))
1173 { 1173 {
1174 /* nil means key is undefined. */ 1174 /* nil means key is undefined. */
1175 bitch_at_user (); 1175 bitch_at_user ();
1176 defining_kbd_macro = 0; 1176 current_perdisplay->defining_kbd_macro = Qnil;
1177 update_mode_lines = 1; 1177 update_mode_lines = 1;
1178 clear_prefix_arg (); 1178 clear_prefix_arg ();
1179 } 1179 }
1180 else 1180 else
1181 { 1181 {
1390 } 1390 }
1391 1391
1392 finalize: 1392 finalize:
1393 /* Install chars successfully executed in kbd macro. */ 1393 /* Install chars successfully executed in kbd macro. */
1394 1394
1395 if (defining_kbd_macro && NILP (Vprefix_arg)) 1395 if (!NILP (current_perdisplay->defining_kbd_macro) && NILP (Vprefix_arg))
1396 finalize_kbd_macro_chars (); 1396 finalize_kbd_macro_chars ();
1397 1397
1398 #ifdef MULTI_PERDISPLAY 1398 #ifdef MULTI_PERDISPLAY
1399 if (!was_locked) 1399 if (!was_locked)
1400 unlock_display (); 1400 unlock_display ();
4579 { 4579 {
4580 int notfirst = 0; 4580 int notfirst = 0;
4581 int i = nlength; 4581 int i = nlength;
4582 Lisp_Object obj; 4582 Lisp_Object obj;
4583 int ch; 4583 int ch;
4584 int orig_defn_macro ; 4584 Lisp_Object orig_defn_macro;
4585 4585
4586 /* Loop over elements of map. */ 4586 /* Loop over elements of map. */
4587 while (i < width) 4587 while (i < width)
4588 { 4588 {
4589 Lisp_Object s, elt; 4589 Lisp_Object s, elt;
4674 4674
4675 /* Make believe its not a keyboard macro in case the help char 4675 /* Make believe its not a keyboard macro in case the help char
4676 is pressed. Help characters are not recorded because menu prompting 4676 is pressed. Help characters are not recorded because menu prompting
4677 is not used on replay. 4677 is not used on replay.
4678 */ 4678 */
4679 orig_defn_macro = defining_kbd_macro ; 4679 orig_defn_macro = current_perdisplay->defining_kbd_macro;
4680 defining_kbd_macro = 0 ; 4680 current_perdisplay->defining_kbd_macro = Qnil;
4681 do 4681 do
4682 obj = read_char (commandflag, 0, 0, Qnil, 0); 4682 obj = read_char (commandflag, 0, 0, Qnil, 0);
4683 while (BUFFERP (obj)); 4683 while (BUFFERP (obj));
4684 defining_kbd_macro = orig_defn_macro ; 4684 current_perdisplay->defining_kbd_macro = orig_defn_macro;
4685 4685
4686 if (!INTEGERP (obj)) 4686 if (!INTEGERP (obj))
4687 return obj; 4687 return obj;
4688 else 4688 else
4689 ch = XINT (obj); 4689 ch = XINT (obj);
4690 4690
4691 if (! EQ (obj, menu_prompt_more_char) 4691 if (! EQ (obj, menu_prompt_more_char)
4692 && (!INTEGERP (menu_prompt_more_char) 4692 && (!INTEGERP (menu_prompt_more_char)
4693 || ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char)))))) 4693 || ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char))))))
4694 { 4694 {
4695 if ( defining_kbd_macro ) 4695 if (!NILP (current_perdisplay->defining_kbd_macro))
4696 store_kbd_macro_char(obj) ; 4696 store_kbd_macro_char (obj);
4697 return obj; 4697 return obj;
4698 } 4698 }
4699 /* Help char - go round again */ 4699 /* Help char - go round again */
4700 } 4700 }
4701 } 4701 }
6036 DEFUN ("discard-input", Fdiscard_input, Sdiscard_input, 0, 0, 0, 6036 DEFUN ("discard-input", Fdiscard_input, Sdiscard_input, 0, 0, 0,
6037 "Discard the contents of the terminal input buffer.\n\ 6037 "Discard the contents of the terminal input buffer.\n\
6038 Also cancel any kbd macro being defined.") 6038 Also cancel any kbd macro being defined.")
6039 () 6039 ()
6040 { 6040 {
6041 defining_kbd_macro = 0; 6041 current_perdisplay->defining_kbd_macro = Qnil;
6042 update_mode_lines++; 6042 update_mode_lines++;
6043 6043
6044 Vunread_command_events = Qnil; 6044 Vunread_command_events = Qnil;
6045 unread_command_char = -1; 6045 unread_command_char = -1;
6046 6046
6420 perd->prefix_partial = 0; 6420 perd->prefix_partial = 0;
6421 perd->kbd_queue = Qnil; 6421 perd->kbd_queue = Qnil;
6422 perd->immediate_echo = 0; 6422 perd->immediate_echo = 0;
6423 perd->echoptr = perd->echobuf; 6423 perd->echoptr = perd->echobuf;
6424 perd->echo_after_prompt = -1; 6424 perd->echo_after_prompt = -1;
6425 perd->kbd_macro_buffer = 0;
6426 perd->kbd_macro_bufsize = 0;
6427 perd->defining_kbd_macro = Qnil;
6425 } 6428 }
6426 6429
6427 /* 6430 /*
6428 * Destroy the contents of a perdisplay object, but not the object itself. 6431 * Destroy the contents of a perdisplay object, but not the object itself.
6429 * We use this just before deleteing it, or if we're going to initialize 6432 * We use this just before deleteing it, or if we're going to initialize
6431 */ 6434 */
6432 void 6435 void
6433 wipe_perdisplay (perd) 6436 wipe_perdisplay (perd)
6434 PERDISPLAY *perd; 6437 PERDISPLAY *perd;
6435 { 6438 {
6436 /* Free anything that was malloc'd in init_perdisplay. */ 6439 if (perd->kbd_macro_buffer)
6437 /* Placeholder -- currently no action required. */ 6440 xfree (perd->kbd_macro_buffer);
6438 } 6441 }
6439 6442
6440 init_keyboard () 6443 init_keyboard ()
6441 { 6444 {
6442 /* This is correct before outermost invocation of the editor loop */ 6445 /* This is correct before outermost invocation of the editor loop */