if (!current_kboard->immediate_echo)
{
ptrdiff_t i;
- current_kboard->immediate_echo = 1;
+ current_kboard->immediate_echo = true;
for (i = 0; i < this_command_key_count; i++)
{
echo_dash ();
}
- echoing = 1;
+ echoing = true;
/* FIXME: Use call (Qmessage) so it can be advised (e.g. emacspeak). */
message3_nolog (KVAR (current_kboard, echo_string));
- echoing = 0;
+ echoing = false;
/* Record in what buffer we echoed, and from which kboard. */
echo_message_buffer = echo_area_buffer[0];
void
cancel_echoing (void)
{
- current_kboard->immediate_echo = 0;
+ current_kboard->immediate_echo = false;
current_kboard->echo_after_prompt = -1;
kset_echo_string (current_kboard, Qnil);
ok_to_echo_at_next_pause = NULL;
{
current_kboard->kbd_queue
= nconc2 (Vunread_command_events, current_kboard->kbd_queue);
- current_kboard->kbd_queue_has_data = 1;
+ current_kboard->kbd_queue_has_data = true;
}
Vunread_command_events = Qnil;
#endif
- single_kboard = 0;
+ single_kboard = false;
}
/* Switch to the single-kboard state, making current_kboard
void
single_kboard_state ()
{
- single_kboard = 1;
+ single_kboard = true;
}
#endif
not_single_kboard_state (KBOARD *kboard)
{
if (kboard == current_kboard)
- single_kboard = 0;
+ single_kboard = false;
}
/* Maintain a stack of kboards, so other parts of Emacs
{
struct terminal *t;
struct kboard_stack *p = kboard_stack;
- bool found = 0;
+ bool found = false;
for (t = terminal_list; t; t = t->next_terminal)
{
if (t->kboard == p->kboard)
{
current_kboard = p->kboard;
- found = 1;
+ found = true;
break;
}
}
{
/* The terminal we remembered has been deleted. */
current_kboard = FRAME_KBOARD (SELECTED_FRAME ());
- single_kboard = 0;
+ single_kboard = false;
}
kboard_stack = p->next;
xfree (p);
}
else if (f != NULL)
current_kboard = FRAME_KBOARD (f);
- single_kboard = 1;
+ single_kboard = true;
record_unwind_protect_int (restore_kboard_configuration, was_locked);
}
kset_prefix_arg (current_kboard, Qnil);
kset_last_prefix_arg (current_kboard, Qnil);
Vdeactivate_mark = Qnil;
- waiting_for_input = 0;
+ waiting_for_input = false;
cancel_echoing ();
this_command_key_count = 0;
- this_command_key_count_reset = 0;
+ this_command_key_count_reset = false;
this_single_command_key_start = 0;
if (NILP (Vmemory_full))
{
cancel_echoing ();
this_command_key_count = 0;
- this_command_key_count_reset = 0;
+ this_command_key_count_reset = false;
this_single_command_key_start = 0;
goto finalize;
}
kset_last_repeatable_command (current_kboard, Vreal_this_command);
cancel_echoing ();
this_command_key_count = 0;
- this_command_key_count_reset = 0;
+ this_command_key_count_reset = false;
this_single_command_key_start = 0;
}
suppress the point adjustment for automatic composition so that a
user can keep inserting another character at point or keep
deleting characters around point. */
- bool check_composition = ! modified, check_display = 1, check_invisible = 1;
+ bool check_composition = ! modified;
+ bool check_display = true, check_invisible = true;
ptrdiff_t orig_pt = PT;
eassert (XBUFFER (XWINDOW (selected_window)->contents) == current_buffer);
&& (beg = composition_adjust_point (last_pt, PT)) != PT)
{
SET_PT (beg);
- check_display = check_invisible = 1;
+ check_display = check_invisible = true;
}
- check_composition = 0;
+ check_composition = false;
if (check_display
&& PT > BEGV && PT < ZV
&& !NILP (val = get_char_property_and_overlay
? max (beg - 1, BEGV)
: beg)
: end);
- check_composition = check_invisible = 1;
+ check_composition = check_invisible = true;
}
- check_display = 0;
+ check_display = false;
if (check_invisible && PT > BEGV && PT < ZV)
{
int inv;
- bool ellipsis = 0;
+ bool ellipsis = false;
beg = end = PT;
/* Find boundaries `beg' and `end' of the invisible area, if any. */
was already in the range: we don't get to choose
which end of the range we have to go to. */
: (PT < last_pt ? beg : end));
- check_composition = check_display = 1;
+ check_composition = check_display = true;
}
#if 0 /* This assertion isn't correct, because SET_PT may end up setting
the point to something other than its argument, due to
if (!modified && !ellipsis && beg < end)
{
if (last_pt == beg && PT == end && end < ZV)
- (check_composition = check_display = 1, SET_PT (end + 1));
+ (check_composition = check_display = true, SET_PT (end + 1));
else if (last_pt == end && PT == beg && beg > BEGV)
- (check_composition = check_display = 1, SET_PT (beg - 1));
+ (check_composition = check_display = true, SET_PT (beg - 1));
else if (PT == ((PT < last_pt) ? beg : end))
/* We've already moved as far as we can. Trying to go
to the other end would mean moving backwards and thus
(make_number (PT == beg ? end : beg),
Qinvisible, Qnil)),
!TEXT_PROP_MEANS_INVISIBLE (val)))
- (check_composition = check_display = 1,
+ (check_composition = check_display = true,
SET_PT (PT == beg ? end : beg));
}
}
- check_invisible = 0;
+ check_invisible = false;
}
}
if (SYMBOLP (hook))
{
Lisp_Object val;
- bool found = 0;
+ bool found = false;
Lisp_Object newval = Qnil;
for (val = find_symbol_value (hook); CONSP (val); val = XCDR (val))
if (EQ (fun, XCAR (val)))
- found = 1;
+ found = true;
else
newval = Fcons (XCAR (val), newval);
if (found)
: Fdefault_value (hook));
CONSP (val); val = XCDR (val))
if (EQ (fun, XCAR (val)))
- found = 1;
+ found = true;
else
newval = Fcons (XCAR (val), newval);
if (found)
poll_for_input (struct atimer *timer)
{
if (poll_suppress_count == 0)
- pending_signals = 1;
+ pending_signals = true;
}
#endif /* POLL_FOR_INPUT */
struct frame *f = NILP (do_mouse_tracking) ? NULL : some_mouse_moved ();
help = call1 (Qmouse_fixup_help_message, help);
if (f)
- f->mouse_moved = 1;
+ f->mouse_moved = true;
}
if (STRINGP (help) || NILP (help))
#define STOP_POLLING \
do { if (! polling_stopped_here) stop_polling (); \
- polling_stopped_here = 1; } while (0)
+ polling_stopped_here = true; } while (0)
#define RESUME_POLLING \
do { if (polling_stopped_here) start_polling (); \
- polling_stopped_here = 0; } while (0)
+ polling_stopped_here = false; } while (0)
static Lisp_Object
read_event_from_main_queue (struct timespec *end_time,
kset_kbd_queue (kb, list1 (c));
else
XSETCDR (last, list1 (c));
- kb->kbd_queue_has_data = 1;
+ kb->kbd_queue_has_data = true;
c = Qnil;
if (single_kboard)
goto start;
volatile Lisp_Object also_record;
volatile bool reread, recorded;
struct gcpro gcpro1, gcpro2;
- bool volatile polling_stopped_here = 0;
+ bool volatile polling_stopped_here = false;
struct kboard *orig_kboard = current_kboard;
also_record = Qnil;
if (CONSP (Vunread_command_events))
{
- bool was_disabled = 0;
+ bool was_disabled = false;
c = XCAR (Vunread_command_events);
Vunread_command_events = XCDR (Vunread_command_events);
&& EQ (XCDR (c), Qdisabled)
&& (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c))))
{
- was_disabled = 1;
+ was_disabled = true;
c = XCAR (c);
}
/* Also check was_disabled so last-nonmenu-event won't return
a bad value when submenus are involved. (Bug#447) */
&& (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar) || was_disabled))
- *used_mouse_menu = 1;
+ *used_mouse_menu = true;
goto reread_for_input_method;
}
goto reread_for_input_method;
}
- this_command_key_count_reset = 0;
+ this_command_key_count_reset = false;
if (!NILP (Vexecuting_kbd_macro))
{
kset_kbd_queue (kb, list1 (c));
else
XSETCDR (last, list1 (c));
- kb->kbd_queue_has_data = 1;
+ kb->kbd_queue_has_data = true;
current_kboard = kb;
/* This is going to exit from read_char
so we had better get rid of this frame's stuff. */
kset_kbd_queue (current_kboard,
XCDR (KVAR (current_kboard, kbd_queue)));
if (NILP (KVAR (current_kboard, kbd_queue)))
- current_kboard->kbd_queue_has_data = 0;
+ current_kboard->kbd_queue_has_data = false;
input_pending = readable_events (0);
if (EVENT_HAS_PARAMETERS (c)
&& EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qswitch_frame))
/* Clear out this_command_keys. */
this_command_key_count = 0;
- this_command_key_count_reset = 0;
+ this_command_key_count_reset = false;
this_single_command_key_start = 0;
/* Now wipe the echo area. */
kset_kbd_queue
(kb, list2 (make_lispy_switch_frame (event->ie.frame_or_window),
make_number (c)));
- kb->kbd_queue_has_data = 1;
+ kb->kbd_queue_has_data = true;
union buffered_input_event *sp;
for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++)
{
do it now. */
if (immediate_quit && NILP (Vinhibit_quit))
{
- immediate_quit = 0;
+ immediate_quit = false;
QUIT;
}
}
obj = list1 (intern ("ns-unput-working-text"));
kbd_fetch_ptr = event + 1;
if (used_mouse_menu)
- *used_mouse_menu = 1;
+ *used_mouse_menu = true;
}
#endif
&& !EQ (event->ie.frame_or_window, event->ie.arg)
&& (event->kind == MENU_BAR_EVENT
|| event->kind == TOOL_BAR_EVENT))
- *used_mouse_menu = 1;
+ *used_mouse_menu = true;
#endif
#ifdef HAVE_NS
/* Certain system events are non-key events. */
if (used_mouse_menu
&& event->kind == NS_NONKEY_EVENT)
- *used_mouse_menu = 1;
+ *used_mouse_menu = true;
#endif
/* Wipe out this event, to catch bugs. */
gobble_input (void)
{
int nread = 0;
- bool err = 0;
+ bool err = false;
struct terminal *t;
/* Store pending user signal events, if any. */
if (input_blocked_p ())
{
- pending_signals = 1;
+ pending_signals = true;
break;
}
if (nr == -1) /* Not OK to read input now. */
{
- err = 1;
+ err = true;
}
else if (nr == -2) /* Non-transient error. */
{
void
process_pending_signals (void)
{
- pending_signals = 0;
+ pending_signals = false;
handle_async_input ();
do_pending_atimers ();
}
void
handle_input_available_signal (int sig)
{
- pending_signals = 1;
+ pending_signals = true;
if (input_available_clear_time)
*input_available_clear_time = make_timespec (0, 0);
&& strcmp (special_event_name, p->name) == 0)
{
/* Enter the debugger in many ways. */
- debug_on_next_call = 1;
- debug_on_quit = 1;
+ debug_on_next_call = true;
+ debug_on_quit = true;
Vquit_flag = Qt;
Vinhibit_quit = Qnil;
{
struct user_signal_info *p;
struct input_event buf;
- bool buf_initialized = 0;
+ bool buf_initialized = false;
for (p = user_signals; p; p = p->next)
if (p->npending > 0)
memset (&buf, 0, sizeof buf);
buf.kind = USER_SIGNAL_EVENT;
buf.frame_or_window = selected_frame;
- buf_initialized = 1;
+ buf_initialized = true;
}
do
Lisp_Object filter = Qnil;
Lisp_Object caption;
int i;
- bool have_label = 0;
+ bool have_label = false;
/* Definition looks like `(menu-item CAPTION BINDING PROPS...)'.
Rule out items that aren't lists, don't start with
/* `:label LABEL-STRING'. */
set_prop (TOOL_BAR_ITEM_LABEL,
STRINGP (value) ? value : build_string (bad_label));
- have_label = 1;
+ have_label = true;
}
else if (EQ (ikey, QCfilter))
/* ':filter FORM'. */
Lisp_Object prev_event, bool *used_mouse_menu)
{
if (used_mouse_menu)
- *used_mouse_menu = 0;
+ *used_mouse_menu = false;
/* Use local over global Menu maps. */
else if (NILP (value))
value = Qt;
if (used_mouse_menu)
- *used_mouse_menu = 1;
+ *used_mouse_menu = true;
return value;
}
return Qnil ;
/* FIXME: Use the minibuffer's frame width. */
ptrdiff_t width = FRAME_COLS (SELECTED_FRAME ()) - 4;
ptrdiff_t idx = -1;
- bool nobindings = 1;
+ bool nobindings = true;
Lisp_Object rest, vector;
Lisp_Object prompt_strings = Qnil;
/* Present the documented bindings, a line at a time. */
while (1)
{
- bool notfirst = 0;
+ bool notfirst = false;
Lisp_Object menu_strings = prompt_strings;
ptrdiff_t i = nlength;
Lisp_Object obj;
PUSH_C_STR (", ", menu_strings);
i += 2;
}
- notfirst = 1;
- nobindings = 0;
+ notfirst = true;
+ nobindings = false;
/* If the char to type doesn't match the string's
first char, explicitly show what char to type. */
/* True if we are trying to map a key by changing an upper-case
letter to lower case, or a shifted function key to an unshifted
one. */
- bool shift_translated = 0;
+ bool shift_translated = false;
/* If we receive a `switch-frame' or `select-window' event in the middle of
a key sequence, we put it off for later.
int original_uppercase_position = -1;
/* Gets around Microsoft compiler limitations. */
- bool dummyflag = 0;
+ bool dummyflag = false;
struct buffer *starting_buffer;
: (/* indec.start < t || fkey.start < t || */ keytran.start < t))
{
Lisp_Object key;
- bool used_mouse_menu = 0;
+ bool used_mouse_menu = false;
/* Where the last real key started. If we need to throw away a
key that has expanded into more than one element of keybuf
return. Any better way to fix this? -- cyd */
|| (interrupted_kboard != current_kboard))
{
- bool found = 0;
+ bool found = false;
struct kboard *k;
for (k = all_kboards; k; k = k->next_kboard)
if (k == interrupted_kboard)
- found = 1;
+ found = true;
if (!found)
{
t = 0;
/* The Microsoft C compiler can't handle the goto that
would go here. */
- dummyflag = 1;
+ dummyflag = true;
break;
}
might get translated through function-key-map. */
keybuf[t - 1] = new_key;
mock_input = max (t, mock_input);
- shift_translated = 1;
+ shift_translated = true;
goto replay_sequence;
}
read_key_sequence_cmd = Vprefix_help_command;
/* The Microsoft C compiler can't handle the goto that
would go here. */
- dummyflag = 1;
+ dummyflag = true;
break;
}
input-decode-map doesn't need to go through it again. */
fkey.start = fkey.end = 0;
keytran.start = keytran.end = 0;
- shift_translated = 1;
+ shift_translated = true;
goto replay_sequence;
}
&& t - 1 == original_uppercase_position)
{
keybuf[t - 1] = original_uppercase;
- shift_translated = 0;
+ shift_translated = false;
}
if (shift_translated)
if (NILP (continue_echo))
{
this_command_key_count = 0;
- this_command_key_count_reset = 0;
+ this_command_key_count_reset = false;
this_single_command_key_start = 0;
}
void
clear_input_pending (void)
{
- input_pending = 0;
+ input_pending = false;
}
/* Return true if there are pending requeued events.
/* Cause whatever we put into unread-command-events
to echo as if it were being freshly read from the keyboard. */
- this_command_key_count_reset = 1;
+ this_command_key_count_reset = true;
return Qnil;
}
int i;
this_command_key_count = 0;
- this_command_key_count_reset = 0;
+ this_command_key_count_reset = false;
if (NILP (keep_record))
{
discard_tty_input ();
kbd_fetch_ptr = kbd_store_ptr;
- input_pending = 0;
+ input_pending = false;
return Qnil;
}
clear_event (kbd_fetch_ptr);
}
- input_pending = 0;
+ input_pending = false;
#endif /* SIGTSTP */
}
\f
input_available_clear_time = time_to_clear;
/* Tell handle_interrupt to throw back to read_char, */
- waiting_for_input = 1;
+ waiting_for_input = true;
/* If handle_interrupt was called before and buffered a C-g,
make it run again now, to avoid timing error. */
clear_waiting_for_input (void)
{
/* Tell handle_interrupt not to throw back to read_char, */
- waiting_for_input = 0;
+ waiting_for_input = false;
input_available_clear_time = 0;
}
struct gl_state_s saved;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- immediate_quit = 0;
+ immediate_quit = false;
pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
saved = gl_state;
GCPRO4 (saved.object, saved.global_code,
force_quit_count = count;
if (count == 3)
{
- immediate_quit = 1;
+ immediate_quit = true;
Vinhibit_quit = Qnil;
}
Vquit_flag = Qt;
/* Prevent another signal from doing this before we finish. */
clear_waiting_for_input ();
- input_pending = 0;
+ input_pending = false;
Vunread_command_events = Qnil;
{
/* When using X, don't give the user a real choice,
because we haven't implemented the mechanisms to support it. */
- new_interrupt_input = 1;
+ new_interrupt_input = true;
}
else
#endif /* HAVE_X_WINDOWS */
new_interrupt_input = !NILP (interrupt);
#else /* not USABLE_SIGIO */
- new_interrupt_input = 0;
+ new_interrupt_input = false;
#endif /* not USABLE_SIGIO */
if (new_interrupt_input != interrupt_input)
kset_prefix_arg (kb, Qnil);
kset_last_prefix_arg (kb, Qnil);
kset_kbd_queue (kb, Qnil);
- kb->kbd_queue_has_data = 0;
- kb->immediate_echo = 0;
+ kb->kbd_queue_has_data = false;
+ kb->immediate_echo = false;
kset_echo_string (kb, Qnil);
kb->echo_after_prompt = -1;
kb->kbd_macro_buffer = 0;
&& FRAME_LIVE_P (XFRAME (selected_frame)))
{
current_kboard = FRAME_KBOARD (XFRAME (selected_frame));
- single_kboard = 0;
+ single_kboard = false;
if (current_kboard == kb)
emacs_abort ();
}
{
/* This is correct before outermost invocation of the editor loop. */
command_loop_level = -1;
- immediate_quit = 0;
+ immediate_quit = false;
quit_char = Ctl ('g');
Vunread_command_events = Qnil;
timer_idleness_start_time = invalid_timespec ();
kbd_fetch_ptr = kbd_buffer;
kbd_store_ptr = kbd_buffer;
do_mouse_tracking = Qnil;
- input_pending = 0;
+ input_pending = false;
interrupt_input_blocked = 0;
- pending_signals = 0;
+ pending_signals = false;
/* This means that command_loop_1 won't try to select anything the first
time through. */
DEFVAR_BOOL ("cannot-suspend", cannot_suspend,
doc: /* Non-nil means to always spawn a subshell instead of suspending.
\(Even if the operating system has support for stopping a process.\) */);
- cannot_suspend = 0;
+ cannot_suspend = false;
DEFVAR_BOOL ("menu-prompting", menu_prompting,
doc: /* Non-nil means prompt with menus when appropriate.
if X menus were enabled at configuration
time and the previous event was a mouse click prefix key.
Otherwise, menu prompting uses the echo area. */);
- menu_prompting = 1;
+ menu_prompting = true;
DEFVAR_LISP ("menu-prompt-more-char", menu_prompt_more_char,
doc: /* Character to see next line of menu prompt.