/* If someone has passed us a composite event, use its head symbol. */
c = EVENT_HEAD (c);
- if (XTYPE (c) == Lisp_Int)
+ if (INTEGERP (c))
{
if (ptr - echobuf > sizeof echobuf - 6)
return;
ptr = push_key_description (XINT (c), ptr);
}
- else if (XTYPE (c) == Lisp_Symbol)
+ else if (SYMBOLP (c))
{
struct Lisp_String *name = XSYMBOL (c)->name;
if (((ptr - echobuf) + name->size + 4) > sizeof echobuf)
if (!NILP (file_error) && !NILP (tail))
errmsg = XCONS (tail)->car, tail = XCONS (tail)->cdr;
- if (XTYPE (errmsg) == Lisp_String)
+ if (STRINGP (errmsg))
Fprinc (errmsg, stream);
else
write_string_1 ("peculiar error", -1, stream);
switch-frame events will take care of this, but if some lisp
code swallows a switch-frame event, we'll fix things up here.
Is this a good idea? */
- if (XTYPE (internal_last_event_frame) == Lisp_Frame
+ if (FRAMEP (internal_last_event_frame)
&& XFRAME (internal_last_event_frame) != selected_frame)
Fselect_frame (internal_last_event_frame, Qnil);
#endif
}
else if (EQ (this_command, Qself_insert_command)
/* Try this optimization only on ascii keystrokes. */
- && XTYPE (last_command_char) == Lisp_Int)
+ && INTEGERP (last_command_char))
{
unsigned char c = XINT (last_command_char);
int value;
if (lose >= 0x20 && lose <= 0x7e)
no_redisplay = direct_output_for_insert (lose);
}
- else if (XTYPE (obj) == Lisp_Vector
+ else if (VECTORP (obj)
&& XVECTOR (obj)->size == 1
- && (XTYPE (obj = XVECTOR (obj)->contents[0])
- == Lisp_Int)
+ && (obj = XVECTOR (obj)->contents[0],
+ INTEGERP (obj))
/* Insist face not specified in glyph. */
&& (XINT (obj) & ((-1) << 8)) == 0)
no_redisplay
}
c = Faref (Vexecuting_macro, make_number (executing_macro_index));
- if (XTYPE (Vexecuting_macro) == Lisp_String
+ if (STRINGP (Vexecuting_macro)
&& (XINT (c) & 0x80))
XFASTINT (c) = CHAR_META | (XINT (c) & ~0x80);
/* Auto save if enough time goes by without input. */
if (commandflag != 0
&& num_nonmacro_input_chars > last_auto_save
- && XTYPE (Vauto_save_timeout) == Lisp_Int
+ && INTEGERP (Vauto_save_timeout)
&& XINT (Vauto_save_timeout) > 0)
{
Lisp_Object tem0;
}
/* Terminate Emacs in batch mode if at eof. */
- if (noninteractive && XTYPE (c) == Lisp_Int && XINT (c) < 0)
+ if (noninteractive && INTEGERP (c) && XINT (c) < 0)
Fkill_emacs (make_number (1));
- if (XTYPE (c) == Lisp_Int)
+ if (INTEGERP (c))
{
/* Add in any extra modifiers, where appropriate. */
if ((extra_keyboard_modifiers & CHAR_CTL)
/* Buffer switch events are only for internal wakeups
so don't show them to the user. */
- if (XTYPE (c) == Lisp_Buffer)
+ if (BUFFERP (c))
return c;
if (key_already_recorded)
echo_area_glyphs = 0;
/* Handle things that only apply to characters. */
- if (XTYPE (c) == Lisp_Int)
+ if (INTEGERP (c))
{
/* If kbd_buffer_get_event gave us an EOF, return that. */
if (XINT (c) == -1)
return c;
- if (XTYPE (Vkeyboard_translate_table) == Lisp_String
+ if (STRINGP (Vkeyboard_translate_table)
&& XSTRING (Vkeyboard_translate_table)->size > XFASTINT (c))
XSETINT (c, XSTRING (Vkeyboard_translate_table)->data[XFASTINT (c)]);
}
If you, dear reader, have a better idea, you've got the source. :-) */
if (dribble)
{
- if (XTYPE (c) == Lisp_Int)
+ if (INTEGERP (c))
{
if (XUINT (c) < 0x100)
putc (XINT (c), dribble);
/* If it's a structured event, take the event header. */
dribblee = EVENT_HEAD (c);
- if (XTYPE (dribblee) == Lisp_Symbol)
+ if (SYMBOLP (dribblee))
{
putc ('<', dribble);
fwrite (XSYMBOL (dribblee)->name->data, sizeof (char),
Fcurrent_window_configuration (Qnil));
tem0 = Feval (Vhelp_form);
- if (XTYPE (tem0) == Lisp_String)
+ if (STRINGP (tem0))
internal_with_output_to_temp_buffer ("*Help*", print_help, tem0);
cancel_echoing ();
do
c = read_char (0, 0, 0, Qnil, 0);
- while (XTYPE (c) == Lisp_Buffer);
+ while (BUFFERP (c));
/* Remove the help from the frame */
unbind_to (count, Qnil);
prepare_menu_bars ();
cancel_echoing ();
do
c = read_char (0, 0, 0, Qnil, 0);
- while (XTYPE (c) == Lisp_Buffer);
+ while (BUFFERP (c));
}
}
for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
{
frame = XCONS (tail)->car;
- if (XTYPE (frame) != Lisp_Frame || EQ (frame, event->frame_or_window))
+ if (!FRAMEP (frame) || EQ (frame, event->frame_or_window))
continue;
f = XFRAME (frame);
if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f))
Lisp_Object focus;
frame = event->frame_or_window;
- if (XTYPE (frame) == Lisp_Window)
+ if (WINDOWP (frame))
frame = WINDOW_FRAME (XWINDOW (frame));
focus = FRAME_FOCUS_FRAME (XFRAME (frame));
window = window_from_coordinates (f, column, row, &part);
- if (XTYPE (window) != Lisp_Window)
+ if (!WINDOWP (window))
{
window = event->frame_or_window;
posn = Qnil;
of the button that chose the menu item
as a separate event. */
- if (XTYPE (start_pos) != Lisp_Cons)
+ if (!CONSP (start_pos))
return Qnil;
event->modifiers &= ~up_modifier;
#if 0 /* Formerly we treated an up with no down as a click event. */
- if (XTYPE (start_pos) != Lisp_Cons)
+ if (!CONSP (start_pos))
event->modifiers |= click_modifier;
else
#endif
else
window = Qnil;
- if (XTYPE (window) == Lisp_Window)
+ if (WINDOWP (window))
{
int pixcolumn, pixrow;
column -= XINT (XWINDOW (window)->left);
{
register Lisp_Object tem;
tem = Fcar (map);
- if (XTYPE (tem) == Lisp_String)
+ if (STRINGP (tem))
return tem;
map = Fcdr (map);
}
Lisp_Object tail, item, key, binding, item_string, table;
/* Loop over all keymap entries that have menu strings. */
- for (tail = keymap; XTYPE (tail) == Lisp_Cons; tail = XCONS (tail)->cdr)
+ for (tail = keymap; CONSP (tail); tail = XCONS (tail)->cdr)
{
item = XCONS (tail)->car;
- if (XTYPE (item) == Lisp_Cons)
+ if (CONSP (item))
{
key = XCONS (item)->car;
binding = XCONS (item)->cdr;
- if (XTYPE (binding) == Lisp_Cons)
+ if (CONSP (binding))
{
item_string = XCONS (binding)->car;
- if (XTYPE (item_string) == Lisp_String)
+ if (STRINGP (item_string))
menu_bar_item (key, item_string, Fcdr (binding));
}
else if (EQ (binding, Qundefined))
menu_bar_item (key, Qnil, binding);
}
- else if (XTYPE (item) == Lisp_Vector)
+ else if (VECTORP (item))
{
/* Loop over the char values represented in the vector. */
int len = XVECTOR (item)->size;
Lisp_Object character;
XFASTINT (character) = c;
binding = XVECTOR (item)->contents[c];
- if (XTYPE (binding) == Lisp_Cons)
+ if (CONSP (binding))
{
item_string = XCONS (binding)->car;
- if (XTYPE (item_string) == Lisp_String)
+ if (STRINGP (item_string))
menu_bar_item (key, item_string, Fcdr (binding));
}
else if (EQ (binding, Qundefined))
/* See if this entry is enabled. */
enabled = Qt;
- if (XTYPE (def) == Lisp_Symbol)
+ if (SYMBOLP (def))
{
/* No property, or nil, means enable.
Otherwise, enable if value is not nil. */
else
elt = Fcar_safe (rest);
- if (idx < 0 && XTYPE (elt) == Lisp_Vector)
+ if (idx < 0 && VECTORP (elt))
{
/* If we found a dense table in the keymap,
advanced past it, but start scanning its contents. */
s = Fcar_safe (Fcdr_safe (elt)); /* alist */
else
s = Fcar_safe(elt); /* vector */
- if (XTYPE (s) != Lisp_String)
+ if (!STRINGP (s))
/* Ignore the element if it has no prompt string. */
;
/* If we have room for the prompt string, add it to this line.
defining_kbd_macro = 0 ;
do
obj = read_char (commandflag, 0, 0, Qnil, 0);
- while (XTYPE (obj) == Lisp_Buffer);
+ while (BUFFERP (obj));
defining_kbd_macro = orig_defn_macro ;
- if (XTYPE (obj) != Lisp_Int)
+ if (!INTEGERP (obj))
return obj;
else
ch = XINT (obj);
if (! EQ (obj, menu_prompt_more_char)
- && (XTYPE (menu_prompt_more_char) != Lisp_Int
+ && (!INTEGERP (menu_prompt_more_char)
|| ! EQ (obj, make_number (Ctl (XINT (menu_prompt_more_char))))))
{
if ( defining_kbd_macro )
/* If KEY is a meta ASCII character, treat it like meta-prefix-char
followed by the corresponding non-meta character. */
- if (XTYPE (key) == Lisp_Int && (XINT (key) & CHAR_META))
+ if (INTEGERP (key) && (XINT (key) & CHAR_META))
{
for (i = 0; i < nmaps; i++)
if (! NILP (current[i]))
/* read_char returns -1 at the end of a macro.
Emacs 18 handles this by returning immediately with a
zero, so that's what we'll do. */
- if (XTYPE (key) == Lisp_Int && XINT (key) == -1)
+ if (INTEGERP (key) && XINT (key) == -1)
{
t = 0;
goto done;
/* If the current buffer has been changed from under us, the
keymap may have changed, so replay the sequence. */
- if (XTYPE (key) == Lisp_Buffer)
+ if (BUFFERP (key))
{
mock_input = t;
goto replay_sequence;
window = POSN_WINDOW (EVENT_START (key));
posn = POSN_BUFFER_POSN (EVENT_START (key));
- if (XTYPE (posn) == Lisp_Cons)
+ if (CONSP (posn))
{
/* We're looking at the second event of a
sequence which we expanded before. Set
not the current buffer. If we're at the
beginning of a key sequence, switch buffers. */
if (last_real_key_start == 0
- && XTYPE (window) == Lisp_Window
- && XTYPE (XWINDOW (window)->buffer) == Lisp_Buffer
+ && WINDOWP (window)
+ && BUFFERP (XWINDOW (window)->buffer)
&& XBUFFER (XWINDOW (window)->buffer) != current_buffer)
{
keybuf[t] = key;
set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
goto replay_sequence;
}
- else if (XTYPE (posn) == Lisp_Symbol)
+ else if (SYMBOLP (posn))
{
/* Expand mode-line and scroll-bar events into two events:
use posn as a fake prefix key. */
mock_input = t + 2;
goto replay_sequence;
}
- else if (XTYPE (posn) == Lisp_Cons)
+ else if (CONSP (posn))
{
/* We're looking at the second event of a
sequence which we expanded before. Set
goto done;
}
- if (XTYPE (head) == Lisp_Symbol)
+ if (SYMBOLP (head))
{
Lisp_Object breakdown;
int modifiers;
key = keybuf[fkey_end++];
/* Look up meta-characters by prefixing them
with meta_prefix_char. I hate this. */
- if (XTYPE (key) == Lisp_Int && XINT (key) & meta_modifier)
+ if (INTEGERP (key) && XINT (key) & meta_modifier)
{
fkey_next
= get_keymap_1
key = keybuf[keytran_end++];
/* Look up meta-characters by prefixing them
with meta_prefix_char. I hate this. */
- if (XTYPE (key) == Lisp_Int && XINT (key) & meta_modifier)
+ if (INTEGERP (key) && XINT (key) & meta_modifier)
{
keytran_next
= get_keymap_1
and is an upper case letter
use the corresponding lower-case letter instead. */
if (first_binding == nmaps && ! function_key_possible
- && XTYPE (key) == Lisp_Int
+ && INTEGERP (key)
&& ((((XINT (key) & 0x3ffff)
< XSTRING (current_buffer->downcase_table)->size)
&& UPPERCASEP (XINT (key) & 0x3ffff))
Vcurrent_prefix_arg = prefixarg;
debug_on_next_call = 0;
- if (XTYPE (cmd) == Lisp_Symbol)
+ if (SYMBOLP (cmd))
{
tem = Fget (cmd, Qdisabled);
if (!NILP (tem) && !NILP (Vrun_hooks))
break;
}
- if (XTYPE (final) == Lisp_String
- || XTYPE (final) == Lisp_Vector)
+ if (STRINGP (final) || VECTORP (final))
{
/* If requested, place the macro in the command history. For
other sorts of commands, call-interactively takes care of
return Fexecute_kbd_macro (final, prefixarg);
}
- if (CONSP (final) || XTYPE (final) == Lisp_Subr
- || XTYPE (final) == Lisp_Compiled)
+ if (CONSP (final) || SUBRP (final) || COMPILEDP (final))
{
backtrace.next = backtrace_list;
backtrace_list = &backtrace;
strcpy (buf, "- ");
else if (CONSP (prefixarg) && XINT (XCONS (prefixarg)->car) == 4)
strcpy (buf, "C-u ");
- else if (CONSP (prefixarg) && XTYPE (XCONS (prefixarg)->car) == Lisp_Int)
+ else if (CONSP (prefixarg) && INTEGERP (XCONS (prefixarg)->car))
sprintf (buf, "%d ", XINT (XCONS (prefixarg)->car));
- else if (XTYPE (prefixarg) == Lisp_Int)
+ else if (INTEGERP (prefixarg))
sprintf (buf, "%d ", XINT (prefixarg));
/* This isn't strictly correct if execute-extended-command
/* stuff_char works only in BSD, versions 4.2 and up. */
#ifdef BSD
#ifndef BSD4_1
- if (XTYPE (stuffstring) == Lisp_String)
+ if (STRINGP (stuffstring))
{
register int count;
abort ();
#endif
#ifdef MULTI_FRAME
- if (XTYPE (internal_last_event_frame) == Lisp_Frame
+ if (FRAMEP (internal_last_event_frame)
&& XFRAME (internal_last_event_frame) != selected_frame)
Fhandle_switch_frame (make_lispy_switch_frame (internal_last_event_frame));
#endif
Lisp_Object interrupt, flow, meta, quit;
{
if (!NILP (quit)
- && (XTYPE (quit) != Lisp_Int
- || XINT (quit) < 0 || XINT (quit) > 0400))
+ && (!INTEGERP (quit) || XINT (quit) < 0 || XINT (quit) > 0400))
error ("set-input-mode: QUIT must be an ASCII character");
#ifdef POLL_FOR_INPUT