summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2020-10-04 22:50:38 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2020-10-04 22:50:38 -0400
commit14a5db2912d9e4e802c1eeddfb3e551f9fb8f753 (patch)
treee22e5a26244e060a680e4f3bd1fa5de0801f6e81 /src
parent5ec21155c39aab8a452d190a260e6912d1d9a920 (diff)
downloademacs-14a5db2912d9e4e802c1eeddfb3e551f9fb8f753.tar.gz
* src/xdisp.c (syms_of_xdisp): New var `redisplay_skip_initial_frame`.
This makes it possible to run most of the redisplay code (tho not the actual drawing since there's nowhere to draw) even when there's no real frame at hand, as is the case in batch mode. This makes `xdisp-tests--minibuffer-resizing` work even in batch. (redisplay_internal): Obey it. (init_xdisp): Set `echo_area_window` even in noninteractive mode. * src/dispnew.c (update_frame): Skip the initial frame. * src/frame.c (make_frame): Use 80x25 as the default initial size. * test/src/xdisp-tests.el (xdisp-tests--minibuffer-resizing): Use the new var and fix use of `executing-kbd-macro`.
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c17
-rw-r--r--src/frame.c12
-rw-r--r--src/xdisp.c13
3 files changed, 28 insertions, 14 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index d318e26308e..3f2ae3e6ad1 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1830,7 +1830,7 @@ adjust_frame_glyphs (struct frame *f)
/* Don't forget the buffer for decode_mode_spec. */
adjust_decode_mode_spec_buffer (f);
- f->glyphs_initialized_p = 1;
+ f->glyphs_initialized_p = true;
unblock_input ();
}
@@ -2251,7 +2251,7 @@ free_glyphs (struct frame *f)
/* Block interrupt input so that we don't get surprised by an X
event while we're in an inconsistent state. */
block_input ();
- f->glyphs_initialized_p = 0;
+ f->glyphs_initialized_p = false;
/* Release window sub-matrices. */
if (!NILP (f->root_window))
@@ -3236,9 +3236,16 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
build_frame_matrix (f);
/* Update the display. */
- update_begin (f);
- paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p, 1, false);
- update_end (f);
+ if (FRAME_INITIAL_P (f))
+ /* No actual display to update so the "update" is a nop and
+ obviously isn't interrupted by pending input. */
+ paused_p = false;
+ else
+ {
+ update_begin (f);
+ paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p, 1, false);
+ update_end (f);
+ }
if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
{
diff --git a/src/frame.c b/src/frame.c
index 3f934504372..0b707c2af87 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -931,18 +931,18 @@ make_frame (bool mini_p)
wset_frame (rw, frame);
- /* 10 is arbitrary,
+ /* 80/25 is arbitrary,
just so that there is "something there."
Correct size will be set up later with adjust_frame_size. */
- SET_FRAME_COLS (f, 10);
- SET_FRAME_LINES (f, 10);
+ SET_FRAME_COLS (f, 80);
+ SET_FRAME_LINES (f, 25);
SET_FRAME_WIDTH (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f));
SET_FRAME_HEIGHT (f, FRAME_LINES (f) * FRAME_LINE_HEIGHT (f));
- rw->total_cols = 10;
+ rw->total_cols = FRAME_COLS (f);
rw->pixel_width = rw->total_cols * FRAME_COLUMN_WIDTH (f);
- rw->total_lines = mini_p ? 9 : 10;
+ rw->total_lines = FRAME_LINES (f) - (mini_p ? 1 : 0);
rw->pixel_height = rw->total_lines * FRAME_LINE_HEIGHT (f);
if (mini_p)
@@ -1101,7 +1101,7 @@ make_initial_frame (void)
terminal = init_initial_terminal ();
- f = make_frame (1);
+ f = make_frame (true);
XSETFRAME (frame, f);
Vframe_list = Fcons (frame, Vframe_list);
diff --git a/src/xdisp.c b/src/xdisp.c
index d9101592b2a..85738f361d0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -15464,7 +15464,8 @@ redisplay_internal (void)
/* No redisplay if running in batch mode or frame is not yet fully
initialized, or redisplay is explicitly turned off by setting
Vinhibit_redisplay. */
- if (FRAME_INITIAL_P (SELECTED_FRAME ())
+ if ((FRAME_INITIAL_P (SELECTED_FRAME ())
+ && redisplay_skip_initial_frame)
|| !NILP (Vinhibit_redisplay))
return;
@@ -35452,6 +35453,12 @@ When nil, mouse-movement events will not be generated as long as the
mouse stays within the extent of a single glyph (except for images). */);
mouse_fine_grained_tracking = false;
+ DEFVAR_BOOL ("redisplay-skip-initial-frame", redisplay_skip_initial_frame,
+ doc: /* Non-nil to skip redisplay in initial frame.
+The initial frame is not displayed anywhere, so skipping it is
+best except in special circumstances such as running redisplay tests
+in batch mode. */);
+ redisplay_skip_initial_frame = true;
}
@@ -35462,6 +35469,8 @@ init_xdisp (void)
{
CHARPOS (this_line_start_pos) = 0;
+ echo_area_window = minibuf_window;
+
if (!noninteractive)
{
struct window *m = XWINDOW (minibuf_window);
@@ -35471,8 +35480,6 @@ init_xdisp (void)
struct window *r = XWINDOW (root);
int i;
- echo_area_window = minibuf_window;
-
r->top_line = FRAME_TOP_MARGIN (f);
r->pixel_top = r->top_line * FRAME_LINE_HEIGHT (f);
r->total_cols = FRAME_COLS (f);