+2014-12-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Various fixes to use bool type and constants.
+ * dispnew.c (update_single_window): Remove arg `force_p' since it's
+ always true.
+ * xfaces.c (clear_face_cache): Use bool for the argument type.
+
2014-12-15 Paul Eggert <eggert@cs.ucla.edu>
Correct same_at_end when restoring window points
New feature optionally to accelerate auto-repeated scrolling.
- * xdisp.c: Remove "static" from declaration of
- Qfontification_functions.
+ * xdisp.c: Remove "static" from declaration of Qfontification_functions.
- * window.c (window_scroll): bind fontification-functions to nil
+ * window.c (window_scroll): Bind fontification-functions to nil
when scrolling by whole screens and
fast-but-imprecise-scrolling is non-nil.
- (syms_of_window): New DEFVAR_BOOL
- fast-but-imprecise-scrolling.
+ (syms_of_window): New DEFVAR_BOOL fast-but-imprecise-scrolling.
* lisp.h (bool): Declare Qfontification_functions extern.
[GNUTLS >= 3.0.20]: Declare for WINDOWSNT.
(init_gnutls_functions)(gnutls_certificate_set_x509_system_trust)
[GNUTLS >= 3.0.20]: Load from shared library for WINDOWSNT.
- (fn_gnutls_certificate_set_x509_system_trust) [!WINDOWSNT]: Define
- new macro.
- (Fgnutls_boot) [GNUTLS >= 3.0.20]: Call
- gnutls_certificate_set_x509_system_trust. Log an error message if
+ (fn_gnutls_certificate_set_x509_system_trust) [!WINDOWSNT]:
+ Define new macro.
+ (Fgnutls_boot) [GNUTLS >= 3.0.20]:
+ Call gnutls_certificate_set_x509_system_trust. Log an error message if
it fails.
2014-12-13 Paul Eggert <eggert@cs.ucla.edu>
2014-12-13 Eli Zaretskii <eliz@gnu.org>
- * gnutls.c (Fgnutls_available_p, syms_of_gnutls): Move
- gnutls-available-p out of the HAVE_GNUTLS conditional, and define
+ * gnutls.c (Fgnutls_available_p, syms_of_gnutls):
+ Move gnutls-available-p out of the HAVE_GNUTLS conditional, and define
them only once.
2014-12-13 Teodor Zlatanov <tzz@lifelogs.com>
2014-12-13 Eli Zaretskii <eliz@gnu.org>
- * xdisp.c (move_it_in_display_line_to, display_line): Don't
- disallow overflow-newline-into-fringe when word-wrap is in
+ * xdisp.c (move_it_in_display_line_to, display_line):
+ Don't disallow overflow-newline-into-fringe when word-wrap is in
effect. (Bug#19300)
2014-12-11 Stefan Monnier <monnier@iro.umontreal.ca>
(process_coding.dst_pos_byte
+ process_coding.produced),
0);
- display_on_the_fly = 0;
+ display_on_the_fly = false;
process_coding = saved_coding;
carryover = nread;
/* Make the above condition always fail in the future. */
/* This variable might have been set to 0 for code
detection. In that case, set it back to 1 because
we should have already detected a coding system. */
- display_on_the_fly = 1;
+ display_on_the_fly = true;
}
- immediate_quit = 1;
+ immediate_quit = true;
QUIT;
}
give_up: ;
void update_face_from_frame_parameter (struct frame *, Lisp_Object,
Lisp_Object);
Lisp_Object tty_color_name (struct frame *, int);
-void clear_face_cache (int);
+void clear_face_cache (bool);
unsigned long load_color (struct frame *, struct face *, Lisp_Object,
enum lface_attribute_index);
char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object,
#endif /* HAVE_WINDOW_SYSTEM */
-/* Defined in xmenu.c */
+/* Defined in xmenu.c. */
int popup_activated (void);
-/* Defined in dispnew.c */
+/* Defined in dispnew.c. */
extern Lisp_Object buffer_posn_from_coords (struct window *,
int *, int *,
void clear_glyph_matrix_rows (struct glyph_matrix *, int, int);
void clear_glyph_row (struct glyph_row *);
void prepare_desired_row (struct window *, struct glyph_row *, bool);
-void update_single_window (struct window *, bool);
+void update_single_window (struct window *);
void do_pending_window_change (bool);
void change_frame_size (struct frame *, int, int, bool, bool, bool, bool);
void init_display (void);
extern void spec_glyph_lookup_face (struct window *, GLYPH *);
extern void fill_up_frame_row_with_spaces (struct glyph_row *, int);
-/* Defined in terminal.c */
+/* Defined in terminal.c. */
extern void ring_bell (struct frame *);
extern void update_begin (struct frame *);
struct window *root_window = XWINDOW (f->root_window);
if (redisplay_dont_pause)
- force_p = 1;
+ force_p = true;
else if (!force_p && detect_input_pending_ignore_squeezables ())
{
- paused_p = 1;
+ paused_p = true;
goto do_pause;
}
/* Update the menu bar on X frames that don't have toolkit
support. */
if (WINDOWP (f->menu_bar_window))
- update_window (XWINDOW (f->menu_bar_window), 1);
+ update_window (XWINDOW (f->menu_bar_window), true);
#endif
#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
{
Lisp_Object tem;
- update_window (w, 1);
+ update_window (w, true);
w->must_be_updated_p = false;
/* Swap tool-bar strings. We swap because we want to
/* Build F's desired matrix from window matrices. */
build_frame_matrix (f);
- /* Update the display */
+ /* Update the display. */
update_begin (f);
paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p, 1);
update_end (f);
If FORCE_P, don't stop updating if input is pending. */
void
-update_single_window (struct window *w, bool force_p)
+update_single_window (struct window *w)
{
if (w->must_be_updated_p)
{
/* Record that this is not a frame-based redisplay. */
set_frame_matrix_frame (NULL);
- if (redisplay_dont_pause)
- force_p = 1;
-
/* Update W. */
update_begin (f);
- update_window (w, force_p);
+ update_window (w, true);
update_end (f);
/* Reset flag in W. */
Vstandard_display_table = Qnil;
DEFVAR_BOOL ("redisplay-dont-pause", redisplay_dont_pause,
- doc: /* Non-nil means display update isn't paused when input is detected. */);
- redisplay_dont_pause = 1;
+ doc: /* Nil means display update is paused when input is detected. */);
+ /* Contrary to expectations, a value of "false" can be detrimental to
+ responsiveness since aborting a redisplay throws away some of the
+ work already performed. It's usually more efficient (and gives
+ more prompt feedback to the user) to let the redisplay terminate,
+ and just completely skip the next command's redisplay (which is
+ done regardless of this setting if there's pending input at the
+ beginning of the next redisplay). */
+ redisplay_dont_pause = true;
#ifdef CANNOT_DUMP
if (noninteractive)
/* File in which we write all commands we read. */
static FILE *dribble;
-/* Nonzero if input is available. */
+/* True if input is available. */
bool input_pending;
/* Circular buffer for pre-read keyboard input. */
/* commandflag 0 means do not autosave, but do redisplay.
-1 means do not redisplay, but do autosave.
-2 means do neither.
- 1 means do both. */
+ 1 means do both.
-/* The argument MAP is a keymap for menu prompting.
+ The argument MAP is a keymap for menu prompting.
PREV_EVENT is the previous input event, or nil if we are reading
the first event of a key sequence (or not reading a key sequence).
Lisp_Object obj;
#ifdef subprocesses
- if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4)
+ if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE / 4)
{
/* Start reading input again because we have processed enough to
be able to accept new events again. */
{
XWINDOW (minibuf_window)->cursor.hpos = 0;
XWINDOW (minibuf_window)->cursor.x = 0;
- XWINDOW (minibuf_window)->must_be_updated_p = 1;
- update_frame (XFRAME (selected_frame), 1, 1);
+ XWINDOW (minibuf_window)->must_be_updated_p = true;
+ update_frame (XFRAME (selected_frame), true, true);
flush_frame (XFRAME (XWINDOW (minibuf_window)->frame));
}
while (1)
{
- bool timeout_reduced_for_timers = 0;
+ bool timeout_reduced_for_timers = false;
/* If calling from keyboard input, do not quit
since we want to return C-g as an input character.
if (timespec_cmp (timer_delay, timeout) < 0)
{
timeout = timer_delay;
- timeout_reduced_for_timers = 1;
+ timeout_reduced_for_timers = true;
}
}
else
while (1)
{
- bool timeout_reduced_for_timers = 0;
+ bool timeout_reduced_for_timers = false;
fd_set waitchannels;
int xerrno;
if (timespec_cmp (timer_delay, timeout) < 0)
{
timeout = timer_delay;
- timeout_reduced_for_timers = 1;
+ timeout_reduced_for_timers = true;
}
}
}
}
/* Draw into the window. */
- w->must_be_updated_p = 1;
- update_single_window (w, 1);
+ w->must_be_updated_p = true;
+ update_single_window (w);
unblock_input ();
doc: /* Non-nil means to use `mode-line-inactive' face in non-selected windows.
If the minibuffer is active, the `minibuffer-scroll-window' mode line
is displayed in the `mode-line' face. */);
- mode_line_in_non_selected_windows = 1;
+ mode_line_in_non_selected_windows = true;
DEFVAR_LISP ("other-window-scroll-buffer", Vother_window_scroll_buffer,
doc: /* If this is a live buffer, \\[scroll-other-window] should scroll its window. */);
DEFVAR_BOOL ("auto-window-vscroll", auto_window_vscroll_p,
doc: /* Non-nil means to automatically adjust `window-vscroll' to view tall lines. */);
- auto_window_vscroll_p = 1;
+ auto_window_vscroll_p = true;
DEFVAR_INT ("next-screen-context-lines", next_screen_context_lines,
doc: /* Number of lines of continuity when scrolling by screenfuls. */);
Note that when a frame's pixel size is not a multiple of the
frame's character size, at least one window may get resized
pixelwise even if this option is nil. */);
- window_resize_pixelwise = 0;
+ window_resize_pixelwise = false;
DEFVAR_BOOL ("fast-but-imprecise-scrolling",
Vfast_but_imprecise_scrolling,
Note that this optimization can cause the portion of the buffer
displayed after a scrolling operation to be somewhat inaccurate. */);
- Vfast_but_imprecise_scrolling = 0;
+ Vfast_but_imprecise_scrolling = false;
defsubr (&Sselected_window);
defsubr (&Sminibuffer_window);
static void pop_it (struct it *);
static void sync_frame_with_window_matrix_rows (struct window *);
static void redisplay_internal (void);
-static int echo_area_display (int);
+static bool echo_area_display (bool);
static void redisplay_windows (Lisp_Object);
static void redisplay_window (Lisp_Object, bool);
static Lisp_Object redisplay_window_error (Lisp_Object);
else
clear_message (true, true);
- do_pending_window_change (0);
- echo_area_display (1);
- do_pending_window_change (0);
+ do_pending_window_change (false);
+ echo_area_display (true);
+ do_pending_window_change (false);
if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
(*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
}
is non-zero update selected_frame. Value is non-zero if the
mini-windows height has been changed. */
-static int
-echo_area_display (int update_frame_p)
+static bool
+echo_area_display (bool update_frame_p)
{
Lisp_Object mini_window;
struct window *w;
struct frame *f;
- int window_height_changed_p = 0;
+ bool window_height_changed_p = false;
struct frame *sf = SELECTED_FRAME ();
mini_window = FRAME_MINIBUF_WINDOW (sf);
/* Window configuration is the same as before.
Can do with a display update of the echo area,
unless we displayed some mode lines. */
- update_single_window (w, 1);
+ update_single_window (w);
flush_frame (f);
}
else
- update_frame (f, 1, 1);
+ update_frame (f, true, true);
/* If cursor is in the echo area, make sure that the next
redisplay displays the minibuffer, so that the cursor will
struct window *w = XWINDOW (selected_window);
struct window *sw;
struct frame *fr;
- int pending;
+ bool pending;
bool must_finish = 0, match_p;
struct text_pos tlbufpos, tlendpos;
int number_of_visible_frames;
/* Remember the currently selected window. */
sw = w;
- pending = 0;
+ pending = false;
last_escape_glyph_frame = NULL;
last_escape_glyph_face_id = (1 << FACE_ID_BITS);
last_glyphless_glyph_frame = NULL;
}
/* Notice any pending interrupt request to change frame size. */
- do_pending_window_change (1);
+ do_pending_window_change (true);
/* do_pending_window_change could change the selected_window due to
frame resizing which makes the selected window too small. */
echo-area doesn't show through. */
&& !MINI_WINDOW_P (XWINDOW (selected_window))))
{
- int window_height_changed_p = echo_area_display (0);
+ int window_height_changed_p = echo_area_display (false);
if (message_cleared_p)
update_miniwindow_p = true;
{
if (!must_finish)
{
- do_pending_window_change (1);
+ do_pending_window_change (true);
/* If selected_window changed, redisplay again. */
if (WINDOWP (selected_window)
&& (w = XWINDOW (selected_window)) != sw)
if (f->fonts_changed)
{
adjust_frame_glyphs (f);
- f->fonts_changed = 0;
+ f->fonts_changed = false;
goto retry_frame;
}
/* See if we have to hscroll. */
if (!f->already_hscrolled_p)
{
- f->already_hscrolled_p = 1;
+ f->already_hscrolled_p = true;
if (hscroll_windows (f->root_window))
goto retry_frame;
}
unrequest_sigio ();
STOP_POLLING;
- pending |= update_frame (f, 0, 0);
- f->cursor_type_changed = 0;
- f->updated_p = 1;
+ pending |= update_frame (f, false, false);
+ f->cursor_type_changed = false;
+ f->updated_p = true;
}
}
}
goto retry;
XWINDOW (selected_window)->must_be_updated_p = true;
- pending = update_frame (sf, 0, 0);
- sf->cursor_type_changed = 0;
+ pending = update_frame (sf, false, false);
+ sf->cursor_type_changed = false;
}
/* We may have called echo_area_display at the top of this
if (mini_frame != sf && FRAME_WINDOW_P (mini_frame))
{
XWINDOW (mini_window)->must_be_updated_p = true;
- pending |= update_frame (mini_frame, 0, 0);
- mini_frame->cursor_type_changed = 0;
+ pending |= update_frame (mini_frame, false, false);
+ mini_frame->cursor_type_changed = false;
if (!pending && hscroll_windows (mini_window))
goto retry;
}
}
/* Change frame size now if a change is pending. */
- do_pending_window_change (1);
+ do_pending_window_change (true);
/* If we just did a pending size change, or have additional
visible frames, or selected_window changed, redisplay again. */
if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT)
{
- clear_face_cache (0);
+ clear_face_cache (false);
clear_face_cache_count = 0;
}
{
/* We have a previously displayed message, but no current
message. Redisplay the previous message. */
- display_last_displayed_message_p = 1;
+ display_last_displayed_message_p = true;
redisplay_internal ();
- display_last_displayed_message_p = 0;
+ display_last_displayed_message_p = false;
}
else
redisplay_internal ();
try to free unused fonts, too. */
void
-clear_face_cache (int clear_fonts_p)
+clear_face_cache (bool clear_fonts_p)
{
#ifdef HAVE_WINDOW_SYSTEM
Lisp_Object tail, frame;
unblock_input ();
/* Draw into the window. */
- w->must_be_updated_p = 1;
- update_single_window (w, 1);
+ w->must_be_updated_p = true;
+ update_single_window (w);
/* Restore original current buffer. */
set_buffer_internal_1 (old_buffer);