/* Terminal control module for terminals described by TERMCAP
- Copyright (C) 1985, 86, 87, 93, 94, 95, 98, 2000, 2001, 2002, 2005
- Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1998, 2000, 2001,
+ 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* New redisplay, TTY faces by Gerd Moellmann <gerd@gnu.org>. */
Lisp_Object Vring_bell_function;
+/* If true, use "vs", otherwise use "ve" to make the cursor visible. */
+
+static int visible_cursor;
+
/* Terminal characteristics that higher levels want to look at.
These are all extern'd in termchar.h */
{
if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
{
- OUTPUT_IF (TS_termcap_modes);
- OUTPUT_IF (TS_cursor_visible);
+ if (TS_termcap_modes)
+ OUTPUT (TS_termcap_modes);
+ else
+ {
+ /* Output enough newlines to scroll all the old screen contents
+ off the screen, so it won't be overwritten and lost. */
+ int i;
+ for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++)
+ putchar ('\n');
+ }
+
+ OUTPUT_IF (visible_cursor ? TS_cursor_visible : TS_cursor_normal);
OUTPUT_IF (TS_keypad_mode);
losecursor ();
}
{
tty_cursor_hidden = 0;
OUTPUT_IF (TS_cursor_normal);
- OUTPUT_IF (TS_cursor_visible);
+ if (visible_cursor)
+ OUTPUT_IF (TS_cursor_visible);
}
}
int src_len;
struct coding_system *coding;
{
- struct glyph *src_start = src, *src_end = src + src_len;
+ struct glyph *src_end = src + src_len;
register GLYPH g;
unsigned char *buf;
int nchars, nbytes, required;
if (SYMBOLP (coding->pre_write_conversion)
&& ! NILP (Ffboundp (coding->pre_write_conversion)))
{
- run_pre_write_conversin_on_c_str (&encode_terminal_buf,
+ run_pre_write_conversin_on_c_str (&encode_terminal_buf,
&encode_terminal_bufsize,
nchars, nbytes, coding);
nchars = coding->produced_char;
&& calc_pixel_width_or_height (&tem, it, prop, 0, 1, &align_to))
{
if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)
- align_to = (align_to < 0
+ align_to = (align_to < 0
? 0
: align_to - window_box_left_offset (it->w, TEXT_AREA));
else if (align_to < 0)
if (TN_max_colors > 0)
{
- char *p;
+ char *ts, *p;
- if (fg >= 0 && TS_set_foreground)
+ ts = standout_mode ? TS_set_background : TS_set_foreground;
+ if (fg >= 0 && ts)
{
- p = tparam (TS_set_foreground, NULL, 0, (int) fg);
+ p = tparam (ts, NULL, 0, (int) fg);
OUTPUT (p);
xfree (p);
}
- if (bg >= 0 && TS_set_background)
+ ts = standout_mode ? TS_set_foreground : TS_set_background;
+ if (bg >= 0 && ts)
{
- p = tparam (TS_set_background, NULL, 0, (int) bg);
+ p = tparam (ts, NULL, 0, (int) bg);
OUTPUT (p);
xfree (p);
}
The function should accept no arguments. */);
Vring_bell_function = Qnil;
+ DEFVAR_BOOL ("visible-cursor", &visible_cursor,
+ doc: /* Non-nil means to make the cursor very visible.
+This only has an effect when running in a text terminal.
+What means \"very visible\" is up to your terminal. It may make the cursor
+bigger, or it may make it blink, or it may do nothing at all. */);
+ visible_cursor = 1;
+
defsubr (&Stty_display_color_p);
defsubr (&Stty_display_color_cells);
defsubr (&Stty_no_underline);