aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c64
1 files changed, 46 insertions, 18 deletions
diff --git a/src/term.c b/src/term.c
index 8aa3b3969ee..774373e82f9 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1695,6 +1695,7 @@ produce_special_glyphs (it, what)
1695 enum display_element_type what; 1695 enum display_element_type what;
1696{ 1696{
1697 struct it temp_it; 1697 struct it temp_it;
1698 GLYPH glyph;
1698 1699
1699 temp_it = *it; 1700 temp_it = *it;
1700 temp_it.dp = NULL; 1701 temp_it.dp = NULL;
@@ -1710,15 +1711,11 @@ produce_special_glyphs (it, what)
1710 && INTEGERP (DISP_CONTINUE_GLYPH (it->dp)) 1711 && INTEGERP (DISP_CONTINUE_GLYPH (it->dp))
1711 && GLYPH_CHAR_VALID_P (XINT (DISP_CONTINUE_GLYPH (it->dp)))) 1712 && GLYPH_CHAR_VALID_P (XINT (DISP_CONTINUE_GLYPH (it->dp))))
1712 { 1713 {
1713 temp_it.c = FAST_GLYPH_CHAR (XINT (DISP_CONTINUE_GLYPH (it->dp))); 1714 glyph = XINT (DISP_CONTINUE_GLYPH (it->dp));
1714 temp_it.len = CHAR_BYTES (temp_it.c); 1715 glyph = spec_glyph_lookup_face (XWINDOW (it->window), glyph);
1715 } 1716 }
1716 else 1717 else
1717 temp_it.c = '\\'; 1718 glyph = '\\';
1718
1719 produce_glyphs (&temp_it);
1720 it->pixel_width = temp_it.pixel_width;
1721 it->nglyphs = temp_it.pixel_width;
1722 } 1719 }
1723 else if (what == IT_TRUNCATION) 1720 else if (what == IT_TRUNCATION)
1724 { 1721 {
@@ -1727,18 +1724,22 @@ produce_special_glyphs (it, what)
1727 && INTEGERP (DISP_TRUNC_GLYPH (it->dp)) 1724 && INTEGERP (DISP_TRUNC_GLYPH (it->dp))
1728 && GLYPH_CHAR_VALID_P (XINT (DISP_TRUNC_GLYPH (it->dp)))) 1725 && GLYPH_CHAR_VALID_P (XINT (DISP_TRUNC_GLYPH (it->dp))))
1729 { 1726 {
1730 temp_it.c = FAST_GLYPH_CHAR (XINT (DISP_TRUNC_GLYPH (it->dp))); 1727 glyph = XINT (DISP_TRUNC_GLYPH (it->dp));
1731 temp_it.len = CHAR_BYTES (temp_it.c); 1728 glyph = spec_glyph_lookup_face (XWINDOW (it->window), glyph);
1732 } 1729 }
1733 else 1730 else
1734 temp_it.c = '$'; 1731 glyph = '$';
1735
1736 produce_glyphs (&temp_it);
1737 it->pixel_width = temp_it.pixel_width;
1738 it->nglyphs = temp_it.pixel_width;
1739 } 1732 }
1740 else 1733 else
1741 abort (); 1734 abort ();
1735
1736 temp_it.c = FAST_GLYPH_CHAR (glyph);
1737 temp_it.face_id = FAST_GLYPH_FACE (glyph);
1738 temp_it.len = CHAR_BYTES (temp_it.c);
1739
1740 produce_glyphs (&temp_it);
1741 it->pixel_width = temp_it.pixel_width;
1742 it->nglyphs = temp_it.pixel_width;
1742} 1743}
1743 1744
1744 1745
@@ -1757,7 +1758,8 @@ produce_special_glyphs (it, what)
1757 ? (tty->TN_no_color_video & (ATTR)) == 0 \ 1758 ? (tty->TN_no_color_video & (ATTR)) == 0 \
1758 : 1) 1759 : 1)
1759 1760
1760/* Turn appearances of face FACE_ID on tty frame F on. */ 1761/* Turn appearances of face FACE_ID on tty frame F on.
1762 FACE_ID is a realized face ID number, in the face cache. */
1761 1763
1762static void 1764static void
1763turn_on_face (f, face_id) 1765turn_on_face (f, face_id)
@@ -2195,7 +2197,7 @@ DEFUN ("display-name", Fdisplay_name, Sdisplay_name, 0, 1, 0,
2195 doc: /* Return the name of the device that DISPLAY uses. 2197 doc: /* Return the name of the device that DISPLAY uses.
2196It is not guaranteed that the returned value is unique among opened displays. 2198It is not guaranteed that the returned value is unique among opened displays.
2197 2199
2198DISPLAY can be a display, a frame, or nil (meaning the selected 2200DISPLAY may be a display, a frame, or nil (meaning the selected
2199frame's display). */) 2201frame's display). */)
2200 (display) 2202 (display)
2201 Lisp_Object display; 2203 Lisp_Object display;
@@ -2209,7 +2211,10 @@ frame's display). */)
2209} 2211}
2210 2212
2211DEFUN ("display-tty-type", Fdisplay_tty_type, Sdisplay_tty_type, 0, 1, 0, 2213DEFUN ("display-tty-type", Fdisplay_tty_type, Sdisplay_tty_type, 0, 1, 0,
2212 doc: /* Return the type of the TTY device that DISPLAY uses. */) 2214 doc: /* Return the type of the TTY device that DISPLAY uses.
2215
2216DISPLAY may be a display, a frame, or nil (meaning the selected
2217frame's display). */)
2213 (display) 2218 (display)
2214 Lisp_Object display; 2219 Lisp_Object display;
2215{ 2220{
@@ -2225,7 +2230,10 @@ DEFUN ("display-tty-type", Fdisplay_tty_type, Sdisplay_tty_type, 0, 1, 0,
2225} 2230}
2226 2231
2227DEFUN ("display-controlling-tty-p", Fdisplay_controlling_tty_p, Sdisplay_controlling_tty_p, 0, 1, 0, 2232DEFUN ("display-controlling-tty-p", Fdisplay_controlling_tty_p, Sdisplay_controlling_tty_p, 0, 1, 0,
2228 doc: /* Return non-nil if DISPLAY is on the controlling tty of the Emacs process. */) 2233 doc: /* Return non-nil if DISPLAY is on the controlling tty of the Emacs process.
2234
2235DISPLAY may be a display, a frame, or nil (meaning the selected
2236frame's display). */)
2229 (display) 2237 (display)
2230 Lisp_Object display; 2238 Lisp_Object display;
2231{ 2239{
@@ -2237,6 +2245,25 @@ DEFUN ("display-controlling-tty-p", Fdisplay_controlling_tty_p, Sdisplay_control
2237 return Qt; 2245 return Qt;
2238} 2246}
2239 2247
2248DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 1, 0,
2249 doc: /* Declare that the tty used by DISPLAY does not handle underlining.
2250This is used to override the terminfo data, for certain terminals that
2251do not really do underlining, but say that they do. This function has
2252no effect if used on a non-tty display.
2253
2254DISPLAY may be a display, a frame, or nil (meaning the selected
2255frame's display). */)
2256 (display)
2257 Lisp_Object display;
2258{
2259 struct display *d = get_display (display, 1);
2260
2261 if (d->type == output_termcap)
2262 d->display_info.tty->TS_enter_underline_mode = 0;
2263 return Qnil;
2264}
2265
2266
2240 2267
2241/*********************************************************************** 2268/***********************************************************************
2242 Initialization 2269 Initialization
@@ -3384,6 +3411,7 @@ See `resume-tty'. */);
3384 3411
3385 defsubr (&Stty_display_color_p); 3412 defsubr (&Stty_display_color_p);
3386 defsubr (&Stty_display_color_cells); 3413 defsubr (&Stty_display_color_cells);
3414 defsubr (&Stty_no_underline);
3387 defsubr (&Sdisplay_name); 3415 defsubr (&Sdisplay_name);
3388 defsubr (&Sdisplay_tty_type); 3416 defsubr (&Sdisplay_tty_type);
3389 defsubr (&Sdisplay_controlling_tty_p); 3417 defsubr (&Sdisplay_controlling_tty_p);