append_glyphless_glyph (it, face_id, str);
}
-
-/* Get information about special display element WHAT in an
- environment described by IT. WHAT is one of IT_TRUNCATION or
- IT_CONTINUATION. Maybe produce glyphs for WHAT if IT has a
- non-null glyph_row member. This function ensures that fields like
- face_id, c, len of IT are left untouched. */
-
-void
-produce_special_glyphs (struct it *it, enum display_element_type what)
-{
- struct it temp_it;
- Lisp_Object gc;
- GLYPH glyph;
-
- temp_it = *it;
- temp_it.dp = NULL;
- temp_it.what = IT_CHARACTER;
- temp_it.len = 1;
- temp_it.object = make_number (0);
- memset (&temp_it.current, 0, sizeof temp_it.current);
-
- if (what == IT_CONTINUATION)
- {
- /* Continuation glyph. For R2L lines, we mirror it by hand. */
- if (it->bidi_it.paragraph_dir == R2L)
- SET_GLYPH_FROM_CHAR (glyph, '/');
- else
- SET_GLYPH_FROM_CHAR (glyph, '\\');
- if (it->dp
- && (gc = DISP_CONTINUE_GLYPH (it->dp), GLYPH_CODE_P (gc)))
- {
- /* FIXME: Should we mirror GC for R2L lines? */
- SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
- spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
- }
- }
- else if (what == IT_TRUNCATION)
- {
- /* Truncation glyph. */
- SET_GLYPH_FROM_CHAR (glyph, '$');
- if (it->dp
- && (gc = DISP_TRUNC_GLYPH (it->dp), GLYPH_CODE_P (gc)))
- {
- /* FIXME: Should we mirror GC for R2L lines? */
- SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
- spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
- }
- }
- else
- abort ();
-
- temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph);
- temp_it.face_id = GLYPH_FACE (glyph);
- temp_it.len = CHAR_BYTES (temp_it.c);
-
- produce_glyphs (&temp_it);
- it->pixel_width = temp_it.pixel_width;
- it->nglyphs = temp_it.pixel_width;
-}
-
-
\f
/***********************************************************************
Faces
Lisp_Object tty_color_mode_alist
= Fintern_soft (build_string ("tty-color-mode-alist"), Qnil);
- tem = assq_no_quit (Qtty_color_mode, f->param_alist);
+ tem = assq_no_quit (Qtty_color_mode, FGET (f, param_alist));
val = CONSP (tem) ? XCDR (tem) : Qnil;
if (INTEGERP (val))
if (mode != tty->previous_color_mode)
{
- Lisp_Object funsym = intern ("tty-set-up-initial-frame-faces");
tty->previous_color_mode = mode;
tty_setup_colors (tty , mode);
/* This recomputes all the faces given the new color definitions. */
- safe_call (1, &funsym);
+ safe_call (1, intern ("tty-set-up-initial-frame-faces"));
}
}
void
create_tty_output (struct frame *f)
{
- struct tty_output *t;
+ struct tty_output *t = xzalloc (sizeof *t);
if (! FRAME_TERMCAP_P (f))
abort ();
- t = xmalloc (sizeof (struct tty_output));
- memset (t, 0, sizeof (struct tty_output));
-
t->display_info = FRAME_TERMINAL (f)->display_info.tty;
f->output_data.tty = t;
been_here = 1;
tty = &the_only_display_info;
#else
- tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info));
+ tty = xzalloc (sizeof *tty);
#endif
- memset (tty, 0, sizeof (struct tty_display_info));
tty->next = tty_list;
tty_list = tty;
terminal->display_info.tty = tty;
tty->terminal = terminal;
- tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm));
+ tty->Wcm = xmalloc (sizeof *tty->Wcm);
Wcm_clear (tty);
encode_terminal_src_size = 0;
Wcm_clear (tty);
- tty->termcap_term_buffer = (char *) xmalloc (buffer_size);
+ tty->termcap_term_buffer = xmalloc (buffer_size);
/* On some systems, tgetent tries to access the controlling
terminal. */
abort ();
buffer_size = strlen (tty->termcap_term_buffer);
#endif
- tty->termcap_strings_buffer = area = (char *) xmalloc (buffer_size);
+ tty->termcap_strings_buffer = area = xmalloc (buffer_size);
tty->TS_ins_line = tgetstr ("al", address);
tty->TS_ins_multi_lines = tgetstr ("AL", address);
tty->TS_bell = tgetstr ("bl", address);
tty->mouse_highlight.mouse_face_window = Qnil;
#endif
- terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
+ terminal->kboard = xmalloc (sizeof *terminal->kboard);
init_kboard (terminal->kboard);
KVAR (terminal->kboard, Vwindow_system) = Qnil;
terminal->kboard->next_kboard = all_kboards;
#endif
DEFVAR_LISP ("suspend-tty-functions", Vsuspend_tty_functions,
- doc: /* Functions to be run after suspending a tty.
+ doc: /* Functions run after suspending a tty.
The functions are run with one argument, the terminal object to be suspended.
See `suspend-tty'. */);
Vsuspend_tty_functions = Qnil;
DEFVAR_LISP ("resume-tty-functions", Vresume_tty_functions,
- doc: /* Functions to be run after resuming a tty.
+ doc: /* Functions run after resuming a tty.
The functions are run with one argument, the terminal object that was revived.
See `resume-tty'. */);
Vresume_tty_functions = Qnil;