/* Terminal control module for terminals described by TERMCAP
Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1998, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include <signal.h>
#include <stdarg.h>
+#include <setjmp.h>
#include "lisp.h"
#include "termchar.h"
cmputc ('\n');
}
- OUTPUT_IF (tty, tty->TS_termcap_modes);
OUTPUT_IF (tty, visible_cursor ? tty->TS_cursor_visible : tty->TS_cursor_normal);
OUTPUT_IF (tty, tty->TS_keypad_mode);
losecursor (tty);
encode_terminal_src_size);
buf = encode_terminal_src + nbytes;
}
- if (char_charset (c, charset_list, NULL))
+ if (CHAR_BYTE8_P (c)
+ || char_charset (c, charset_list, NULL))
{
/* Store the multibyte form of C at BUF. */
buf += CHAR_STRING (c, buf);
and where in the glyph matrix we currently are (glyph row and hpos).
produce_glyphs fills in output fields of *IT with information such as the
pixel width and height of a character, and maybe output actual glyphs at
- the same time if IT->glyph_row is non-null. See the explanation of
- struct display_iterator in dispextern.h for an overview.
+ the same time if IT->glyph_row is non-null. For an overview, see
+ the explanation in dispextern.h, before the definition of the
+ display_element_type enumeration.
produce_glyphs also stores the result of glyph width, ascent
etc. computations in *IT.
goto done;
}
- /* Maybe translate single-byte characters to multibyte. */
- it->char_to_display = it->c;
-
- if (it->c >= 040 && it->c < 0177)
+ if (it->char_to_display >= 040 && it->char_to_display < 0177)
{
it->pixel_width = it->nglyphs = 1;
if (it->glyph_row)
append_glyph (it);
}
- else if (it->c == '\n')
+ else if (it->char_to_display == '\n')
it->pixel_width = it->nglyphs = 0;
- else if (it->c == '\t')
+ else if (it->char_to_display == '\t')
{
int absolute_x = (it->current_x
+ it->continuation_lines_width);
it->pixel_width = nspaces;
it->nglyphs = nspaces;
}
- else if (CHAR_BYTE8_P (it->c))
+ else if (CHAR_BYTE8_P (it->char_to_display))
{
- if (unibyte_display_via_language_environment
- && (it->c >= 0240))
- {
- it->char_to_display = unibyte_char_to_multibyte (it->c);
- it->pixel_width = CHAR_WIDTH (it->char_to_display);
- it->nglyphs = it->pixel_width;
- if (it->glyph_row)
- append_glyph (it);
- }
- else
- {
- /* Coming here means that it->c is from display table, thus
- we must send the raw 8-bit byte as is to the terminal.
- Although there's no way to know how many columns it
- occupies on a screen, it is a good assumption that a
- single byte code has 1-column width. */
- it->pixel_width = it->nglyphs = 1;
- if (it->glyph_row)
- append_glyph (it);
- }
+ /* Coming here means that we must send the raw 8-bit byte as is
+ to the terminal. Although there's no way to know how many
+ columns it occupies on a screen, it is a good assumption that
+ a single byte code has 1-column width. */
+ it->pixel_width = it->nglyphs = 1;
+ if (it->glyph_row)
+ append_glyph (it);
}
else
{
- it->pixel_width = CHAR_WIDTH (it->c);
+ it->pixel_width = CHAR_WIDTH (it->char_to_display);
it->nglyphs = it->pixel_width;
if (it->glyph_row)
else
abort ();
- temp_it.c = GLYPH_CHAR (glyph);
+ 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);
va_start (ap, str);
fprintf (stderr, "emacs: ");
vfprintf (stderr, str, ap);
+ if (!(strlen (str) > 0 && str[strlen (str) - 1] == '\n'))
+ fprintf (stderr, "\n");
va_end (ap);
fflush (stderr);
exit (1);
delete_tty (struct terminal *terminal)
{
struct tty_display_info *tty;
- Lisp_Object tail, frame;
- int last_terminal;
/* Protect against recursive calls. delete_frame in
delete_terminal calls us back when it deletes our last frame. */
tty = terminal->display_info.tty;
- last_terminal = 1;
- FOR_EACH_FRAME (tail, frame)
- {
- struct frame *f = XFRAME (frame);
- if (FRAME_LIVE_P (f) && (!FRAME_TERMCAP_P (f) || FRAME_TTY (f) != tty))
- {
- last_terminal = 0;
- break;
- }
- }
- if (last_terminal)
- error ("Attempt to delete the sole terminal device with live frames");
-
if (tty == tty_list)
tty_list = tty->next;
else