diff options
author | Eli Zaretskii <eliz@gnu.org> | 2022-08-27 11:56:00 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-08-27 11:56:00 +0300 |
commit | 56aa52c346d5317a9f228ca12d52d4c860c458b0 (patch) | |
tree | 486d6b0080ee5956b05d5803c669ad4ef0baa5e2 /src/term.c | |
parent | 4015d561c39d29200bf1ac542844fd5f3ba99426 (diff) | |
download | emacs-56aa52c346d5317a9f228ca12d52d4c860c458b0.tar.gz |
Support "replacement characters" on TTY frames
* src/nsterm.m (ns_draw_glyphless_glyph_string_foreground):
* src/pgtkterm.c (pgtk_draw_glyphless_glyph_string_foreground):
* src/haikuterm.c (haiku_draw_glyphless_glyph_string_foreground):
* src/xterm.c (x_draw_glyphless_glyph_string_foreground):
* src/w32term.c (w32_draw_glyphless_glyph_string_foreground):
* src/xdisp.c (lookup_glyphless_char_display): Handle extra-slot
of 'glyphless-char-display' that is a cons cell.
(syms_of_xdisp) <glyphless-char-display>: Update doc string.
* etc/NEWS:
* doc/lispref/display.texi (Glyphless Chars): Document the new
feature.
* lisp/faces.el (glyphless-char): Make the face stand out on TTY
frames that don't support the underline attribute.
Diffstat (limited to 'src/term.c')
-rw-r--r-- | src/term.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/term.c b/src/term.c index 3bea621dbda..2e43d89232f 100644 --- a/src/term.c +++ b/src/term.c @@ -1862,12 +1862,24 @@ produce_glyphless_glyph (struct it *it, Lisp_Object acronym) acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c); if (CONSP (acronym)) acronym = XCDR (acronym); - buf[0] = '['; str = STRINGP (acronym) ? SSDATA (acronym) : ""; - for (len = 0; len < 6 && str[len] && ASCII_CHAR_P (str[len]); len++) - buf[1 + len] = str[len]; - buf[1 + len] = ']'; - len += 2; + /* A special kludgey feature for single-character acronyms: + don't put them in a box, effectively treating them as a + replacement character. */ + if (STRINGP (acronym) && SCHARS (acronym) == 1) + { + buf[0] = str[0]; + len = 1; + } + else + { + buf[0] = '['; + for (len = 0; + len < 6 && str[len] && ASCII_CHAR_P (str[len]); len++) + buf[1 + len] = str[len]; + buf[1 + len] = ']'; + len += 2; + } } else { |