GNU bug report logs - #62994
Support styled underlines on TTY frames

Previous Next

Package: emacs;

Reported by: Mohsin Kaleem <mohkale <at> kisara.moe>

Date: Fri, 21 Apr 2023 14:30:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: mohkale <at> kisara.moe
Cc: 62994 <at> debbugs.gnu.org
Subject: bug#62994: [PATCH 3/3] Add support for colored underlines on tty frames
Date: Fri, 21 Apr 2023 19:12:54 +0300
> Cc: Mohsin Kaleem <mohkale <at> kisara.moe>
> From: mohkale <at> kisara.moe
> Date: Fri, 21 Apr 2023 15:34:48 +0100
> 
> diff --git a/etc/NEWS b/etc/NEWS
> index 9f34927dfad..46b2b0e25c5 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -1917,20 +1917,23 @@ exist, the command creates it first.  You can use this command if you
>  inadvertently delete the "*scratch*" buffer.
>  
>  ---
> -** Support for 'styled-underline' face attributes on TTY frames
> +** Support for 'styled' and 'colored' underline face attributes on TTY frames
>  If your terminals termcap or terminfo database entry has the 'Su' or
>  'Smulx' capability defined, Emacs will now emit the prescribed escape
>  sequence necessary to render faces with styled underlines on TTY
>  frames.
>  
>  Styled underlines are any underlines containing a non-default
> -underline style.  The available underline styles for TTY frames are
> -'double', 'wave', 'dotted', and 'dashed'.
> +underline style or a color other than the foreground-color.
> +The available underline styles for TTY frames are 'double', 'wave',
> +'dotted', and 'dashed'.
>  
>  The 'Smulx' capability should define the actual sequence needed to
>  render styled underlines. If ommitted, but the 'Su' flag is defined,
>  then a default sequence will be used. It's recommended to use 'Smulx'
> -instead of 'Su', with priority being given to 'Smulx'.
> +instead of 'Su', with priority being given to 'Smulx'.  Support for
> +colored underlines is automatically enabled with a default escape
> +sequence when styled underline are supported.

Please don't break the changeset into several patches, not in this
case: this changeset introduces a feature that there's no reason to
break into several sub-features, so making a single patch will make it
easier to review the changes.

> +      ts = tty->TF_set_underline_color;
> +      if (ts && face->underline_color)
> +	{
> +          p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0);

It looks like your edits use indentation with only spaces.  Our style
in C sources is to use TABs and spaces, so please set up your Emacs to
follow our style (it should happen automatically if you let Emacs read
and follow the .dir-locals.el file in the Emacs repository).

> +  if (tty->TF_set_underline_style)
> +    tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm";

What is the source for this escape sequence? can you mention it in a
comment?

Thanks.




This bug report was last modified 1 year and 50 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.