]> git.eshelyaron.com Git - emacs.git/commit
Add support for colored and styled underlines on tty frames
authorMohsin Kaleem <mohkale@kisara.moe>
Thu, 20 Apr 2023 21:30:12 +0000 (22:30 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 29 Apr 2024 15:04:30 +0000 (17:04 +0200)
commit7396969be03c49060f38589b51ead07d82b3b45c
treead572932aa5eb474cbfde9166ca8512d3b2e86e7
parentb0ff657c05e7e37e24f9afbf8917e8d8a3400e89
Add support for colored and styled underlines on tty frames

* src/dispextern.h (face, face_underline_type, syms_of_xfacse)
(internal-set-lisp-face-attribute)
(gui_supports_face_attributes_p): Add definitions for new
underline styles of Double-line, Dots and Dashes.  Rename
FACE_UNDER_LINE and FACE_UNDER_WAVE to make definitions
consistent.  Delete tty_underline_p from the face struct and use
just underline going forward.  Add a flag to check whether styled
underlines are available.
* lisp/cus-face.el (custom-face-attributes): Add entries for
Double-line, Dots and Dashes so they can be set through
`customize'.
* src/termchar.c (tty_display_info): Add an entry for the escape
sequence to set the underline style and color on terminal frames.
* src/term.c (init_tty, tty_capable_p, turn_on_face): Read and
save the underline style escape sequence from the Smulx termcap
(alternatively if the Su flag is set use a default sequence).
Allow checking for support of styled underlines in the current
terminal frame.  Output the necessary escape sequences to activate
a styled underline on turn_on_face; this is currently only used
for the new special underline styles, a default straight underline
will still use the "us" termcap.  Output escape sequence to set
underline color when set in the face and supported by the tty.
Save a default value for this sequence on init_tty when styled
underlines are supported.
* src/xfaces.c (tty_supports_face_attributes_p, realize_tty_face)
(map_tty_color): Assert whether styled underlines are supported by
the current terminal on display-supports-face-attributes-p checks.
Populate the correct underline style and color in the face spec
when realizing a face.  Allow map_tty_color to map underline
colors alongside foreground and background.  The interface of
map_tty_color was amended to allow the caller to supply the
underline color instead of accessing it through the face
attributes.  (bug#62994)
* src/xterm.c (x_draw_glyph_string): Updated to use renamed
FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type
enumerations.

(cherry picked from commit 9f589eb924085a4612f46728e8850073128a2e43)
doc/lispref/display.texi
etc/NEWS
lisp/cus-face.el
src/dispextern.h
src/term.c
src/termchar.h
src/xfaces.c
src/xterm.c