aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-09-27 02:28:15 +0000
committerKarl Heuer1994-09-27 02:28:15 +0000
commit8c18cbfbef6cc23e65d264200536960977d48cc5 (patch)
treeefaae8bcde0c052de74bf88552979314e26e0251
parent416349ecf28b2a8b883aad1d798f0118265bc40c (diff)
downloademacs-8c18cbfbef6cc23e65d264200536960977d48cc5.tar.gz
emacs-8c18cbfbef6cc23e65d264200536960977d48cc5.zip
(echo_char, cmd_error_internal, command_loop_1, read_char,
kbd_buffer_get_event, make_lispy_event, make_lispy_movement, map_prompt, menu_bar_one_keymap, menu_bar_item, read_char_minibuf_menu_prompt, follow_key, read_key_sequence, Fcommand_execute, Fexecute_extended_command, stuff_buffered_input, quit_throw_to_read_char, Fset_input_mode): Use type test macros.
-rw-r--r--src/keyboard.c123
1 files changed, 60 insertions, 63 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 027026f0c7e..0edf29bd3bd 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -543,14 +543,14 @@ echo_char (c)
543 /* If someone has passed us a composite event, use its head symbol. */ 543 /* If someone has passed us a composite event, use its head symbol. */
544 c = EVENT_HEAD (c); 544 c = EVENT_HEAD (c);
545 545
546 if (XTYPE (c) == Lisp_Int) 546 if (INTEGERP (c))
547 { 547 {
548 if (ptr - echobuf > sizeof echobuf - 6) 548 if (ptr - echobuf > sizeof echobuf - 6)
549 return; 549 return;
550 550
551 ptr = push_key_description (XINT (c), ptr); 551 ptr = push_key_description (XINT (c), ptr);
552 } 552 }
553 else if (XTYPE (c) == Lisp_Symbol) 553 else if (SYMBOLP (c))
554 { 554 {
555 struct Lisp_String *name = XSYMBOL (c)->name; 555 struct Lisp_String *name = XSYMBOL (c)->name;
556 if (((ptr - echobuf) + name->size + 4) > sizeof echobuf) 556 if (((ptr - echobuf) + name->size + 4) > sizeof echobuf)
@@ -820,7 +820,7 @@ cmd_error_internal (data, context)
820 if (!NILP (file_error) && !NILP (tail)) 820 if (!NILP (file_error) && !NILP (tail))
821 errmsg = XCONS (tail)->car, tail = XCONS (tail)->cdr; 821 errmsg = XCONS (tail)->car, tail = XCONS (tail)->cdr;
822 822
823 if (XTYPE (errmsg) == Lisp_String) 823 if (STRINGP (errmsg))
824 Fprinc (errmsg, stream); 824 Fprinc (errmsg, stream);
825 else 825 else
826 write_string_1 ("peculiar error", -1, stream); 826 write_string_1 ("peculiar error", -1, stream);
@@ -1031,7 +1031,7 @@ command_loop_1 ()
1031 switch-frame events will take care of this, but if some lisp 1031 switch-frame events will take care of this, but if some lisp
1032 code swallows a switch-frame event, we'll fix things up here. 1032 code swallows a switch-frame event, we'll fix things up here.
1033 Is this a good idea? */ 1033 Is this a good idea? */
1034 if (XTYPE (internal_last_event_frame) == Lisp_Frame 1034 if (FRAMEP (internal_last_event_frame)
1035 && XFRAME (internal_last_event_frame) != selected_frame) 1035 && XFRAME (internal_last_event_frame) != selected_frame)
1036 Fselect_frame (internal_last_event_frame, Qnil); 1036 Fselect_frame (internal_last_event_frame, Qnil);
1037#endif 1037#endif
@@ -1162,7 +1162,7 @@ command_loop_1 ()
1162 } 1162 }
1163 else if (EQ (this_command, Qself_insert_command) 1163 else if (EQ (this_command, Qself_insert_command)
1164 /* Try this optimization only on ascii keystrokes. */ 1164 /* Try this optimization only on ascii keystrokes. */
1165 && XTYPE (last_command_char) == Lisp_Int) 1165 && INTEGERP (last_command_char))
1166 { 1166 {
1167 unsigned char c = XINT (last_command_char); 1167 unsigned char c = XINT (last_command_char);
1168 int value; 1168 int value;
@@ -1211,10 +1211,10 @@ command_loop_1 ()
1211 if (lose >= 0x20 && lose <= 0x7e) 1211 if (lose >= 0x20 && lose <= 0x7e)
1212 no_redisplay = direct_output_for_insert (lose); 1212 no_redisplay = direct_output_for_insert (lose);
1213 } 1213 }
1214 else if (XTYPE (obj) == Lisp_Vector 1214 else if (VECTORP (obj)
1215 && XVECTOR (obj)->size == 1 1215 && XVECTOR (obj)->size == 1
1216 && (XTYPE (obj = XVECTOR (obj)->contents[0]) 1216 && (obj = XVECTOR (obj)->contents[0],
1217 == Lisp_Int) 1217 INTEGERP (obj))
1218 /* Insist face not specified in glyph. */ 1218 /* Insist face not specified in glyph. */
1219 && (XINT (obj) & ((-1) << 8)) == 0) 1219 && (XINT (obj) & ((-1) << 8)) == 0)
1220 no_redisplay 1220 no_redisplay
@@ -1535,7 +1535,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1535 } 1535 }
1536 1536
1537 c = Faref (Vexecuting_macro, make_number (executing_macro_index)); 1537 c = Faref (Vexecuting_macro, make_number (executing_macro_index));
1538 if (XTYPE (Vexecuting_macro) == Lisp_String 1538 if (STRINGP (Vexecuting_macro)
1539 && (XINT (c) & 0x80)) 1539 && (XINT (c) & 0x80))
1540 XFASTINT (c) = CHAR_META | (XINT (c) & ~0x80); 1540 XFASTINT (c) = CHAR_META | (XINT (c) & ~0x80);
1541 1541
@@ -1676,7 +1676,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1676 /* Auto save if enough time goes by without input. */ 1676 /* Auto save if enough time goes by without input. */
1677 if (commandflag != 0 1677 if (commandflag != 0
1678 && num_nonmacro_input_chars > last_auto_save 1678 && num_nonmacro_input_chars > last_auto_save
1679 && XTYPE (Vauto_save_timeout) == Lisp_Int 1679 && INTEGERP (Vauto_save_timeout)
1680 && XINT (Vauto_save_timeout) > 0) 1680 && XINT (Vauto_save_timeout) > 0)
1681 { 1681 {
1682 Lisp_Object tem0; 1682 Lisp_Object tem0;
@@ -1718,10 +1718,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1718 } 1718 }
1719 1719
1720 /* Terminate Emacs in batch mode if at eof. */ 1720 /* Terminate Emacs in batch mode if at eof. */
1721 if (noninteractive && XTYPE (c) == Lisp_Int && XINT (c) < 0) 1721 if (noninteractive && INTEGERP (c) && XINT (c) < 0)
1722 Fkill_emacs (make_number (1)); 1722 Fkill_emacs (make_number (1));
1723 1723
1724 if (XTYPE (c) == Lisp_Int) 1724 if (INTEGERP (c))
1725 { 1725 {
1726 /* Add in any extra modifiers, where appropriate. */ 1726 /* Add in any extra modifiers, where appropriate. */
1727 if ((extra_keyboard_modifiers & CHAR_CTL) 1727 if ((extra_keyboard_modifiers & CHAR_CTL)
@@ -1743,7 +1743,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1743 1743
1744 /* Buffer switch events are only for internal wakeups 1744 /* Buffer switch events are only for internal wakeups
1745 so don't show them to the user. */ 1745 so don't show them to the user. */
1746 if (XTYPE (c) == Lisp_Buffer) 1746 if (BUFFERP (c))
1747 return c; 1747 return c;
1748 1748
1749 if (key_already_recorded) 1749 if (key_already_recorded)
@@ -1753,13 +1753,13 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1753 echo_area_glyphs = 0; 1753 echo_area_glyphs = 0;
1754 1754
1755 /* Handle things that only apply to characters. */ 1755 /* Handle things that only apply to characters. */
1756 if (XTYPE (c) == Lisp_Int) 1756 if (INTEGERP (c))
1757 { 1757 {
1758 /* If kbd_buffer_get_event gave us an EOF, return that. */ 1758 /* If kbd_buffer_get_event gave us an EOF, return that. */
1759 if (XINT (c) == -1) 1759 if (XINT (c) == -1)
1760 return c; 1760 return c;
1761 1761
1762 if (XTYPE (Vkeyboard_translate_table) == Lisp_String 1762 if (STRINGP (Vkeyboard_translate_table)
1763 && XSTRING (Vkeyboard_translate_table)->size > XFASTINT (c)) 1763 && XSTRING (Vkeyboard_translate_table)->size > XFASTINT (c))
1764 XSETINT (c, XSTRING (Vkeyboard_translate_table)->data[XFASTINT (c)]); 1764 XSETINT (c, XSTRING (Vkeyboard_translate_table)->data[XFASTINT (c)]);
1765 } 1765 }
@@ -1774,7 +1774,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1774 If you, dear reader, have a better idea, you've got the source. :-) */ 1774 If you, dear reader, have a better idea, you've got the source. :-) */
1775 if (dribble) 1775 if (dribble)
1776 { 1776 {
1777 if (XTYPE (c) == Lisp_Int) 1777 if (INTEGERP (c))
1778 { 1778 {
1779 if (XUINT (c) < 0x100) 1779 if (XUINT (c) < 0x100)
1780 putc (XINT (c), dribble); 1780 putc (XINT (c), dribble);
@@ -1788,7 +1788,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1788 /* If it's a structured event, take the event header. */ 1788 /* If it's a structured event, take the event header. */
1789 dribblee = EVENT_HEAD (c); 1789 dribblee = EVENT_HEAD (c);
1790 1790
1791 if (XTYPE (dribblee) == Lisp_Symbol) 1791 if (SYMBOLP (dribblee))
1792 { 1792 {
1793 putc ('<', dribble); 1793 putc ('<', dribble);
1794 fwrite (XSYMBOL (dribblee)->name->data, sizeof (char), 1794 fwrite (XSYMBOL (dribblee)->name->data, sizeof (char),
@@ -1831,13 +1831,13 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1831 Fcurrent_window_configuration (Qnil)); 1831 Fcurrent_window_configuration (Qnil));
1832 1832
1833 tem0 = Feval (Vhelp_form); 1833 tem0 = Feval (Vhelp_form);
1834 if (XTYPE (tem0) == Lisp_String) 1834 if (STRINGP (tem0))
1835 internal_with_output_to_temp_buffer ("*Help*", print_help, tem0); 1835 internal_with_output_to_temp_buffer ("*Help*", print_help, tem0);
1836 1836
1837 cancel_echoing (); 1837 cancel_echoing ();
1838 do 1838 do
1839 c = read_char (0, 0, 0, Qnil, 0); 1839 c = read_char (0, 0, 0, Qnil, 0);
1840 while (XTYPE (c) == Lisp_Buffer); 1840 while (BUFFERP (c));
1841 /* Remove the help from the frame */ 1841 /* Remove the help from the frame */
1842 unbind_to (count, Qnil); 1842 unbind_to (count, Qnil);
1843 prepare_menu_bars (); 1843 prepare_menu_bars ();
@@ -1847,7 +1847,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1847 cancel_echoing (); 1847 cancel_echoing ();
1848 do 1848 do
1849 c = read_char (0, 0, 0, Qnil, 0); 1849 c = read_char (0, 0, 0, Qnil, 0);
1850 while (XTYPE (c) == Lisp_Buffer); 1850 while (BUFFERP (c));
1851 } 1851 }
1852 } 1852 }
1853 1853
@@ -2138,7 +2138,7 @@ kbd_buffer_get_event ()
2138 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) 2138 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
2139 { 2139 {
2140 frame = XCONS (tail)->car; 2140 frame = XCONS (tail)->car;
2141 if (XTYPE (frame) != Lisp_Frame || EQ (frame, event->frame_or_window)) 2141 if (!FRAMEP (frame) || EQ (frame, event->frame_or_window))
2142 continue; 2142 continue;
2143 f = XFRAME (frame); 2143 f = XFRAME (frame);
2144 if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)) 2144 if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f))
@@ -2179,7 +2179,7 @@ kbd_buffer_get_event ()
2179 Lisp_Object focus; 2179 Lisp_Object focus;
2180 2180
2181 frame = event->frame_or_window; 2181 frame = event->frame_or_window;
2182 if (XTYPE (frame) == Lisp_Window) 2182 if (WINDOWP (frame))
2183 frame = WINDOW_FRAME (XWINDOW (frame)); 2183 frame = WINDOW_FRAME (XWINDOW (frame));
2184 2184
2185 focus = FRAME_FOCUS_FRAME (XFRAME (frame)); 2185 focus = FRAME_FOCUS_FRAME (XFRAME (frame));
@@ -2714,7 +2714,7 @@ make_lispy_event (event)
2714 2714
2715 window = window_from_coordinates (f, column, row, &part); 2715 window = window_from_coordinates (f, column, row, &part);
2716 2716
2717 if (XTYPE (window) != Lisp_Window) 2717 if (!WINDOWP (window))
2718 { 2718 {
2719 window = event->frame_or_window; 2719 window = event->frame_or_window;
2720 posn = Qnil; 2720 posn = Qnil;
@@ -2808,12 +2808,12 @@ make_lispy_event (event)
2808 of the button that chose the menu item 2808 of the button that chose the menu item
2809 as a separate event. */ 2809 as a separate event. */
2810 2810
2811 if (XTYPE (start_pos) != Lisp_Cons) 2811 if (!CONSP (start_pos))
2812 return Qnil; 2812 return Qnil;
2813 2813
2814 event->modifiers &= ~up_modifier; 2814 event->modifiers &= ~up_modifier;
2815#if 0 /* Formerly we treated an up with no down as a click event. */ 2815#if 0 /* Formerly we treated an up with no down as a click event. */
2816 if (XTYPE (start_pos) != Lisp_Cons) 2816 if (!CONSP (start_pos))
2817 event->modifiers |= click_modifier; 2817 event->modifiers |= click_modifier;
2818 else 2818 else
2819#endif 2819#endif
@@ -2928,7 +2928,7 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
2928 else 2928 else
2929 window = Qnil; 2929 window = Qnil;
2930 2930
2931 if (XTYPE (window) == Lisp_Window) 2931 if (WINDOWP (window))
2932 { 2932 {
2933 int pixcolumn, pixrow; 2933 int pixcolumn, pixrow;
2934 column -= XINT (XWINDOW (window)->left); 2934 column -= XINT (XWINDOW (window)->left);
@@ -3721,7 +3721,7 @@ map_prompt (map)
3721 { 3721 {
3722 register Lisp_Object tem; 3722 register Lisp_Object tem;
3723 tem = Fcar (map); 3723 tem = Fcar (map);
3724 if (XTYPE (tem) == Lisp_String) 3724 if (STRINGP (tem))
3725 return tem; 3725 return tem;
3726 map = Fcdr (map); 3726 map = Fcdr (map);
3727 } 3727 }
@@ -3886,23 +3886,23 @@ menu_bar_one_keymap (keymap)
3886 Lisp_Object tail, item, key, binding, item_string, table; 3886 Lisp_Object tail, item, key, binding, item_string, table;
3887 3887
3888 /* Loop over all keymap entries that have menu strings. */ 3888 /* Loop over all keymap entries that have menu strings. */
3889 for (tail = keymap; XTYPE (tail) == Lisp_Cons; tail = XCONS (tail)->cdr) 3889 for (tail = keymap; CONSP (tail); tail = XCONS (tail)->cdr)
3890 { 3890 {
3891 item = XCONS (tail)->car; 3891 item = XCONS (tail)->car;
3892 if (XTYPE (item) == Lisp_Cons) 3892 if (CONSP (item))
3893 { 3893 {
3894 key = XCONS (item)->car; 3894 key = XCONS (item)->car;
3895 binding = XCONS (item)->cdr; 3895 binding = XCONS (item)->cdr;
3896 if (XTYPE (binding) == Lisp_Cons) 3896 if (CONSP (binding))
3897 { 3897 {
3898 item_string = XCONS (binding)->car; 3898 item_string = XCONS (binding)->car;
3899 if (XTYPE (item_string) == Lisp_String) 3899 if (STRINGP (item_string))
3900 menu_bar_item (key, item_string, Fcdr (binding)); 3900 menu_bar_item (key, item_string, Fcdr (binding));
3901 } 3901 }
3902 else if (EQ (binding, Qundefined)) 3902 else if (EQ (binding, Qundefined))
3903 menu_bar_item (key, Qnil, binding); 3903 menu_bar_item (key, Qnil, binding);
3904 } 3904 }
3905 else if (XTYPE (item) == Lisp_Vector) 3905 else if (VECTORP (item))
3906 { 3906 {
3907 /* Loop over the char values represented in the vector. */ 3907 /* Loop over the char values represented in the vector. */
3908 int len = XVECTOR (item)->size; 3908 int len = XVECTOR (item)->size;
@@ -3912,10 +3912,10 @@ menu_bar_one_keymap (keymap)
3912 Lisp_Object character; 3912 Lisp_Object character;
3913 XFASTINT (character) = c; 3913 XFASTINT (character) = c;
3914 binding = XVECTOR (item)->contents[c]; 3914 binding = XVECTOR (item)->contents[c];
3915 if (XTYPE (binding) == Lisp_Cons) 3915 if (CONSP (binding))
3916 { 3916 {
3917 item_string = XCONS (binding)->car; 3917 item_string = XCONS (binding)->car;
3918 if (XTYPE (item_string) == Lisp_String) 3918 if (STRINGP (item_string))
3919 menu_bar_item (key, item_string, Fcdr (binding)); 3919 menu_bar_item (key, item_string, Fcdr (binding));
3920 } 3920 }
3921 else if (EQ (binding, Qundefined)) 3921 else if (EQ (binding, Qundefined))
@@ -3969,7 +3969,7 @@ menu_bar_item (key, item_string, def)
3969 /* See if this entry is enabled. */ 3969 /* See if this entry is enabled. */
3970 enabled = Qt; 3970 enabled = Qt;
3971 3971
3972 if (XTYPE (def) == Lisp_Symbol) 3972 if (SYMBOLP (def))
3973 { 3973 {
3974 /* No property, or nil, means enable. 3974 /* No property, or nil, means enable.
3975 Otherwise, enable if value is not nil. */ 3975 Otherwise, enable if value is not nil. */
@@ -4182,7 +4182,7 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
4182 else 4182 else
4183 elt = Fcar_safe (rest); 4183 elt = Fcar_safe (rest);
4184 4184
4185 if (idx < 0 && XTYPE (elt) == Lisp_Vector) 4185 if (idx < 0 && VECTORP (elt))
4186 { 4186 {
4187 /* If we found a dense table in the keymap, 4187 /* If we found a dense table in the keymap,
4188 advanced past it, but start scanning its contents. */ 4188 advanced past it, but start scanning its contents. */
@@ -4197,7 +4197,7 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
4197 s = Fcar_safe (Fcdr_safe (elt)); /* alist */ 4197 s = Fcar_safe (Fcdr_safe (elt)); /* alist */
4198 else 4198 else
4199 s = Fcar_safe(elt); /* vector */ 4199 s = Fcar_safe(elt); /* vector */
4200 if (XTYPE (s) != Lisp_String) 4200 if (!STRINGP (s))
4201 /* Ignore the element if it has no prompt string. */ 4201 /* Ignore the element if it has no prompt string. */
4202 ; 4202 ;
4203 /* If we have room for the prompt string, add it to this line. 4203 /* If we have room for the prompt string, add it to this line.
@@ -4254,16 +4254,16 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
4254 defining_kbd_macro = 0 ; 4254 defining_kbd_macro = 0 ;
4255 do 4255 do
4256 obj = read_char (commandflag, 0, 0, Qnil, 0); 4256 obj = read_char (commandflag, 0, 0, Qnil, 0);
4257 while (XTYPE (obj) == Lisp_Buffer); 4257 while (BUFFERP (obj));
4258 defining_kbd_macro = orig_defn_macro ; 4258 defining_kbd_macro = orig_defn_macro ;
4259 4259
4260 if (XTYPE (obj) != Lisp_Int) 4260 if (!INTEGERP (obj))
4261 return obj; 4261 return obj;
4262 else 4262 else
4263 ch = XINT (obj); 4263 ch = XINT (obj);
4264 4264
4265 if (! EQ (obj, menu_prompt_more_char) 4265 if (! EQ (obj, menu_prompt_more_char)
4266 && (XTYPE (menu_prompt_more_char) != Lisp_Int 4266 && (!INTEGERP (menu_prompt_more_char)
4267 || ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char)))))) 4267 || ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char))))))
4268 { 4268 {
4269 if ( defining_kbd_macro ) 4269 if ( defining_kbd_macro )
@@ -4301,7 +4301,7 @@ follow_key (key, nmaps, current, defs, next)
4301 4301
4302 /* If KEY is a meta ASCII character, treat it like meta-prefix-char 4302 /* If KEY is a meta ASCII character, treat it like meta-prefix-char
4303 followed by the corresponding non-meta character. */ 4303 followed by the corresponding non-meta character. */
4304 if (XTYPE (key) == Lisp_Int && (XINT (key) & CHAR_META)) 4304 if (INTEGERP (key) && (XINT (key) & CHAR_META))
4305 { 4305 {
4306 for (i = 0; i < nmaps; i++) 4306 for (i = 0; i < nmaps; i++)
4307 if (! NILP (current[i])) 4307 if (! NILP (current[i]))
@@ -4639,7 +4639,7 @@ read_key_sequence (keybuf, bufsize, prompt)
4639 /* read_char returns -1 at the end of a macro. 4639 /* read_char returns -1 at the end of a macro.
4640 Emacs 18 handles this by returning immediately with a 4640 Emacs 18 handles this by returning immediately with a
4641 zero, so that's what we'll do. */ 4641 zero, so that's what we'll do. */
4642 if (XTYPE (key) == Lisp_Int && XINT (key) == -1) 4642 if (INTEGERP (key) && XINT (key) == -1)
4643 { 4643 {
4644 t = 0; 4644 t = 0;
4645 goto done; 4645 goto done;
@@ -4647,7 +4647,7 @@ read_key_sequence (keybuf, bufsize, prompt)
4647 4647
4648 /* If the current buffer has been changed from under us, the 4648 /* If the current buffer has been changed from under us, the
4649 keymap may have changed, so replay the sequence. */ 4649 keymap may have changed, so replay the sequence. */
4650 if (XTYPE (key) == Lisp_Buffer) 4650 if (BUFFERP (key))
4651 { 4651 {
4652 mock_input = t; 4652 mock_input = t;
4653 goto replay_sequence; 4653 goto replay_sequence;
@@ -4692,7 +4692,7 @@ read_key_sequence (keybuf, bufsize, prompt)
4692 4692
4693 window = POSN_WINDOW (EVENT_START (key)); 4693 window = POSN_WINDOW (EVENT_START (key));
4694 posn = POSN_BUFFER_POSN (EVENT_START (key)); 4694 posn = POSN_BUFFER_POSN (EVENT_START (key));
4695 if (XTYPE (posn) == Lisp_Cons) 4695 if (CONSP (posn))
4696 { 4696 {
4697 /* We're looking at the second event of a 4697 /* We're looking at the second event of a
4698 sequence which we expanded before. Set 4698 sequence which we expanded before. Set
@@ -4706,8 +4706,8 @@ read_key_sequence (keybuf, bufsize, prompt)
4706 not the current buffer. If we're at the 4706 not the current buffer. If we're at the
4707 beginning of a key sequence, switch buffers. */ 4707 beginning of a key sequence, switch buffers. */
4708 if (last_real_key_start == 0 4708 if (last_real_key_start == 0
4709 && XTYPE (window) == Lisp_Window 4709 && WINDOWP (window)
4710 && XTYPE (XWINDOW (window)->buffer) == Lisp_Buffer 4710 && BUFFERP (XWINDOW (window)->buffer)
4711 && XBUFFER (XWINDOW (window)->buffer) != current_buffer) 4711 && XBUFFER (XWINDOW (window)->buffer) != current_buffer)
4712 { 4712 {
4713 keybuf[t] = key; 4713 keybuf[t] = key;
@@ -4728,7 +4728,7 @@ read_key_sequence (keybuf, bufsize, prompt)
4728 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); 4728 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
4729 goto replay_sequence; 4729 goto replay_sequence;
4730 } 4730 }
4731 else if (XTYPE (posn) == Lisp_Symbol) 4731 else if (SYMBOLP (posn))
4732 { 4732 {
4733 /* Expand mode-line and scroll-bar events into two events: 4733 /* Expand mode-line and scroll-bar events into two events:
4734 use posn as a fake prefix key. */ 4734 use posn as a fake prefix key. */
@@ -4788,7 +4788,7 @@ read_key_sequence (keybuf, bufsize, prompt)
4788 mock_input = t + 2; 4788 mock_input = t + 2;
4789 goto replay_sequence; 4789 goto replay_sequence;
4790 } 4790 }
4791 else if (XTYPE (posn) == Lisp_Cons) 4791 else if (CONSP (posn))
4792 { 4792 {
4793 /* We're looking at the second event of a 4793 /* We're looking at the second event of a
4794 sequence which we expanded before. Set 4794 sequence which we expanded before. Set
@@ -4822,7 +4822,7 @@ read_key_sequence (keybuf, bufsize, prompt)
4822 goto done; 4822 goto done;
4823 } 4823 }
4824 4824
4825 if (XTYPE (head) == Lisp_Symbol) 4825 if (SYMBOLP (head))
4826 { 4826 {
4827 Lisp_Object breakdown; 4827 Lisp_Object breakdown;
4828 int modifiers; 4828 int modifiers;
@@ -4949,7 +4949,7 @@ read_key_sequence (keybuf, bufsize, prompt)
4949 key = keybuf[fkey_end++]; 4949 key = keybuf[fkey_end++];
4950 /* Look up meta-characters by prefixing them 4950 /* Look up meta-characters by prefixing them
4951 with meta_prefix_char. I hate this. */ 4951 with meta_prefix_char. I hate this. */
4952 if (XTYPE (key) == Lisp_Int && XINT (key) & meta_modifier) 4952 if (INTEGERP (key) && XINT (key) & meta_modifier)
4953 { 4953 {
4954 fkey_next 4954 fkey_next
4955 = get_keymap_1 4955 = get_keymap_1
@@ -5053,7 +5053,7 @@ read_key_sequence (keybuf, bufsize, prompt)
5053 key = keybuf[keytran_end++]; 5053 key = keybuf[keytran_end++];
5054 /* Look up meta-characters by prefixing them 5054 /* Look up meta-characters by prefixing them
5055 with meta_prefix_char. I hate this. */ 5055 with meta_prefix_char. I hate this. */
5056 if (XTYPE (key) == Lisp_Int && XINT (key) & meta_modifier) 5056 if (INTEGERP (key) && XINT (key) & meta_modifier)
5057 { 5057 {
5058 keytran_next 5058 keytran_next
5059 = get_keymap_1 5059 = get_keymap_1
@@ -5139,7 +5139,7 @@ read_key_sequence (keybuf, bufsize, prompt)
5139 and is an upper case letter 5139 and is an upper case letter
5140 use the corresponding lower-case letter instead. */ 5140 use the corresponding lower-case letter instead. */
5141 if (first_binding == nmaps && ! function_key_possible 5141 if (first_binding == nmaps && ! function_key_possible
5142 && XTYPE (key) == Lisp_Int 5142 && INTEGERP (key)
5143 && ((((XINT (key) & 0x3ffff) 5143 && ((((XINT (key) & 0x3ffff)
5144 < XSTRING (current_buffer->downcase_table)->size) 5144 < XSTRING (current_buffer->downcase_table)->size)
5145 && UPPERCASEP (XINT (key) & 0x3ffff)) 5145 && UPPERCASEP (XINT (key) & 0x3ffff))
@@ -5272,7 +5272,7 @@ Otherwise, that is done only if an arg is read using the minibuffer.")
5272 Vcurrent_prefix_arg = prefixarg; 5272 Vcurrent_prefix_arg = prefixarg;
5273 debug_on_next_call = 0; 5273 debug_on_next_call = 0;
5274 5274
5275 if (XTYPE (cmd) == Lisp_Symbol) 5275 if (SYMBOLP (cmd))
5276 { 5276 {
5277 tem = Fget (cmd, Qdisabled); 5277 tem = Fget (cmd, Qdisabled);
5278 if (!NILP (tem) && !NILP (Vrun_hooks)) 5278 if (!NILP (tem) && !NILP (Vrun_hooks))
@@ -5289,8 +5289,7 @@ Otherwise, that is done only if an arg is read using the minibuffer.")
5289 break; 5289 break;
5290 } 5290 }
5291 5291
5292 if (XTYPE (final) == Lisp_String 5292 if (STRINGP (final) || VECTORP (final))
5293 || XTYPE (final) == Lisp_Vector)
5294 { 5293 {
5295 /* If requested, place the macro in the command history. For 5294 /* If requested, place the macro in the command history. For
5296 other sorts of commands, call-interactively takes care of 5295 other sorts of commands, call-interactively takes care of
@@ -5303,8 +5302,7 @@ Otherwise, that is done only if an arg is read using the minibuffer.")
5303 5302
5304 return Fexecute_kbd_macro (final, prefixarg); 5303 return Fexecute_kbd_macro (final, prefixarg);
5305 } 5304 }
5306 if (CONSP (final) || XTYPE (final) == Lisp_Subr 5305 if (CONSP (final) || SUBRP (final) || COMPILEDP (final))
5307 || XTYPE (final) == Lisp_Compiled)
5308 { 5306 {
5309 backtrace.next = backtrace_list; 5307 backtrace.next = backtrace_list;
5310 backtrace_list = &backtrace; 5308 backtrace_list = &backtrace;
@@ -5341,9 +5339,9 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_
5341 strcpy (buf, "- "); 5339 strcpy (buf, "- ");
5342 else if (CONSP (prefixarg) && XINT (XCONS (prefixarg)->car) == 4) 5340 else if (CONSP (prefixarg) && XINT (XCONS (prefixarg)->car) == 4)
5343 strcpy (buf, "C-u "); 5341 strcpy (buf, "C-u ");
5344 else if (CONSP (prefixarg) && XTYPE (XCONS (prefixarg)->car) == Lisp_Int) 5342 else if (CONSP (prefixarg) && INTEGERP (XCONS (prefixarg)->car))
5345 sprintf (buf, "%d ", XINT (XCONS (prefixarg)->car)); 5343 sprintf (buf, "%d ", XINT (XCONS (prefixarg)->car));
5346 else if (XTYPE (prefixarg) == Lisp_Int) 5344 else if (INTEGERP (prefixarg))
5347 sprintf (buf, "%d ", XINT (prefixarg)); 5345 sprintf (buf, "%d ", XINT (prefixarg));
5348 5346
5349 /* This isn't strictly correct if execute-extended-command 5347 /* This isn't strictly correct if execute-extended-command
@@ -5574,7 +5572,7 @@ stuff_buffered_input (stuffstring)
5574/* stuff_char works only in BSD, versions 4.2 and up. */ 5572/* stuff_char works only in BSD, versions 4.2 and up. */
5575#ifdef BSD 5573#ifdef BSD
5576#ifndef BSD4_1 5574#ifndef BSD4_1
5577 if (XTYPE (stuffstring) == Lisp_String) 5575 if (STRINGP (stuffstring))
5578 { 5576 {
5579 register int count; 5577 register int count;
5580 5578
@@ -5762,7 +5760,7 @@ quit_throw_to_read_char ()
5762 abort (); 5760 abort ();
5763#endif 5761#endif
5764#ifdef MULTI_FRAME 5762#ifdef MULTI_FRAME
5765 if (XTYPE (internal_last_event_frame) == Lisp_Frame 5763 if (FRAMEP (internal_last_event_frame)
5766 && XFRAME (internal_last_event_frame) != selected_frame) 5764 && XFRAME (internal_last_event_frame) != selected_frame)
5767 Fhandle_switch_frame (make_lispy_switch_frame (internal_last_event_frame)); 5765 Fhandle_switch_frame (make_lispy_switch_frame (internal_last_event_frame));
5768#endif 5766#endif
@@ -5785,8 +5783,7 @@ See also `current-input-mode'.")
5785 Lisp_Object interrupt, flow, meta, quit; 5783 Lisp_Object interrupt, flow, meta, quit;
5786{ 5784{
5787 if (!NILP (quit) 5785 if (!NILP (quit)
5788 && (XTYPE (quit) != Lisp_Int 5786 && (!INTEGERP (quit) || XINT (quit) < 0 || XINT (quit) > 0400))
5789 || XINT (quit) < 0 || XINT (quit) > 0400))
5790 error ("set-input-mode: QUIT must be an ASCII character"); 5787 error ("set-input-mode: QUIT must be an ASCII character");
5791 5788
5792#ifdef POLL_FOR_INPUT 5789#ifdef POLL_FOR_INPUT