From: Eli Zaretskii Date: Sat, 10 Oct 2020 08:11:34 +0000 (+0300) Subject: A better fix for bug#43886 X-Git-Tag: emacs-27.1.90~108 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c00606171f88be0df2c19346fa53f401ea71c71f;p=emacs.git A better fix for bug#43886 * src/xfaces.c (load_color2, Fcolor_distance): Revert last change. * src/term.c (clear_tty_hooks): Don't clear defined_color_hook. --- diff --git a/src/term.c b/src/term.c index 94bf013f4a0..370f6fcd453 100644 --- a/src/term.c +++ b/src/term.c @@ -3842,7 +3842,9 @@ clear_tty_hooks (struct terminal *terminal) terminal->update_begin_hook = 0; terminal->update_end_hook = 0; terminal->set_terminal_window_hook = 0; - terminal->defined_color_hook = 0; + /* Don't clear the defined_color_hook, as that makes it impossible + to unload or load a theme when some TTY frame is suspended. */ + /* terminal->defined_color_hook = 0; */ terminal->mouse_position_hook = 0; terminal->frame_rehighlight_hook = 0; terminal->frame_raise_lower_hook = 0; diff --git a/src/xfaces.c b/src/xfaces.c index fab29efe6f7..66d6c340302 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1059,13 +1059,6 @@ static unsigned long load_color2 (struct frame *f, struct face *face, Lisp_Object name, enum lface_attribute_index target_index, Emacs_Color *color) { - if (FRAME_TERMINAL (f)->defined_color_hook == NULL) - { - Lisp_Object frame; - XSETFRAME (frame, f); - signal_error ("Unable to load colors for suspended TTY frame", frame); - } - eassert (STRINGP (name)); eassert (target_index == LFACE_FOREGROUND_INDEX || target_index == LFACE_BACKGROUND_INDEX @@ -4398,9 +4391,6 @@ two lists of the form (RED GREEN BLUE) aforementioned. */) struct frame *f = decode_live_frame (frame); Emacs_Color cdef1, cdef2; - if (FRAME_TERMINAL (f)->defined_color_hook == NULL) - signal_error ("Unable to validate colors for suspended TTY frame", frame); - if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1)) && !(STRINGP (color1) && FRAME_TERMINAL (f)->defined_color_hook (f,