From: Daniel Colascione Date: Mon, 26 Feb 2018 05:32:50 +0000 (-0800) Subject: Initialize the default frame faces in batch mode under pdumper X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8f0ca9854ece68b42a8e0773e1948372a60d1f28;p=emacs.git Initialize the default frame faces in batch mode under pdumper --- diff --git a/src/dispnew.c b/src/dispnew.c index 1b75db9fc6f..49231805340 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5977,12 +5977,24 @@ pass nil for VARIABLE. */) Initialization ***********************************************************************/ +static void +init_faces_initial (void) +{ + /* For the initial frame, we don't have any way of knowing what + are the foreground and background colors of the terminal. */ + struct frame *sf = SELECTED_FRAME (); + + FRAME_FOREGROUND_PIXEL (sf) = FACE_TTY_DEFAULT_FG_COLOR; + FRAME_BACKGROUND_PIXEL (sf) = FACE_TTY_DEFAULT_BG_COLOR; + call0 (intern ("tty-set-up-initial-frame-faces")); +} + /* Initialization done when Emacs fork is started, before doing stty. Determine terminal type and set terminal_driver. Then invoke its decoding routine to set up variables in the terminal package. */ -void -init_display (void) +static void +init_display_interactive (void) { char *terminal_type; @@ -6156,18 +6168,21 @@ init_display (void) /* Set up faces of the initial terminal frame. */ if (!noninteractive && NILP (Vinitial_window_system)) - { - /* For the initial frame, we don't have any way of knowing what - are the foreground and background colors of the terminal. */ - struct frame *sf = SELECTED_FRAME (); + init_faces_initial (); +} - FRAME_FOREGROUND_PIXEL (sf) = FACE_TTY_DEFAULT_FG_COLOR; - FRAME_BACKGROUND_PIXEL (sf) = FACE_TTY_DEFAULT_BG_COLOR; - call0 (intern ("tty-set-up-initial-frame-faces")); +void +init_display (void) +{ + if (noninteractive) + { + if (dumped_with_pdumper_p ()) + init_faces_initial (); } + else + init_display_interactive (); } - /*********************************************************************** Blinking cursor diff --git a/src/emacs.c b/src/emacs.c index b8ebe9ef220..8f4ecd1b07a 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1858,8 +1858,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem init_process_emacs (sockfd); init_keyboard (); /* This too must precede init_sys_modes. */ - if (!noninteractive) - init_display (); /* Determine terminal type. Calls init_sys_modes. */ + init_display (); /* Determine terminal type. Calls init_sys_modes. */ #if HAVE_W32NOTIFY else init_crit (); /* w32notify.c needs this in batch mode. */