diff options
Diffstat (limited to 'src/dispnew.c')
-rw-r--r-- | src/dispnew.c | 69 |
1 files changed, 40 insertions, 29 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 55cdaf5de8a..88783cd5da7 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -42,6 +42,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include "systime.h" #include "tparam.h" #include "xwidget.h" +#include "pdumper.h" #ifdef HAVE_WINDOW_SYSTEM #include TERM_HEADER @@ -5987,12 +5988,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; @@ -6012,9 +6025,7 @@ init_display (void) with. Otherwise newly opened tty frames will not resize automatically. */ #ifdef SIGWINCH -#ifndef CANNOT_DUMP - if (initialized) -#endif /* CANNOT_DUMP */ + if (!will_dump_p ()) { struct sigaction action; emacs_sigaction_init (&action, deliver_window_change_signal); @@ -6078,11 +6089,7 @@ init_display (void) #endif /* HAVE_NTGUI */ #ifdef HAVE_NS - if (!inhibit_window_system -#ifndef CANNOT_DUMP - && initialized -#endif - ) + if (!inhibit_window_system && !will_dump_p ()) { Vinitial_window_system = Qns; Vwindow_system_version = make_fixnum (10); @@ -6170,22 +6177,23 @@ init_display (void) calculate_costs (XFRAME (selected_frame)); - /* Set up faces of the initial terminal frame of a dumped Emacs. */ - if (initialized - && !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 (); + /* Set up faces of the initial terminal frame. */ + if (!noninteractive && NILP (Vinitial_window_system)) + 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 @@ -6220,6 +6228,8 @@ WINDOW nil or omitted means report on the selected window. */) Initialization ***********************************************************************/ +static void syms_of_display_for_pdumper (void); + void syms_of_display (void) { @@ -6327,11 +6337,12 @@ See `buffer-display-table' for more information. */); beginning of the next redisplay). */ redisplay_dont_pause = true; -#ifdef CANNOT_DUMP - if (noninteractive) -#endif - { - Vinitial_window_system = Qnil; - Vwindow_system_version = Qnil; - } + pdumper_do_now_and_after_load (syms_of_display_for_pdumper); +} + +static void +syms_of_display_for_pdumper (void) +{ + Vinitial_window_system = Qnil; + Vwindow_system_version = Qnil; } |