diff options
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/terminal.c b/src/terminal.c index 070b8aac1fe..dfcd5b0a836 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -1,5 +1,5 @@ /* Functions related to terminal devices. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2019 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -18,8 +18,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include <config.h> -#include <stdio.h> - #include "lisp.h" #include "character.h" #include "frame.h" @@ -264,8 +262,8 @@ get_named_terminal (const char *name) static struct terminal * allocate_terminal (void) { - return ALLOCATE_ZEROED_PSEUDOVECTOR - (struct terminal, next_terminal, PVEC_TERMINAL); + return ALLOCATE_ZEROED_PSEUDOVECTOR (struct terminal, glyph_code_table, + PVEC_TERMINAL); } /* Create a new terminal object of TYPE and add it to the terminal list. RIF @@ -314,7 +312,6 @@ create_terminal (enum output_method type, struct redisplay_interface *rif) void delete_terminal (struct terminal *terminal) { - struct terminal **tp; Lisp_Object tail, frame; /* Protect against recursive calls. delete_frame calls the @@ -335,6 +332,14 @@ delete_terminal (struct terminal *terminal) } } + delete_terminal_internal (terminal); +} + +void +delete_terminal_internal (struct terminal *terminal) +{ + struct terminal **tp; + for (tp = &terminal_list; *tp != terminal; tp = &(*tp)->next_terminal) if (! *tp) emacs_abort (); @@ -483,7 +488,7 @@ static Lisp_Object store_terminal_param (struct terminal *t, Lisp_Object parameter, Lisp_Object value) { Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist); - if (EQ (old_alist_elt, Qnil)) + if (NILP (old_alist_elt)) { tset_param_alist (t, Fcons (Fcons (parameter, value), t->param_alist)); return Qnil; @@ -551,10 +556,10 @@ calculate_glyph_code_table (struct terminal *t) struct unimapdesc unimapdesc = { entry_ct, entries }; if (ioctl (fd, GIO_UNIMAP, &unimapdesc) == 0) { - glyphtab = Fmake_char_table (Qnil, make_number (-1)); + glyphtab = Fmake_char_table (Qnil, make_fixnum (-1)); for (int i = 0; i < unimapdesc.entry_ct; i++) char_table_set (glyphtab, entries[i].unicode, - make_number (entries[i].fontpos)); + make_fixnum (entries[i].fontpos)); break; } if (errno != ENOMEM) @@ -617,6 +622,7 @@ init_initial_terminal (void) initial_terminal->kboard = initial_kboard; initial_terminal->delete_terminal_hook = &delete_initial_terminal; initial_terminal->delete_frame_hook = &initial_free_frame_resources; + initial_terminal->defined_color_hook = &tty_defined_color; /* xfaces.c */ /* Other hooks are NULL by default. */ return initial_terminal; |