From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: Support styled underlines on TTY frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 14:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168208734930664 (code B ref -1); Fri, 21 Apr 2023 14:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Apr 2023 14:29:09 +0000 Received: from localhost ([127.0.0.1]:40888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pprl7-0007yV-E4 for submit@debbugs.gnu.org; Fri, 21 Apr 2023 10:29:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:52394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pprl4-0007yL-TY for submit@debbugs.gnu.org; Fri, 21 Apr 2023 10:29:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pprl4-000633-Jb for bug-gnu-emacs@gnu.org; Fri, 21 Apr 2023 10:29:06 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119] helo=mail.kisara.moe) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pprl2-0008Cd-S9 for bug-gnu-emacs@gnu.org; Fri, 21 Apr 2023 10:29:06 -0400 Received: from mk-deck (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 60CD5A0FB5 for ; Fri, 21 Apr 2023 16:29:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682087343; bh=7Z/qBttNDOYr4v4iSaQSEkrNmVcg3Ditk4IGKVYIuCg=; h=From:To:Subject:Date:From; b=eXbHf9vy79vFxKwVSUOhZdyr0llPOAcweySoELfYYyimcdj4ryhUnZwH9JEjOoVo+ 9+H3PSiTRE3ZD8eMNpUy8EHblenkGHz9B6ukfXud9tdwTvDKnJuyaUhkCUc7dpeB6G jSLyW6Z/8q7NrswKWcOAxqxR8fj7WGcE4erow9yv/5Ed8LXTYlvqR5JPb7V54BoJeg lQjCdK3OKcsZEhAiVdjVuYU4coSBrHgynvgjrxdXnvB61AmJvRauKL4PlfGZia68D3 ADPrznBWKaxPZBYfSnBk7PNqaNj8vt3Njqk9NrOcDGmMa/A1mPgPYBsgWZBHqP15rm FPWww1ZIzMgtg== From: Mohsin Kaleem Date: Fri, 21 Apr 2023 15:29:03 +0100 Message-ID: <87pm7x5mxc.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=51.38.65.119; envelope-from=mohkale@kisara.moe; helo=mail.kisara.moe X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi, Support for styled underlines double, wave, dotted and dashed is a relatively recent inclusion for newer terminal emulators. It's exposed through either the Smulx or Su termcap (the former being an escape sequence and the latter just a flag). Furthermore. despite not having a dedicated termcap, these extensions also support colored underlines through a separate escape sequence; making it possible to have an underline with a different color to the foreground. I'd like to add support for these to Emacs. Looking on the mailing list it seems there's some prior efforts for this but none seem to have had any traction. I've been working on a patch for these and will submit it in reply to this message chain. For testing I've been using kitty. If building with this patch series you can view the underlines in the scratch buffer like so: ./src/emacs -nw -q --eval '(set-face-attribute (quote font-lock-comment-delimiter-face) nil :underline (list :style (quote wave) :color "blue"))' -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 3/3] Add support for colored underlines on tty frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.16820877008176 (code B ref 62994); Fri, 21 Apr 2023 14:35:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 14:35:00 +0000 Received: from localhost ([127.0.0.1]:40896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pprqm-00027m-6t for submit@debbugs.gnu.org; Fri, 21 Apr 2023 10:35:00 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:50934 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pprqk-00027M-5O for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 10:34:58 -0400 Received: from localhost.localdomain (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 592EAA2628; Fri, 21 Apr 2023 16:34:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682087697; bh=t33oX0sXqUq7T1CcDC/ciaAy8AR7Q6aYzgRroQUbh/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uXzqlvfyrja53qzjV9tv5yq/7POmg5vcUE+JY4il0FjXw2rT2RaZr1lK8n4Es/u7/ tkuCiO4NbHwj297F5qRhLG5AiddVTvgytDtZHDEU993TWBtgYrckweGx5Wvy3Ni3eg 4ZH/D6RZQeKoGOEhStSiFhJWQWGLJ8bv1TkPl1CvgbGJoamwzkXhEDAWID5VScstm9 tgp80krcXPuWNIlsiwnzapx+xm1QbIQowtfvawQWVzrNASVZYK5+r93dW3FfgLoH4E 6gtbhLADsrmcJLVk03YuoEpxCnpHj/Tn3VF883EE280tXP17moI4wKuxvwhmD5HuSC KU0W1FJT7rm9g== From: mohkale@kisara.moe Date: Fri, 21 Apr 2023 15:34:48 +0100 Message-Id: <20230421143448.339022-4-mohkale@kisara.moe> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230421143448.339022-1-mohkale@kisara.moe> References: <20230421143448.339022-1-mohkale@kisara.moe> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem * src/term.c (turn_on_face, init_tty): 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/termchar.c (tty_display_info): Add an entry for the escape sequence to set the underline color on terminal frames. * src/xfaces.c (tty_supports_face_attributes_p, realize_tty_face): Assert whether colored underlines are supported by the current terminal on display-supports-face-attributes-p checks. Load and save the color of the underline from the face spec when realizing a face. --- etc/NEWS | 11 +++++++---- src/term.c | 11 +++++++++++ src/termchar.h | 3 +++ src/xfaces.c | 16 +++++++++++++--- 4 files changed, 34 insertions(+), 7 deletions(-) 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. ** Debugging diff --git a/src/term.c b/src/term.c index 0f0393780eb..a1eb1961fad 100644 --- a/src/term.c +++ b/src/term.c @@ -1984,6 +1984,14 @@ turn_on_face (struct frame *f, int face_id) OUTPUT (tty, p); xfree (p); } + + ts = tty->TF_set_underline_color; + if (ts && face->underline_color) + { + p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } } } @@ -4277,6 +4285,9 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) if (!tty->TF_set_underline_style && tgetflag("Su")) tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + if (tty->TF_set_underline_style) + tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 319c2319fba..563cde715ec 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -175,6 +175,9 @@ #define EMACS_TERMCHAR_H style based on the parameter. Param should be one of: 0 (none), 1 (straight), 2 (double), 3 (wave), 4 (dotted), or 5 (dashed). */ + const char *TF_set_underline_color; /* Enabled when TF_set_underline_style is set: + Sets the color of the underline. Accepts a + single parameter, the color index. */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index 2c6c554d01d..c547a0b92f3 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5407,7 +5407,7 @@ tty_supports_face_attributes_p (struct frame *f, if (!UNSPECIFIEDP (val)) { if (STRINGP (val)) - return false; /* ttys can't use colored underlines */ + test_caps |= TTY_CAP_UNDERLINE_STYLED; else if (EQ (CAR_SAFE (val), QCstyle)) { if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) || @@ -6510,14 +6510,18 @@ realize_tty_face (struct face_cache *cache, underline = attrs[LFACE_UNDERLINE_INDEX]; if (NILP (underline)) { face->tty_underline = FACE_NO_UNDERLINE; + face->underline_color = 0; } else if (EQ (underline, Qt)) { face->tty_underline = FACE_UNDER_LINE; + face->underline_color = 0; } else if (STRINGP (underline)) { face->tty_underline = FACE_UNDER_LINE; + face->underline_color = load_color (f, face, underline, LFACE_UNDERLINE_INDEX); } else if (CONSP (underline)) { - /* `(:style STYLE)'. + /* `(:color COLOR :style STYLE)'. STYLE being one of `line', `double', `wave', `dotted' or `dashed'. */ face->tty_underline = FACE_UNDER_LINE; + face->underline_color = 0; while (CONSP (underline)) { Lisp_Object keyword, value; @@ -6530,7 +6534,13 @@ realize_tty_face (struct face_cache *cache, value = XCAR (underline); underline = XCDR (underline); - if (EQ (keyword, QCstyle)) { + if (EQ (keyword, QCcolor)) { + if (EQ (value, Qforeground_color)) + face->underline_color = 0; + else if (STRINGP (value)) + face->underline_color = load_color (f, face, value, LFACE_UNDERLINE_INDEX); + } + else if (EQ (keyword, QCstyle)) { if (EQ (value, Qline)) face->tty_underline = FACE_UNDER_LINE; else if (EQ (value, Qdouble)) -- 2.40.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 1/3] Add face definitions for more underline styles Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.16820877018183 (code B ref 62994); Fri, 21 Apr 2023 14:35:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 14:35:01 +0000 Received: from localhost ([127.0.0.1]:40898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pprqm-00027p-Mr for submit@debbugs.gnu.org; Fri, 21 Apr 2023 10:35:01 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:50922 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pprqk-00027K-DF for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 10:34:58 -0400 Received: from localhost.localdomain (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id EF084A0FFD; Fri, 21 Apr 2023 16:34:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682087697; bh=MACAnbePtzTXRa64Wk+6bZen9m50SG7jCDxm0mEHB3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NkLO6Zq5ITdE6XuUooHs0DImO3YYZIVkzSLeJL6b1d/sdB0Desd3dyRjT+8sn2k34 LspsUXoRu16BjSNHEwZFFu0lt8VhcopCdK/ooefDCMT+KanT6su4HzeJXQRMSVRceP +kRra1Hf29KuuLPSvOYp7JuO3pQXnNrc2NGQEHax+tkXeiWxMaNYqxlOm99xiMikKv ZDc0immIHcCure5MyAWsrKavGo1k/t2AGYpeUjHzJJepwqtEDsygPqDz2ItkyNIyhs o7mMtSTAgkVr3r5oiICIqGusk5cgsdH+2CFRQ/NNkqKCyZXyV5r+OPZ0NZEuAkXmZz QMSR2XphbzHyw== From: mohkale@kisara.moe Date: Fri, 21 Apr 2023 15:34:46 +0100 Message-Id: <20230421143448.339022-2-mohkale@kisara.moe> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230421143448.339022-1-mohkale@kisara.moe> References: <20230421143448.339022-1-mohkale@kisara.moe> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem * src/dispextern.h (face_underline_type, syms_of_xfacse, internal-set-lisp-face-attribute, gui_supports_face_attributes_p): Add definitions for new underline styles of Double, Dotted and Dashed. * lisp/cus-face.el (custom-face-attributes): Add entries for Double, Dotted and Dashed so they can be set through `customize'. --- lisp/cus-face.el | 5 ++++- src/dispextern.h | 8 ++++++-- src/xfaces.c | 21 ++++++++++++++++++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/lisp/cus-face.el b/lisp/cus-face.el index ec89b4f7ff6..2d6e6c7b73e 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -141,7 +141,10 @@ custom-face-attributes (const :format "" :value :style) (choice :tag "Style" (const :tag "Line" line) - (const :tag "Wave" wave)) + (const :tag "Double" double) + (const :tag "Wave" wave) + (const :tag "Dotted" dotted) + (const :tag "Dashed" dashed)) (const :format "" :value :position) (choice :tag "Position" (const :tag "At Default Position" nil) diff --git a/src/dispextern.h b/src/dispextern.h index 4dcab113ea2..1dc84e32efc 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1653,9 +1653,13 @@ #define FONT_TOO_HIGH(ft) \ enum face_underline_type { + // Note: Order matches the order of the Smulx terminfo extension. FACE_NO_UNDERLINE = 0, FACE_UNDER_LINE, - FACE_UNDER_WAVE + FACE_DOUBLE_UNDER_LINE, + FACE_UNDER_WAVE, + FACE_DOTTED_UNDER_LINE, + FACE_DASHED_UNDER_LINE, }; /* Structure describing a realized face. @@ -1737,7 +1741,7 @@ #define FONT_TOO_HIGH(ft) \ ENUM_BF (face_box_type) box : 2; /* Style of underlining. */ - ENUM_BF (face_underline_type) underline : 2; + ENUM_BF (face_underline_type) underline : 3; /* If `box' above specifies a 3D type, true means use box_color for drawing shadows. */ diff --git a/src/xfaces.c b/src/xfaces.c index 37b703984be..cfbb89d2ae2 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3255,7 +3255,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, } else if (EQ (key, QCstyle) - && !(EQ (val, Qline) || EQ (val, Qwave))) + && !(EQ (val, Qline) || + EQ (val, Qdouble) || + EQ (val, Qwave) || + EQ (val, Qdotted) || + EQ (val, Qdashed))) { valid_p = false; break; @@ -5204,6 +5208,7 @@ gui_supports_face_attributes_p (struct frame *f, Lisp_Object attrs[LFACE_VECTOR_SIZE], struct face *def_face) { + Lisp_Object val; Lisp_Object *def_attrs = def_face->lface; Lisp_Object lattrs[LFACE_VECTOR_SIZE]; @@ -5298,6 +5303,17 @@ gui_supports_face_attributes_p (struct frame *f, return false; } + /* Check supported underline styles. */ + val = attrs[LFACE_UNDERLINE_INDEX]; + if (!UNSPECIFIEDP (val)) { + if (EQ (CAR_SAFE (val), QCstyle)) { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) || + EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) { + return false; /* Unsupported underline style */ + } + } + } + /* Everything checks out, this face is supported. */ return true; } @@ -7165,6 +7181,9 @@ syms_of_xfaces (void) DEFSYM (QCposition, ":position"); DEFSYM (Qline, "line"); DEFSYM (Qwave, "wave"); + DEFSYM (Qdouble, "double"); + DEFSYM (Qdotted, "dotted"); + DEFSYM (Qdashed, "dashed"); DEFSYM (Qreleased_button, "released-button"); DEFSYM (Qpressed_button, "pressed-button"); DEFSYM (Qflat_button, "flat-button"); -- 2.40.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 0/3] Support styled underlines on tty Emacs frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 14:35:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.16820877018199 (code B ref 62994); Fri, 21 Apr 2023 14:35:03 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 14:35:01 +0000 Received: from localhost ([127.0.0.1]:40900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pprqn-00027w-4H for submit@debbugs.gnu.org; Fri, 21 Apr 2023 10:35:01 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:50920 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pprqk-00027I-FC for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 10:34:59 -0400 Received: from localhost.localdomain (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id C0213A0FB5; Fri, 21 Apr 2023 16:34:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682087696; bh=XFpsSx02gDB45l8XVNct2F+AzVVDJGogGaWWgFucaWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fv5xda+DVjWoTVu9r9JwjKs9uFKfaSUqQd5/aj24jyjb9u8t5dHO0npw1+P1d+Tli UI9BPABY/MUPBDIvdWoS3ikRfWFg2ErRPiBXOe5ybIGqQ778nOSHwgY6WZlFiu32O+ bxGPp3xWM2j6z2Zczy05U2q/PM7L1jxRVYw/vAY6owwXFuTJuisUeuGfR5KE00Co3H WdiPvrszrDzHnafuJSJKHsINE4lJ9GgTSCt1dq77Rcsf8LwZV5tbAvNGB6gI3fm9Ui 0E1xJH/cHlLfQSiGoO3oaXiouKI7SMgXlwALEMZ6PgGqf08V/jumo+EwR9ZqELELdi 4CNwozqlTxrdg== From: mohkale@kisara.moe Date: Fri, 21 Apr 2023 15:34:45 +0100 Message-Id: <20230421143448.339022-1-mohkale@kisara.moe> X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem Modern terminals (such as kitty) support setting the style of an underline with the escape sequence exposed in the Smulx termcap. This allows for (among others) wavy underlines on terminals. These terminals also support setting the color of these underlines using a separate escape sequence that to the best of my knowledge is not exposed as a termcap but has been adopted by other terminal supporting editors like neovim. Mohsin Kaleem (3): Add face definitions for more underline styles Add support for styled underlines on tty frames Add support for colored underlines on tty frames etc/NEWS | 19 ++++++++++ lisp/cus-face.el | 5 ++- src/dispextern.h | 11 ++++-- src/term.c | 46 +++++++++++++++++++++--- src/termchar.h | 7 ++++ src/xfaces.c | 93 ++++++++++++++++++++++++++++++++++++++++++++---- 6 files changed, 167 insertions(+), 14 deletions(-) -- 2.40.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 2/3] Add support for styled underlines on tty frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 14:35:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.16820877028214 (code B ref 62994); Fri, 21 Apr 2023 14:35:03 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 14:35:02 +0000 Received: from localhost ([127.0.0.1]:40902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pprqn-00028A-JW for submit@debbugs.gnu.org; Fri, 21 Apr 2023 10:35:02 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:50928 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pprqk-00027L-DE for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 10:34:59 -0400 Received: from localhost.localdomain (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 29B47A1048; Fri, 21 Apr 2023 16:34:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682087697; bh=DYJ5stR2mmjQ0R3OxuHOQBosBW2qKtAgRGPApbR9KR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HThfDmCuKEFwwQmN4LLn/BsMraHTkpyYl2g5p5KwUh0fHwJmY7EAEWZ419m/kL47b u0m73LH0y/Pi/KEUVWz1VGYT/UEW5FBqvkyxWRV4Tv5UhgLn0P2t6azoKeTMhhi2X1 MhRHC3bCXxwHHjhiODF3iJUJOs18woNzQT76PrjI1QgV9YqkIRe44w/R6xbkCAdwa7 Zt+t7G6APw1YSUkXzGQQuRe2EhheckGVit4tTb5zb/eITjDvybkGab037vxZv5I88h 8Hp6hSi5VJK94LEUcQdTZuNRFvpAxXC7dQKSeFRsVUILRMQ50gs/fDRErgzDdQPzZN VrdECm2GMXDmg== From: mohkale@kisara.moe Date: Fri, 21 Apr 2023 15:34:47 +0100 Message-Id: <20230421143448.339022-3-mohkale@kisara.moe> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230421143448.339022-1-mohkale@kisara.moe> References: <20230421143448.339022-1-mohkale@kisara.moe> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem * src/dispextern.h (face): Convert tty_underline_p from bool to a face_underline_type enumeration. Add a flag to check whether styled underlines are available. * src/termchar.c (tty_display_info): Add an entry for the escape sequence to set the underline style 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. * src/xfaces.c (tty_supports_face_attributes_p, realize_tty_face): Assert whether styled underlines are supported by the current terminal on display-supports-face-attributes-p checks. Populate the correct underline style in the face spec when realizing a face. --- etc/NEWS | 16 +++++++++++++ src/dispextern.h | 3 ++- src/term.c | 35 ++++++++++++++++++++++++---- src/termchar.h | 4 ++++ src/xfaces.c | 60 ++++++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 109 insertions(+), 9 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 62d2fdcd3a4..9f34927dfad 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1916,6 +1916,22 @@ This command switches to the "*scratch*" buffer. If "*scratch*" doesn't 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 +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'. + +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'. + ** Debugging --- diff --git a/src/dispextern.h b/src/dispextern.h index 1dc84e32efc..6ea6f6170e4 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1773,7 +1773,7 @@ #define FONT_TOO_HIGH(ft) \ string meaning the default color of the TTY. */ bool_bf tty_bold_p : 1; bool_bf tty_italic_p : 1; - bool_bf tty_underline_p : 1; + ENUM_BF (face_underline_type) tty_underline : 3; bool_bf tty_reverse_p : 1; bool_bf tty_strike_through_p : 1; @@ -3365,6 +3365,7 @@ #define TTY_CAP_BOLD 0x04 #define TTY_CAP_DIM 0x08 #define TTY_CAP_ITALIC 0x10 #define TTY_CAP_STRIKE_THROUGH 0x20 +#define TTY_CAP_UNDERLINE_STYLED 0x32 & TTY_CAP_UNDERLINE /*********************************************************************** diff --git a/src/term.c b/src/term.c index 53ba2a231e4..0f0393780eb 100644 --- a/src/term.c +++ b/src/term.c @@ -1948,8 +1948,17 @@ turn_on_face (struct frame *f, int face_id) OUTPUT1 (tty, tty->TS_enter_dim_mode); } - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + if (face->tty_underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) { + if (face->tty_underline == FACE_UNDER_LINE || + !tty->TF_set_underline_style) { + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + } else if (tty->TF_set_underline_style) { + char *p; + p = tparam(tty->TF_set_underline_style, NULL, 0, face->tty_underline, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } + } if (face->tty_strike_through_p && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) @@ -1995,7 +2004,7 @@ turn_off_face (struct frame *f, int face_id) if (face->tty_bold_p || face->tty_italic_p || face->tty_reverse_p - || face->tty_underline_p + || face->tty_underline || face->tty_strike_through_p) { OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); @@ -2007,7 +2016,7 @@ turn_off_face (struct frame *f, int face_id) { /* If we don't have "me" we can only have those appearances that have exit sequences defined. */ - if (face->tty_underline_p) + if (face->tty_underline) OUTPUT_IF (tty, tty->TS_exit_underline_mode); } @@ -2036,6 +2045,9 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_UNDERLINE_STYLED, tty->TF_set_underline_style, + NC_UNDERLINE); TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); TTY_CAPABLE_P_TRY (tty, @@ -4250,6 +4262,21 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TF_underscore = tgetflag ("ul"); tty->TF_teleray = tgetflag ("xt"); + // Styled underlines. + // + // Support for this is provided either by the escape sequence in + // Smulx or the Su flag. The latter results in a common default + // escape sequence and is not recommended. +#ifdef TERMINFO + tty->TF_set_underline_style = tigetstr("Smulx"); + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) + tty->TF_set_underline_style = NULL; +#else + tty->TF_set_underline_style = tgetstr("Smulx", address); +#endif + if (!tty->TF_set_underline_style && tgetflag("Su")) + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 5c47679a994..319c2319fba 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -171,6 +171,10 @@ #define EMACS_TERMCHAR_H non-blank position. Must clear before writing _. */ int TF_teleray; /* termcap xt flag: many weird consequences. For t1061. */ + const char *TF_set_underline_style; /* termcap Smulx entry: Switches the underline + style based on the parameter. Param should + be one of: 0 (none), 1 (straight), 2 (double), + 3 (wave), 4 (dotted), or 5 (dashed). */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index cfbb89d2ae2..2c6c554d01d 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5408,8 +5408,18 @@ tty_supports_face_attributes_p (struct frame *f, { if (STRINGP (val)) return false; /* ttys can't use colored underlines */ - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) - return false; /* ttys can't use wave underlines */ + else if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) || + EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) || + EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) || + EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) || + EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) { + return false; /* Unsupported underline style */ + } + + test_caps |= TTY_CAP_UNDERLINE_STYLED; + } else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) return false; /* same as default */ else @@ -6335,6 +6345,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face->underline = FACE_UNDER_LINE; else if (EQ (value, Qwave)) face->underline = FACE_UNDER_WAVE; + else + face->underline = FACE_UNDER_LINE; } else if (EQ (keyword, QCposition)) { @@ -6469,6 +6481,7 @@ realize_tty_face (struct face_cache *cache, { struct face *face; int weight, slant; + Lisp_Object underline; bool face_colors_defaulted = false; struct frame *f = cache->f; @@ -6488,13 +6501,52 @@ realize_tty_face (struct face_cache *cache, face->tty_bold_p = true; if (slant != 100) face->tty_italic_p = true; - if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) - face->tty_underline_p = true; if (!NILP (attrs[LFACE_INVERSE_INDEX])) face->tty_reverse_p = true; if (!NILP (attrs[LFACE_STRIKE_THROUGH_INDEX])) face->tty_strike_through_p = true; + /* Text underline. */ + underline = attrs[LFACE_UNDERLINE_INDEX]; + if (NILP (underline)) { + face->tty_underline = FACE_NO_UNDERLINE; + } else if (EQ (underline, Qt)) { + face->tty_underline = FACE_UNDER_LINE; + } else if (STRINGP (underline)) { + face->tty_underline = FACE_UNDER_LINE; + } else if (CONSP (underline)) { + /* `(:style STYLE)'. + STYLE being one of `line', `double', `wave', `dotted' or `dashed'. */ + face->tty_underline = FACE_UNDER_LINE; + + while (CONSP (underline)) { + Lisp_Object keyword, value; + + keyword = XCAR (underline); + underline = XCDR (underline); + + if (!CONSP (underline)) + break; + value = XCAR (underline); + underline = XCDR (underline); + + if (EQ (keyword, QCstyle)) { + if (EQ (value, Qline)) + face->tty_underline = FACE_UNDER_LINE; + else if (EQ (value, Qdouble)) + face->tty_underline = FACE_DOUBLE_UNDER_LINE; + else if (EQ (value, Qwave)) + face->tty_underline = FACE_UNDER_WAVE; + else if (EQ (value, Qdotted)) + face->tty_underline = FACE_DOTTED_UNDER_LINE; + else if (EQ (value, Qdashed)) + face->tty_underline = FACE_DASHED_UNDER_LINE; + else + face->tty_underline = FACE_UNDER_LINE; + } + } + } + /* Map color names to color indices. */ map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); -- 2.40.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 0/3] Support styled underlines on tty Emacs frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 15:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mohkale@kisara.moe Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168209235417389 (code B ref 62994); Fri, 21 Apr 2023 15:53:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 15:52:34 +0000 Received: from localhost ([127.0.0.1]:40988 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppt3p-0004WP-Tl for submit@debbugs.gnu.org; Fri, 21 Apr 2023 11:52:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppt3o-0004WB-0y for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 11:52:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppt3i-0002M3-7O; Fri, 21 Apr 2023 11:52:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TdxjjGi9UqH8WmMnJnzxDV8FM7t9KypZYNip9dgYGIM=; b=pk8VWhS+GsLu fiPbW1KdFDe06lAJKgXPr3Vwc2kKDt/cQjSHB/6zVAanvUQVVBKAZTskcadteZjhVvXJ1EdMRypTq LSkSXCjROuPPlOktpWxsJc6JNyvXdHsY4CBKaIGCSBO0WtgL4nAw9qAlq7R+IZzGnrBTQdJy3+Skl akQf8ELZ8+oLk3w07+iVbsY8SSHf0ZW8rKTNFdctFFPXHd+pd6naup46FaIwHUvWBQnX1tPAyrdtS XddfpZ6JfszqkmlMOv1On2Iv1EndBVTtsg8C87KFECZWapqG1Abdx7XqjSqJGVjYcZ0ONG/5BApfL pLlSqWvaXyZCbvhM1Bd8pA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppt3h-00059Y-JS; Fri, 21 Apr 2023 11:52:25 -0400 Date: Fri, 21 Apr 2023 18:52:43 +0300 Message-Id: <831qkd44hg.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <20230421143448.339022-1-mohkale@kisara.moe> References: <20230421143448.339022-1-mohkale@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Mohsin Kaleem > From: mohkale@kisara.moe > Date: Fri, 21 Apr 2023 15:34:45 +0100 > > From: Mohsin Kaleem > > Modern terminals (such as kitty) support setting the style of an > underline with the escape sequence exposed in the Smulx termcap. > This allows for (among others) wavy underlines on terminals. > These terminals also support setting the color of these underlines > using a separate escape sequence that to the best of my knowledge > is not exposed as a termcap but has been adopted by other terminal > supporting editors like neovim. Thanks. Please note up front that we must wait for the completion of your legal paperwork before we can accept significant contributions (such as this one) from you. I will send a few comments to each of the patches separately. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 1/3] Add face definitions for more underline styles Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 15:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mohkale@kisara.moe Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168209271018230 (code B ref 62994); Fri, 21 Apr 2023 15:59:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 15:58:30 +0000 Received: from localhost ([127.0.0.1]:41002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppt9a-0004jy-E2 for submit@debbugs.gnu.org; Fri, 21 Apr 2023 11:58:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppt9Z-0004jl-Ga for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 11:58:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppt9U-0003Rq-2L; Fri, 21 Apr 2023 11:58:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Sq2q31KX7xys5OQwXaaUutn7X2uwcq3DWHXpnVhEsD4=; b=dOEuwB9o5XPa p5NeFkji0a/+h8IbIRfdsu5Sv20j3F2LbY+HJgcWQvdVsCTvvJiMtXQinQbq3NHOwCGn6QQ0WaKYx b6kmg0v6KQWjWpmbNX1E7K+376Y9U5ag4K02iM2pweoYx/YtCT4YWwpA1jMOK4iJlNGVYFsd3Uqe+ LXUoa0zuvwsHifmw6cfNwXfYm3whjfPmDlS7kf3PJBvxJ8NE5XSGF9+uMc6ykkeCPQXkkTapdAEl0 5ZQMsIi3gbZun+LGN2l99dodw6Eqo9/GxnEy1cjgr1xhSOu7vvfd9gFurdl4CIHX6LoCBec18LlVz TL8Hgbx70R5XzrBZs4iAnw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppt9T-0001iR-5e; Fri, 21 Apr 2023 11:58:23 -0400 Date: Fri, 21 Apr 2023 18:58:39 +0300 Message-Id: <83zg712pn4.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <20230421143448.339022-2-mohkale@kisara.moe> References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-2-mohkale@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Mohsin Kaleem > From: mohkale@kisara.moe > Date: Fri, 21 Apr 2023 15:34:46 +0100 > > From: Mohsin Kaleem > > --- a/src/dispextern.h > +++ b/src/dispextern.h > @@ -1653,9 +1653,13 @@ #define FONT_TOO_HIGH(ft) \ > > enum face_underline_type > { > + // Note: Order matches the order of the Smulx terminfo extension. Please use the C style of comments, /* Like this. */, not the C++ style. > FACE_NO_UNDERLINE = 0, > FACE_UNDER_LINE, > - FACE_UNDER_WAVE > + FACE_DOUBLE_UNDER_LINE, > + FACE_UNDER_WAVE, > + FACE_DOTTED_UNDER_LINE, > + FACE_DASHED_UNDER_LINE, Is it really necessary to change the numerical value of FACE_UNDER_WAVE? Can it be left at its original value? > --- a/src/xfaces.c > +++ b/src/xfaces.c > @@ -3255,7 +3255,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, > } > > else if (EQ (key, QCstyle) > - && !(EQ (val, Qline) || EQ (val, Qwave))) > + && !(EQ (val, Qline) || > + EQ (val, Qdouble) || > + EQ (val, Qwave) || > + EQ (val, Qdotted) || > + EQ (val, Qdashed))) Our style is to put the operators ("||" in this case) at the beginning of the line, not at its end. > + /* Check supported underline styles. */ > + val = attrs[LFACE_UNDERLINE_INDEX]; > + if (!UNSPECIFIEDP (val)) { > + if (EQ (CAR_SAFE (val), QCstyle)) { > + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) || > + EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) { > + return false; /* Unsupported underline style */ Likewise here. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 2/3] Add support for styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 16:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mohkale@kisara.moe Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168209324819151 (code B ref 62994); Fri, 21 Apr 2023 16:08:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 16:07:28 +0000 Received: from localhost ([127.0.0.1]:41015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pptIG-0004yp-Ar for submit@debbugs.gnu.org; Fri, 21 Apr 2023 12:07:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pptID-0004yZ-7U for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 12:07:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pptI7-0005fs-Om; Fri, 21 Apr 2023 12:07:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=YX0DS3Fwyreo6viyPSgN7izv0GTHI9UOQIfUrh6TR5c=; b=a6x9Pg1kBEOg 2tFDdYqe2Qzr1Q+h9+MFzSrM3VYjvP3L/0E6u/oyD64lkT9L2pP72Cxjbx3KAljBESr/vM8G/l4wB qDf3/XkEzXJ8KClw0sOrGBfR7EMMEvfMturuU1dzP3Tfv582J10paOj0PFooGrbK7Zak0kBFsqhYB jok5cDHq5wJIJmkSQH0OuJ8rvrWUFnvhKwjVvxLil2heB2OWMvbFJG9v8+8ubD1zZHLBJRQAPajfP joflUdOdUXouh0cnJIqE1mLwjFUT3eUAE+sV3vw2XO0B47MPU5FGFlB3g0CrEMXkuc98ouoUawIy/ zRp2dS3/5PKuyYF3rQN7iA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pptI7-0002HG-96; Fri, 21 Apr 2023 12:07:19 -0400 Date: Fri, 21 Apr 2023 19:07:33 +0300 Message-Id: <83y1ml2p8a.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <20230421143448.339022-3-mohkale@kisara.moe> References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-3-mohkale@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Mohsin Kaleem > From: mohkale@kisara.moe > Date: Fri, 21 Apr 2023 15:34:47 +0100 > > diff --git a/etc/NEWS b/etc/NEWS > index 62d2fdcd3a4..9f34927dfad 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1916,6 +1916,22 @@ This command switches to the "*scratch*" buffer. If "*scratch*" doesn't > 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 > +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'. > + > +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'. I think the last paragraph is unnecessary in NEWS, since there's nothing users can do about the capabilities exposed by their terminfo database. In any case, please observe our convention of leaving two spaces between sentences, not one. > --- a/src/dispextern.h > +++ b/src/dispextern.h > @@ -1773,7 +1773,7 @@ #define FONT_TOO_HIGH(ft) \ > string meaning the default color of the TTY. */ > bool_bf tty_bold_p : 1; > bool_bf tty_italic_p : 1; > - bool_bf tty_underline_p : 1; > + ENUM_BF (face_underline_type) tty_underline : 3; > bool_bf tty_reverse_p : 1; > bool_bf tty_strike_through_p : 1; Is there any reason for separate tty_* face attribute bits? why cannot we use the same bits on both TTY and GUI frames? > --- a/src/term.c > +++ b/src/term.c > @@ -1948,8 +1948,17 @@ turn_on_face (struct frame *f, int face_id) > OUTPUT1 (tty, tty->TS_enter_dim_mode); > } > > - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) > - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); > + if (face->tty_underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) { > + if (face->tty_underline == FACE_UNDER_LINE || > + !tty->TF_set_underline_style) { > + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); > + } else if (tty->TF_set_underline_style) { Please use our style of braces and placing of operators in continued lines. The brace should be on their own lines, alone. > + // Styled underlines. > + // > + // Support for this is provided either by the escape sequence in > + // Smulx or the Su flag. The latter results in a common default > + // escape sequence and is not recommended. Comment style again: please use the C style. > +#ifdef TERMINFO > + tty->TF_set_underline_style = tigetstr("Smulx"); > + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) > + tty->TF_set_underline_style = NULL; > +#else > + tty->TF_set_underline_style = tgetstr("Smulx", address); > +#endif > + if (!tty->TF_set_underline_style && tgetflag("Su")) > + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; Any pointers to where this standard escape sequence is defined? I'd like to have that in a comment to this line. > + else if (EQ (CAR_SAFE (val), QCstyle)) > + { > + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) || > + EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) || > + EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) || > + EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) || > + EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) { Continuation line style again. > + return false; /* Unsupported underline style */ Comments should be complete sentences, and should end in a period and 2 spaces. > + /* Text underline. */ > + underline = attrs[LFACE_UNDERLINE_INDEX]; > + if (NILP (underline)) { > + face->tty_underline = FACE_NO_UNDERLINE; > + } else if (EQ (underline, Qt)) { > + face->tty_underline = FACE_UNDER_LINE; > + } else if (STRINGP (underline)) { > + face->tty_underline = FACE_UNDER_LINE; > + } else if (CONSP (underline)) { Style of braces again. > + while (CONSP (underline)) { > + Lisp_Object keyword, value; And here. > + if (EQ (keyword, QCstyle)) { And here. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 1/3] Add face definitions for more underline styles Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 16:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168209332219266 (code B ref 62994); Fri, 21 Apr 2023 16:09:01 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 16:08:42 +0000 Received: from localhost ([127.0.0.1]:41019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pptJR-00050g-Ud for submit@debbugs.gnu.org; Fri, 21 Apr 2023 12:08:42 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:54760 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pptJQ-00050Y-Ef for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 12:08:40 -0400 Received: from mk-deck (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 3117BA0FB5; Fri, 21 Apr 2023 18:08:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682093319; bh=5kduxa1kXIdu6+crl/rJkOGFXOF08o9fTJaDuLZd3dE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=OZaAdc110SWP00rv65fayY61AjSaSxmoGftjHeCBME5tSMZeLJOhjkH0sHDvhATEk QTvOLeBGjIOQMyfd4R8syBR1hMjvaZ3BchHLQvlgO/EqoLG0eXnQ1wYtHzdmVHrNVK chwJtWw2kijMZNa+XNNjVW7NgKZhBzGR6l0mJau5OZLCPwiNsughPIVUFRhz9ptPxE p4CNIti5Y1VJI5l4Ce49b5ndq9i+gVxTcftEsH7fsFOBlrr+24jVTB0LAOlfr3eQte 5Ax/ytGfMy3U7JXh6HoA7v5k3wBMPenMv2KkP6SBrMeDF6ocg8WuGHu5ZN5b4UwA1p zBDNq0cKuHboQ== From: Mohsin Kaleem In-Reply-To: <83zg712pn4.fsf@gnu.org> References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-2-mohkale@kisara.moe> <83zg712pn4.fsf@gnu.org> Date: Fri, 21 Apr 2023 17:08:39 +0100 Message-ID: <87leil5ibc.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Eli Zaretskii writes: > Is it really necessary to change the numerical value of > FACE_UNDER_WAVE? Can it be left at its original value? If consistency with Smulx is desirable then I think it is. Otherwise when we populate the escape sequence for the underline we'll need to map from the face underline style to the sequence underline style. Reordering like this makes them match so we don't have to do any extra processing later, but if preferable I can retain the original order and add a helper function to map to the sequence value. -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 0/3] Support styled underlines on tty Emacs frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 16:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168209343819454 (code B ref 62994); Fri, 21 Apr 2023 16:11:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 16:10:38 +0000 Received: from localhost ([127.0.0.1]:41023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pptLK-00053h-Da for submit@debbugs.gnu.org; Fri, 21 Apr 2023 12:10:38 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:36924 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pptLI-00053a-Q3 for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 12:10:37 -0400 Received: from mk-deck (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 123C7A0FB5; Fri, 21 Apr 2023 18:10:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682093436; bh=cdN7imo57LTAiT7//yCNNLNWZI37NQOK2oG3fjp6Acg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=xhGqeaGJhZgOTtUEQiAMgQZuLevy2jUUaEHxjM1qZl6UKLOKUDdVEBGfgT8YUen1P ux2Z734gLSFBmm7uAO9wLgUh6L+7UBWg9xx4R8YNce7jbuL34awrTd4P0PsiMdBLH5 XPcc5bjECY5lFH/i3IcGCF57aIW7iZpwyWPQXbJHIX9/y/AHiEovNy34af1m9IAljj Vwy/p5s1Aomohq4l4M4zZmWxiDE5Na0tUWQkFhBfikbEYMmeMgTnAJQlwdkwNlm91u +fJuPXuDJUu9Ird9P/u6elI3Qzh2ySLr9hbRHfcmmL+VV+VLy2oRKTTClIkXP0VHVv MBj7s1UFeirJw== From: Mohsin Kaleem In-Reply-To: <831qkd44hg.fsf@gnu.org> References: <20230421143448.339022-1-mohkale@kisara.moe> <831qkd44hg.fsf@gnu.org> Date: Fri, 21 Apr 2023 17:10:36 +0100 Message-ID: <87ildp5i83.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Eli Zaretskii writes: > Please note up front that we must wait for the completion of your > legal paperwork before we can accept significant contributions (such > as this one) from you. Yep, I'm aware. I've already reached out to Craig at the FSF help desk. I don't think there's anything more needed from me or my employer so I'm just waiting on a confirmation response. Otherwise I'm OK keeping this patch dormant until it's ready. I'd like to just get it in a state where it's good to merge, then when the paperwork is signed we can merge. > I will send a few comments to each of the patches separately. Much appreciated, thanks Eli :-). -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 3/3] Add support for colored underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 16:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mohkale@kisara.moe Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168209356719657 (code B ref 62994); Fri, 21 Apr 2023 16:13:01 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 16:12:47 +0000 Received: from localhost ([127.0.0.1]:41029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pptNO-00056y-Tz for submit@debbugs.gnu.org; Fri, 21 Apr 2023 12:12:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pptNM-00056j-Po for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 12:12:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pptNH-0007Dl-8I; Fri, 21 Apr 2023 12:12:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=LqmaJj66XLf+Aexkj4CLKLUpXeJExQ+HSwyEKoOqLgQ=; b=U20EyR6/o5zm 0qY4VtUJ8VnbERH+UIPsErhyBureztl7pLi1hKLDi3MRRlBfdWC4im3IzmmQSJl8/MWqOIUoWhIAV wWxQpVcEoBTVVNPGKFtjMcgaIKnxzuyMEGUcBmy/6kXhDBd7w+6WXXW084J6BgAraUVSVjsoLMXLI dHbTtwA1bXQPPBbwKxIql/RPG0eL+M3Diu5Ev0fc6628hKivQmMyJXxxDY3w1tmjgOHYhK3gt2bzm 9puKQca732liopCZ6koZ4/pM2yrj4xRlS0R/mG+PArfTDl7nU+NkRIqlqR6pyqrEeTYCzJYJzaJk7 +SHzUbVWkdcCVSuIbLAy/g==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pptNG-00032W-EI; Fri, 21 Apr 2023 12:12:38 -0400 Date: Fri, 21 Apr 2023 19:12:54 +0300 Message-Id: <83wn252ozd.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <20230421143448.339022-4-mohkale@kisara.moe> References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-4-mohkale@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Mohsin Kaleem > From: mohkale@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. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 2/3] Add support for styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 17:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168209935230025 (code B ref 62994); Fri, 21 Apr 2023 17:50:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 17:49:12 +0000 Received: from localhost ([127.0.0.1]:41090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppusi-0007oC-AP for submit@debbugs.gnu.org; Fri, 21 Apr 2023 13:49:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppusg-0007nz-U4 for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 13:49:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppusY-0007rp-Rf; Fri, 21 Apr 2023 13:49:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=qcHPyT7gT7wVWB84sGQdftrXuHIWrUYaim+Nc4sMpN4=; b=heCjEmDqS47f 02+NLPXz8FuMZc4lBw9TEj78lIgMp/Gd3q5GfyjZaXnjCRY/PC/yHaeBoo3hxdhOEFTct2hifwBQg 0QBMqFPfzIJnOPKjzqXB80/BgzmNDLttsaR4NqOAdo5bdi+TsZfGaApbbcA5Vy9+p3KsgvXzVdasp qLA/wpLQbNRn7D4JJFvbyuzwd15R+VyBpYupnB7QsbCjHwSF1EASLOPfEDi5yU7WRes/cQXRYs//1 X1EDC4P1vOe5a+eREpxoORYOUPXUro1aUGXx0W1dunJmROWuvF85l0BocTEyZLrv9e6/hg7KYNTBO xbPHOscuD8pQCz9Z7vK7ew==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppusY-0007D6-Bq; Fri, 21 Apr 2023 13:49:02 -0400 Date: Fri, 21 Apr 2023 20:49:19 +0300 Message-Id: <83sfct2kio.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <878rel5fqr.fsf@kisara.moe> (message from Mohsin Kaleem on Fri, 21 Apr 2023 18:04:12 +0100) References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-3-mohkale@kisara.moe> <83y1ml2p8a.fsf@gnu.org> <878rel5fqr.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [Please use Reply All to keep the bug address on the CC list.] > From: Mohsin Kaleem > Date: Fri, 21 Apr 2023 18:04:12 +0100 > > Eli Zaretskii writes: > > > I think the last paragraph is unnecessary in NEWS, since there's > > nothing users can do about the capabilities exposed by their terminfo > > database. > > I kinda disagree, I think mentioning this can help users debug why > certain termcaps aren't being processed correctly or to direct requests > to fix the processing directly to the terminal emulator instead of to > Emacs first. I'll go ahead and remove it for now. This is stuff for etc/PROBLEMS, not for NEWS. And we only add it to PROBLEMS if someone actually reports the relevant problems. > > Please use our style of braces and placing of operators in continued > > lines. The brace should be on their own lines, alone. > > For future reference is this style documented anywhere? Yes, in standards.info. This is the GNU recommended style. > > Any pointers to where this standard escape sequence is defined? I'd > > like to have that in a comment to this line. > > For the underline style I think kitty is a good reference since it was > the first to support it. That documentation is here [1]. The sequence > for color is also documented there... but I find the way its described > at best confusing and at worst unhelpful. I've been using the neovim > source code [2] as a reference for the implementation and color sequence > alongside trial and error. > > [1]: https://sw.kovidgoyal.net/kitty/underlines/ > [2]: https://github.com/neovim/neovim/commit/42f492ac99058bd1cd56c3c7871e7e464b2a5e24 Did Kitty invent that? If not, there must be some reference that is not the source code of a terminal emulator. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 3/3] Add support for colored underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 17:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168209977231278 (code B ref 62994); Fri, 21 Apr 2023 17:57:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 17:56:12 +0000 Received: from localhost ([127.0.0.1]:41095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppuzU-00088P-98 for submit@debbugs.gnu.org; Fri, 21 Apr 2023 13:56:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppuzP-00087t-L5 for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 13:56:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppuzK-0002Nw-5n; Fri, 21 Apr 2023 13:56:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ZAmgfLRRO+p+dj2fL5gnoCpPWf6YVzCizW/RRpvov1k=; b=nmMXW1ztle6T NWptVwGt67jdTg84yGXJIS73V/akc474I4pT1u58zwqrquNYw0vzi9n2XNurktLA2eg0mk3kFhJ7V JrhmtGtxdE/sB0E69m7c8M41AYjXsOn0d/dorDuzd/LrPDH487AmTa94XOAuQ5Xi3wyyBGqqOwHDI jLCmJjNMT8v5owjS6VnwlySwZexiRsTWY2jP88MRdTJSFheOfLG4UPTzP8lzltrPdgkDiQIz/c2V0 xnJoPSf25sgmOLNfHKmzhW5NKJjkFD/M3FAUxAyRZ2QGUF6V5CMwAxKH3noT6tLGzXFFNIxR66BC9 bvBx6bH/l8ZnmKwMlbplwA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppuzJ-000892-KB; Fri, 21 Apr 2023 13:56:01 -0400 Date: Fri, 21 Apr 2023 20:56:18 +0300 Message-Id: <83r0sd2k71.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <875y9p5fg0.fsf@kisara.moe> (message from Mohsin Kaleem on Fri, 21 Apr 2023 18:10:39 +0100) References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-4-mohkale@kisara.moe> <83wn252ozd.fsf@gnu.org> <875y9p5fg0.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Date: Fri, 21 Apr 2023 18:10:39 +0100 > > > 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). > > Looks like .dir-locals.el won't work for me since I use c-ts-mode and it > hooks into c-mode only. You are right, I've just fixed that. > >> + 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? > > The form here is nonstandard. It's adapted from the same escape sequence > used by neovim [1]. The difference here is that this form accepts a > single color parameter whereas that one accepts three different > parameters for the color range. Since this form is how the existing > foreground and background sequences are set AND the sequence doesn't > come from a termcap I figured it was okay to adapt it to a form Emacs > can already substitute. > > [1]: https://github.com/neovim/neovim/blob/42f492ac99058bd1cd56c3c7871e7e464b2a5e24/src/nvim/tui/tui.c#L1932 This should all be in a comment there, thanks. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 2/3] Add support for styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 18:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168210025932155 (code B ref 62994); Fri, 21 Apr 2023 18:05:01 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 18:04:19 +0000 Received: from localhost ([127.0.0.1]:41101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppv7L-0008MZ-9A for submit@debbugs.gnu.org; Fri, 21 Apr 2023 14:04:19 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:58344 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppv7G-0008MN-6o for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 14:04:17 -0400 Received: from mk-deck (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id EFCD8A0FB5; Fri, 21 Apr 2023 20:04:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682100253; bh=FMDAO+UKO86dWHyfyNoJqqV6liVQvWbrA1S9lqiKrcA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=aafbXx+WvOxJ8noTQAWp8M9AOwK1Q+zF/ZcMcOfCx78KSSiHFshFRFnKpK9t/ZTNg VyLDRE6cvyoJ5H45Pm4dYwhHRvBI/H/iyNmx35YHd1uKher3ohYvHGysB3f1A7TWyG a3VqjjzH4Z9fhKU8eP58b9G99jNHoRocfNEAVgznhx1GKt8ZTmL/6Qdjqe9mEphLiR GJjVJe3GvmOgk+O6uiAMYsjDNOUdjaeyFFV7c+I1NKQXPGm4KpH19u260xAJwYt4Bh vh52cMXoN2/GcaHcTgL7WVazfN/3R5Lq5KXbGcYqVB7g0KF5Cc14Dbe/af8Yg/3G4s A6guh7egoxSqA== From: Mohsin Kaleem In-Reply-To: <83sfct2kio.fsf@gnu.org> References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-3-mohkale@kisara.moe> <83y1ml2p8a.fsf@gnu.org> <878rel5fqr.fsf@kisara.moe> <83sfct2kio.fsf@gnu.org> Date: Fri, 21 Apr 2023 19:04:13 +0100 Message-ID: <87354t5cyq.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Eli Zaretskii writes: > [Please use Reply All to keep the bug address on the CC list.] Thought I did, my bad. Sorry. > This is stuff for etc/PROBLEMS, not for NEWS. And we only add it to > PROBLEMS if someone actually reports the relevant problems. Good enough :-). > Yes, in standards.info. This is the GNU recommended style. Cool, doesn't seem to be in the Emacs repo but I'm guessing it's this [1]. I'll try to adapt to it. [1]: https://www.gnu.org/prep/standards/standards.html#Formatting > Did Kitty invent that? If not, there must be some reference that is > not the source code of a terminal emulator. I think it did. What I've found online indicates kitty invented it, used Su for the termcap, this lead to an issue on tmux which suggested changing it to Smulx [2]. That's why the termcap for it is inconsistent. I can't find any reference for support before kitty. [2]: https://github.com/tmux/tmux/issues/1492 -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 2/3] Add support for styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 18:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.16821025913635 (code B ref 62994); Fri, 21 Apr 2023 18:44:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 18:43:11 +0000 Received: from localhost ([127.0.0.1]:41150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppvix-0000wZ-I4 for submit@debbugs.gnu.org; Fri, 21 Apr 2023 14:43:11 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:33450 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppviu-0000wP-J7 for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 14:43:09 -0400 Received: from mk-deck (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 3404FA0FB5; Fri, 21 Apr 2023 20:43:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682102587; bh=3y7Uas78c2m71Th50H7kOMOF9t98Jf0Y2aWK183bF20=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=1y6KU9vG8ZUMpdGsqNm+RRWYCjgwlr5RbpPuB29E/UpX8UT0uP8i7JMlwZ8OfI4Rm BBS/caQoQ464A7erIbnXwowoH54/yJSZLRk6jQUeD6fSfBQ4UE7Ok5iYsRxLNeUn/z AlAdu3nkI3Qshyluisx1IEKBC2cmAX/MEXn+HYubbv9hDR5Qm3VDqIwHpse1r7FNXN Q95XCdsTk8QeR4GZ+Hc32+a/ecepa+KyUE6FZ+S4K2N2HQNLStBAGUjFZTZgQcg+Qd U6a3IFZI0fWPq8gQmA5r+Rn2awck1SB6RQ4S90ct63dlDjzhTII4hS4ZIUmXWW3dPU JiNca9KvC/32A== From: Mohsin Kaleem In-Reply-To: <87354t5cyq.fsf@kisara.moe> References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-3-mohkale@kisara.moe> <83y1ml2p8a.fsf@gnu.org> <878rel5fqr.fsf@kisara.moe> <83sfct2kio.fsf@gnu.org> <87354t5cyq.fsf@kisara.moe> Date: Fri, 21 Apr 2023 19:43:07 +0100 Message-ID: <87zg713wlg.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Mohsin Kaleem writes: > Cool, doesn't seem to be in the Emacs repo but I'm guessing it's this > [1]. I'll try to adapt to it. I still don't get how to apply this to this repo Eli. You mentioned using tabs and spaces but every lines aside from a nested expression starts with 2 spaces. Some times there's 3 levels deep of expressions all indented with spaces and then one tab width just wide enough at 8 characters to appear like it's indented with spaces atop the previous scope. Can I just do leading indent with tabs matching current indentation level, curly braces 2 space ahead of the parent indent, and spaces ahead of tabs to align a parenthesized expression or multi line condition with the previous line? -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v2 0/1] Support styled underlines on tty Emacs frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 19:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , 62994@debbugs.gnu.org Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.16821050818270 (code B ref 62994); Fri, 21 Apr 2023 19:25:01 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 19:24:41 +0000 Received: from localhost ([127.0.0.1]:41168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppwN7-00029K-G1 for submit@debbugs.gnu.org; Fri, 21 Apr 2023 15:24:41 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:35940 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppwN5-00029B-KG for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 15:24:40 -0400 Received: from localhost.localdomain (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 65B23A0FB5; Fri, 21 Apr 2023 21:24:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682105078; bh=i57P11yBj/cjk+R5yhu47yBft06LG9MEpAOAQb4v2zQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F28vm/o+VKNoyDmNIaBB3z93Dv2WZ+30AhAJqxkbRxB3hv+cjbnhL0Jr/gDlW1Pa3 8ddtbW41iwEpFiPb1jx0+oHjlTDzVpIHNTtqf0yWORfu4H6k+WSv9AZqeR2UNsTTKf uGfCK4ogWZ3/dwwxrMUc9w7c7MHxvguKzP+/uAREJTW+XBhU1/+QCM2eltGB2Jdozo K0SoBH7PqVjFtL/0hvelNtNFc6Q5jmwiFTDoyGOdgVjgh5PA5baJBfsVe3IHfhE6cP UO6AHl47R4zj4OPlF1Gmw9moVK5Lfb4sN/9ukB/kRqvsD5cRmhYnBppCE5ZquTIKko xNviYDxKYic1g== From: mohkale@kisara.moe Date: Fri, 21 Apr 2023 20:24:32 +0100 Message-Id: <20230421192433.579140-1-mohkale@kisara.moe> X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem Modern terminals (such as kitty) support setting the style of an underline with the escape sequence exposed in the Smulx termcap. This allows for (among others) wavy underlines on terminals. These terminals also support setting the color of these underlines using a separate escape sequence that to the best of my knowledge is not exposed as a termcap but has been adopted by other terminal supporting editors like neovim. Version 2: This should've acted on all the comments on the last patch. The only thing I'm not sure about is the formatting. I've tried my best to get something consistent with what's already their or the style guide reference I found online but it's probably broken in a few places. Mohsin Kaleem (1): Add support for colored and styled underlines on tty frames etc/NEWS | 12 +++++ lisp/cus-face.el | 5 +- src/dispextern.h | 10 ++-- src/term.c | 54 +++++++++++++++++++-- src/termchar.h | 7 +++ src/xfaces.c | 121 ++++++++++++++++++++++++++++++++++++++++++----- 6 files changed, 189 insertions(+), 20 deletions(-) -- 2.40.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v2 1/1] Add support for colored and styled underlines on tty frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2023 19:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , 62994@debbugs.gnu.org Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.16821050858286 (code B ref 62994); Fri, 21 Apr 2023 19:25:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 19:24:45 +0000 Received: from localhost ([127.0.0.1]:41170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppwNA-00029Z-Q9 for submit@debbugs.gnu.org; Fri, 21 Apr 2023 15:24:45 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:35950 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppwN5-00029C-KH for 62994@debbugs.gnu.org; Fri, 21 Apr 2023 15:24:42 -0400 Received: from localhost.localdomain (unknown [146.70.132.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id A633DA0FFD; Fri, 21 Apr 2023 21:24:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682105078; bh=emSN6lk9rXQNBzLtz+0qWb5MiKxC4t7OHCIaI6d3AEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wizuzv/uvG0+I9ScLACvEGFEZmCgYZq4+LJ3L6h6FY13CQD9/7lRkcUiIOLBOTR28 FxoJd/xqwmA1mhOx3icZFed84Klva1IUwBMr8+nl1LbWaCdd16hpgS8dgBUlvonuvX Sp/cfwejUeJ4okHzSIITd3bOmqEKXtePisjaMCbkFq0dKitZ08woxQT9d1u8/MLwNu WcIJyWnhOCpmIY+GWjk0nO3RvUb7ZQKwtXrCw2mKzfYi9sMbjjAxRUwm+zSJoJvDOn ADyLufZIafLb3u6MTV3crqXI2E1tFxi+bkWfFZyaZI50t60TkfxTP+AXuyYA41z5hR iCO5WPzGb4cEQ== From: mohkale@kisara.moe Date: Fri, 21 Apr 2023 20:24:33 +0100 Message-Id: <20230421192433.579140-2-mohkale@kisara.moe> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230421192433.579140-1-mohkale@kisara.moe> References: <20230421192433.579140-1-mohkale@kisara.moe> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem * 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, Dotted and Dashed. 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, Dotted and Dashed 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): 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. --- etc/NEWS | 12 +++++ lisp/cus-face.el | 5 +- src/dispextern.h | 10 ++-- src/term.c | 54 +++++++++++++++++++-- src/termchar.h | 7 +++ src/xfaces.c | 121 ++++++++++++++++++++++++++++++++++++++++++----- 6 files changed, 189 insertions(+), 20 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 62d2fdcd3a4..e0798687bf4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1916,6 +1916,18 @@ This command switches to the "*scratch*" buffer. If "*scratch*" doesn't exist, the command creates it first. You can use this command if you inadvertently delete the "*scratch*" buffer. +--- +** 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 or a color other than the foreground-color. +The available underline styles for TTY frames are 'double', 'wave', +'dotted', and 'dashed'. + ** Debugging --- diff --git a/lisp/cus-face.el b/lisp/cus-face.el index ec89b4f7ff6..2d6e6c7b73e 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -141,7 +141,10 @@ custom-face-attributes (const :format "" :value :style) (choice :tag "Style" (const :tag "Line" line) - (const :tag "Wave" wave)) + (const :tag "Double" double) + (const :tag "Wave" wave) + (const :tag "Dotted" dotted) + (const :tag "Dashed" dashed)) (const :format "" :value :position) (choice :tag "Position" (const :tag "At Default Position" nil) diff --git a/src/dispextern.h b/src/dispextern.h index 4dcab113ea2..753bee446f1 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1653,9 +1653,13 @@ #define FONT_TOO_HIGH(ft) \ enum face_underline_type { + /* Note: Order matches the order of the Smulx terminfo extension. */ FACE_NO_UNDERLINE = 0, FACE_UNDER_LINE, - FACE_UNDER_WAVE + FACE_DOUBLE_UNDER_LINE, + FACE_UNDER_WAVE, + FACE_DOTTED_UNDER_LINE, + FACE_DASHED_UNDER_LINE, }; /* Structure describing a realized face. @@ -1737,7 +1741,7 @@ #define FONT_TOO_HIGH(ft) \ ENUM_BF (face_box_type) box : 2; /* Style of underlining. */ - ENUM_BF (face_underline_type) underline : 2; + ENUM_BF (face_underline_type) underline : 3; /* If `box' above specifies a 3D type, true means use box_color for drawing shadows. */ @@ -1769,7 +1773,6 @@ #define FONT_TOO_HIGH(ft) \ string meaning the default color of the TTY. */ bool_bf tty_bold_p : 1; bool_bf tty_italic_p : 1; - bool_bf tty_underline_p : 1; bool_bf tty_reverse_p : 1; bool_bf tty_strike_through_p : 1; @@ -3361,6 +3364,7 @@ #define TTY_CAP_BOLD 0x04 #define TTY_CAP_DIM 0x08 #define TTY_CAP_ITALIC 0x10 #define TTY_CAP_STRIKE_THROUGH 0x20 +#define TTY_CAP_UNDERLINE_STYLED 0x32 & TTY_CAP_UNDERLINE /*********************************************************************** diff --git a/src/term.c b/src/term.c index 53ba2a231e4..2c1d44bff7a 100644 --- a/src/term.c +++ b/src/term.c @@ -1948,8 +1948,19 @@ turn_on_face (struct frame *f, int face_id) OUTPUT1 (tty, tty->TS_enter_dim_mode); } - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + if (face->underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) + { + if (face->underline == FACE_UNDER_LINE + || !tty->TF_set_underline_style) + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + else if (tty->TF_set_underline_style) + { + char *p; + p = tparam(tty->TF_set_underline_style, NULL, 0, face->underline, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } + } if (face->tty_strike_through_p && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) @@ -1975,6 +1986,14 @@ turn_on_face (struct frame *f, int face_id) OUTPUT (tty, p); xfree (p); } + + ts = tty->TF_set_underline_color; + if (ts && face->underline_color) + { + p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } } } @@ -1995,7 +2014,7 @@ turn_off_face (struct frame *f, int face_id) if (face->tty_bold_p || face->tty_italic_p || face->tty_reverse_p - || face->tty_underline_p + || face->underline || face->tty_strike_through_p) { OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); @@ -2007,7 +2026,7 @@ turn_off_face (struct frame *f, int face_id) { /* If we don't have "me" we can only have those appearances that have exit sequences defined. */ - if (face->tty_underline_p) + if (face->underline) OUTPUT_IF (tty, tty->TS_exit_underline_mode); } @@ -2036,6 +2055,9 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_UNDERLINE_STYLED, tty->TF_set_underline_style, + NC_UNDERLINE); TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); TTY_CAPABLE_P_TRY (tty, @@ -4250,6 +4272,30 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TF_underscore = tgetflag ("ul"); tty->TF_teleray = tgetflag ("xt"); + /* Styled underlines. Support for this is provided either by the + escape sequence in Smulx or the Su flag. The latter results in a + common default escape sequence and is not recommended. */ +#ifdef TERMINFO + tty->TF_set_underline_style = tigetstr("Smulx"); + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) + tty->TF_set_underline_style = NULL; +#else + tty->TF_set_underline_style = tgetstr("Smulx", address); +#endif + if (!tty->TF_set_underline_style && tgetflag("Su")) + /* Default to the kitty escape sequence. See + https://sw.kovidgoyal.net/kitty/underlines/ */ + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + + if (tty->TF_set_underline_style) + /* This escape sequence for setting the underline color is + consistent with the one described in kitty (see above) and + adapted from the one used by neovim. This sequence has + been altered from the neovim sequence at + https://github.com/neovim/neovim/blob/42f492ac99058bd1cd56c3c7871e7e464b2a5e24/src/nvim/tui/tui.c + to require only a single parameter, the color index. */ + tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 5c47679a994..946ffb344d9 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -171,6 +171,13 @@ #define EMACS_TERMCHAR_H non-blank position. Must clear before writing _. */ int TF_teleray; /* termcap xt flag: many weird consequences. For t1061. */ + const char *TF_set_underline_style; /* termcap Smulx entry: Switches the underline + style based on the parameter. Param should + be one of: 0 (none), 1 (straight), 2 (double), + 3 (wave), 4 (dotted), or 5 (dashed). */ + const char *TF_set_underline_color; /* Enabled when TF_set_underline_style is set: + Sets the color of the underline. Accepts a + single parameter, the color index. */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index 37b703984be..65118ff020e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3255,7 +3255,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, } else if (EQ (key, QCstyle) - && !(EQ (val, Qline) || EQ (val, Qwave))) + && !(EQ (val, Qline) + || EQ (val, Qdouble) + || EQ (val, Qwave) + || EQ (val, Qdotted) + || EQ (val, Qdashed))) { valid_p = false; break; @@ -5204,6 +5208,7 @@ gui_supports_face_attributes_p (struct frame *f, Lisp_Object attrs[LFACE_VECTOR_SIZE], struct face *def_face) { + Lisp_Object val; Lisp_Object *def_attrs = def_face->lface; Lisp_Object lattrs[LFACE_VECTOR_SIZE]; @@ -5298,6 +5303,20 @@ gui_supports_face_attributes_p (struct frame *f, return false; } + /* Check supported underline styles. */ + val = attrs[LFACE_UNDERLINE_INDEX]; + if (!UNSPECIFIEDP (val)) + { + if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) + { + return false; /* Unsupported underline style */ + } + } + } + /* Everything checks out, this face is supported. */ return true; } @@ -5390,15 +5409,26 @@ tty_supports_face_attributes_p (struct frame *f, val = attrs[LFACE_UNDERLINE_INDEX]; if (!UNSPECIFIEDP (val)) { - if (STRINGP (val)) - return false; /* ttys can't use colored underlines */ - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) - return false; /* ttys can't use wave underlines */ - else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) - return false; /* same as default */ - else - test_caps |= TTY_CAP_UNDERLINE; - } + if (STRINGP (val)) + test_caps |= TTY_CAP_UNDERLINE_STYLED; + else if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) + { + return false; /* Face uses an unsupported underline style. */ + } + + test_caps |= TTY_CAP_UNDERLINE_STYLED; + } + else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) + return false; /* same as default */ + else + test_caps |= TTY_CAP_UNDERLINE; + } /* inverse video */ val = attrs[LFACE_INVERSE_INDEX]; @@ -6319,6 +6349,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face->underline = FACE_UNDER_LINE; else if (EQ (value, Qwave)) face->underline = FACE_UNDER_WAVE; + else + face->underline = FACE_UNDER_LINE; } else if (EQ (keyword, QCposition)) { @@ -6453,6 +6485,7 @@ realize_tty_face (struct face_cache *cache, { struct face *face; int weight, slant; + Lisp_Object underline; bool face_colors_defaulted = false; struct frame *f = cache->f; @@ -6472,13 +6505,74 @@ realize_tty_face (struct face_cache *cache, face->tty_bold_p = true; if (slant != 100) face->tty_italic_p = true; - if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) - face->tty_underline_p = true; if (!NILP (attrs[LFACE_INVERSE_INDEX])) face->tty_reverse_p = true; if (!NILP (attrs[LFACE_STRIKE_THROUGH_INDEX])) face->tty_strike_through_p = true; + /* Text underline. */ + underline = attrs[LFACE_UNDERLINE_INDEX]; + if (NILP (underline)) + { + face->underline = FACE_NO_UNDERLINE; + face->underline_color = 0; + } + else if (EQ (underline, Qt)) + { + face->underline = FACE_UNDER_LINE; + face->underline_color = 0; + } + else if (STRINGP (underline)) + { + face->underline = FACE_UNDER_LINE; + face->underline_color = load_color (f, face, underline, LFACE_UNDERLINE_INDEX); + } + else if (CONSP (underline)) + { + /* `(:color COLOR :style STYLE)'. + STYLE being one of `line', `double', `wave', `dotted' or `dashed'. */ + face->underline = FACE_UNDER_LINE; + face->underline_color = 0; + + while (CONSP (underline)) + { + Lisp_Object keyword, value; + + keyword = XCAR (underline); + underline = XCDR (underline); + + if (!CONSP (underline)) + break; + value = XCAR (underline); + underline = XCDR (underline); + + if (EQ (keyword, QCcolor)) + { + if (EQ (value, Qforeground_color)) + face->underline_color = 0; + else if (STRINGP (value)) + face->underline_color + = load_color (f, face, value, + LFACE_UNDERLINE_INDEX); + } + else if (EQ (keyword, QCstyle)) + { + if (EQ (value, Qline)) + face->underline = FACE_UNDER_LINE; + else if (EQ (value, Qdouble)) + face->underline = FACE_DOUBLE_UNDER_LINE; + else if (EQ (value, Qwave)) + face->underline = FACE_UNDER_WAVE; + else if (EQ (value, Qdotted)) + face->underline = FACE_DOTTED_UNDER_LINE; + else if (EQ (value, Qdashed)) + face->underline = FACE_DASHED_UNDER_LINE; + else + face->underline = FACE_UNDER_LINE; + } + } + } + /* Map color names to color indices. */ map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); @@ -7165,6 +7259,9 @@ syms_of_xfaces (void) DEFSYM (QCposition, ":position"); DEFSYM (Qline, "line"); DEFSYM (Qwave, "wave"); + DEFSYM (Qdouble, "double"); + DEFSYM (Qdotted, "dotted"); + DEFSYM (Qdashed, "dashed"); DEFSYM (Qreleased_button, "released-button"); DEFSYM (Qpressed_button, "pressed-button"); DEFSYM (Qflat_button, "flat-button"); -- 2.40.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 2/3] Add support for styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Apr 2023 06:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168214602418491 (code B ref 62994); Sat, 22 Apr 2023 06:48:01 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2023 06:47:04 +0000 Received: from localhost ([127.0.0.1]:41552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pq71T-0004oB-N5 for submit@debbugs.gnu.org; Sat, 22 Apr 2023 02:47:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pq71Q-0004ng-EM for 62994@debbugs.gnu.org; Sat, 22 Apr 2023 02:47:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pq71K-0001hl-UK; Sat, 22 Apr 2023 02:46:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=YvjaBYSYaHzkheO9q6MLf0sAhimoxJ4DZcS80LvyZ+Y=; b=JonGi7Y8K2XS rLNXYbTVd098qJBbvk6BCWHvJRgAOcwyEVGysqHCzYxZ0B/55pjjZsWLOlvB+ir3zlol61SsYQ47G nC/ZFh3OWGJDK2lALP2cCXt4KaeO/zgAdqUlVD1XsJ9HslPVO8JansyyCjB8NFuGaauym43wNDUI1 iwkBzOxbBAPxjq3Rz5JP4J9WVl3ypTfBJX9PkqR0Xug/9HPCTi0246JC4DrwF5bWrPJNSK+F9ZSyJ 8xl6Ob8+cEDD7Dryj0esbxVjKj622Xv/nLUd4X32LWYyeIgBh6DMW41vCi+kpYxHGKOxmXSWGB04Z w33FCvfAnceMewkOb4L8xA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pq71J-0003Z7-T4; Sat, 22 Apr 2023 02:46:54 -0400 Date: Sat, 22 Apr 2023 09:47:12 +0300 Message-Id: <83leik2z2n.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87354t5cyq.fsf@kisara.moe> (message from Mohsin Kaleem on Fri, 21 Apr 2023 19:04:13 +0100) References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-3-mohkale@kisara.moe> <83y1ml2p8a.fsf@gnu.org> <878rel5fqr.fsf@kisara.moe> <83sfct2kio.fsf@gnu.org> <87354t5cyq.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Cc: 62994@debbugs.gnu.org > Date: Fri, 21 Apr 2023 19:04:13 +0100 > > Eli Zaretskii writes: > > > Yes, in standards.info. This is the GNU recommended style. > > Cool, doesn't seem to be in the Emacs repo but I'm guessing it's this > [1]. Yes. > I'll try to adapt to it. It should be easier now, since .dir-locals.el now does that for c-ts-mode as well, not just for c-mode. > > Did Kitty invent that? If not, there must be some reference that is > > not the source code of a terminal emulator. > > I think it did. What I've found online indicates kitty invented it, used > Su for the termcap, this lead to an issue on tmux which suggested > changing it to Smulx [2]. That's why the termcap for it is inconsistent. > I can't find any reference for support before kitty. Are there any terminal emulators besides Kitty which support these attributes? They should perhaps be mentioned in the NEWS entry. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 2/3] Add support for styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Apr 2023 07:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168214683720606 (code B ref 62994); Sat, 22 Apr 2023 07:01:02 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2023 07:00:37 +0000 Received: from localhost ([127.0.0.1]:41562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pq7Ea-0005MH-Kx for submit@debbugs.gnu.org; Sat, 22 Apr 2023 03:00:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pq7EY-0005M4-EW for 62994@debbugs.gnu.org; Sat, 22 Apr 2023 03:00:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pq7ES-0004Fe-QQ; Sat, 22 Apr 2023 03:00:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=E8bpFYoj9NusJExsNx3oMdxJoY4cZymYPRg8yxeh0AY=; b=hBx/ONjpvPTx +oeLxscqpgmUL0bXdhBS8jrIIeCQj9VCHop/6AF1dCgMX39s4S6faL4aP5ZEXCfdQzGGikHvyLaZ6 bhNFcUsxzcj+urfTwmMmiGz8C0tpG9KmS2LPOZSFGfGwK94bxbMWL/wbf1cXLk7NoHi8MqU1UbL1G 4ehIqCO9YnHA4S3hpA8b0qWKZ0AS8aK7h9z7uulPAgl9+46TIOmxfxAh8YePVnuTzmHWIvs0PegVL wI0vOa+ZuPf23M7C+QJSAWF2IJerK4fKXSX5sNgbffUBzAP+V7Q0CFWUNbYbd6Xmhzs4HhRSuveCo t0xDfHIyBCcW/yDkYkIvPw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pq7ES-0001QX-8I; Sat, 22 Apr 2023 03:00:28 -0400 Date: Sat, 22 Apr 2023 10:00:46 +0300 Message-Id: <83ildo2yg1.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87zg713wlg.fsf@kisara.moe> (message from Mohsin Kaleem on Fri, 21 Apr 2023 19:43:07 +0100) References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-3-mohkale@kisara.moe> <83y1ml2p8a.fsf@gnu.org> <878rel5fqr.fsf@kisara.moe> <83sfct2kio.fsf@gnu.org> <87354t5cyq.fsf@kisara.moe> <87zg713wlg.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Cc: 62994@debbugs.gnu.org > Date: Fri, 21 Apr 2023 19:43:07 +0100 > > Mohsin Kaleem writes: > > > Cool, doesn't seem to be in the Emacs repo but I'm guessing it's this > > [1]. I'll try to adapt to it. > > I still don't get how to apply this to this repo Eli. You mentioned using > tabs and spaces but every lines aside from a nested expression starts > with 2 spaces. Some times there's 3 levels deep of expressions all > indented with spaces and then one tab width just wide enough at 8 > characters to appear like it's indented with spaces atop the previous > scope. > > Can I just do leading indent with tabs matching current indentation > level, curly braces 2 space ahead of the parent indent, and spaces ahead > of tabs to align a parenthesized expression or multi line condition with > the previous line? Why are you doing this manually? Emacs does that for you, as soon as you set indent-tabs-mode to a non-nil value. .dir-locals.el in the Emacs Git repository should do that automatically; it already does on the release branch and soon will be doing that on the master branch as well. And to reformat existing code, make a region around it and invoke "M-x tabify". There should be no need to insert tabs and spaces manually. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 2/3] Add support for styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Apr 2023 09:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.16821559485487 (code B ref 62994); Sat, 22 Apr 2023 09:33:02 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2023 09:32:28 +0000 Received: from localhost ([127.0.0.1]:41802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pq9bY-0001QR-14 for submit@debbugs.gnu.org; Sat, 22 Apr 2023 05:32:28 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:46836 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pq9bV-0001QE-27 for 62994@debbugs.gnu.org; Sat, 22 Apr 2023 05:32:27 -0400 Received: from mk-deck (unknown [146.70.132.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 57C3CA0FB5; Sat, 22 Apr 2023 11:32:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682155943; bh=tRFSg3fp2Kt/BwMxOGE2v9XIMNocAUeB0hg7ePpGT9k=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=q9pe4oCA42KOO3C58jB2jwcTwCctJSG1Cdq2FPFm2Ajg4j6NF9h6J+yiCJmSCWbZt 4/COaZTJqwurZspnwbYgYCYD1xs/z1WBH/J7emAM37N62/kVX7+PMQgnpiojvOVM4h n31JIhZ2JWtuO16eD5BRQjlmSogISZRgi8aqYdenHPKn4g72sHxo/58DLloJwQ6VCC idmRqfpy3lfhQANxumZsKCeVYgFnfutK7cZj+mQ4Q4l0/qh8cfLyyzvKZEZOcoTJyR ykD2xtXIQxIO/ukR788b9TAgw+I0VgSIQBRa9MGQtsW+HRHlfO3hsbM1hQt5YKD9JD iSKsttCQofm/A== From: Mohsin Kaleem In-Reply-To: <83ildo2yg1.fsf@gnu.org> References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-3-mohkale@kisara.moe> <83y1ml2p8a.fsf@gnu.org> <878rel5fqr.fsf@kisara.moe> <83sfct2kio.fsf@gnu.org> <87354t5cyq.fsf@kisara.moe> <87zg713wlg.fsf@kisara.moe> <83ildo2yg1.fsf@gnu.org> Date: Sat, 22 Apr 2023 10:32:23 +0100 Message-ID: <87r0scb6u0.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Eli Zaretskii writes: > Why are you doing this manually? Emacs does that for you, as soon as > you set indent-tabs-mode to a non-nil value. .dir-locals.el in the > Emacs Git repository should do that automatically; it already does on > the release branch and soon will be doing that on the master branch as > well. And to reformat existing code, make a region around it and > invoke "M-x tabify". > > There should be no need to insert tabs and spaces manually. Cool. If that works then I'll just reindent any affected hunks using M-x tabify :-). As for why I didn't do it before, I suppose because I'm used to Emacs never being able to indent as it should and then re-indenting on top of my changes with formatters like clang-format. When I don't have that the only approach I know of is manual. -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH 2/3] Add support for styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Apr 2023 09:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.16821574738754 (code B ref 62994); Sat, 22 Apr 2023 09:58:02 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2023 09:57:53 +0000 Received: from localhost ([127.0.0.1]:41829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqA08-0002H8-Tw for submit@debbugs.gnu.org; Sat, 22 Apr 2023 05:57:53 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:50016 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqA03-0002Gx-TC for 62994@debbugs.gnu.org; Sat, 22 Apr 2023 05:57:51 -0400 Received: from mk-deck (unknown [146.70.133.87]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id B02A0A0FB5; Sat, 22 Apr 2023 11:57:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682157466; bh=kUz4vqFInCd7w5Ib/lH4gwLKCHe4tyBNHpvUfSlbiQg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=sJBpPpRlayQJMkARM3hk2V918fbKJkbcoxPM+j2lezxw6gJZTS1qrVQQ0pcylFlSo dur9uM8n1PQrwZjzaDk5jPDtuU6T1vnRnlbicJGU+AAy70JoV/4K7MaBD8PD2h3AXm cxYqLQJZpCsZHbRBJJSyQ21Cg61Ge377lzSAcS7TuVfegNfALhupoJQDSmCQdmP04v hYZdr9nFN9ypLXD5LEIv4crkvXrQ3UV5779M3fI0D4j/uRKtAwZ7RkanrzuIfosYMQ Wpw52Y98ZX1czUFNIgYv0OiaXacWLeylcFVbcz+SFNVvmUmxR4v4+nKC1vv/oVGapy GWTbQwPSvHnQg== From: Mohsin Kaleem In-Reply-To: <83leik2z2n.fsf@gnu.org> References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-3-mohkale@kisara.moe> <83y1ml2p8a.fsf@gnu.org> <878rel5fqr.fsf@kisara.moe> <83sfct2kio.fsf@gnu.org> <87354t5cyq.fsf@kisara.moe> <83leik2z2n.fsf@gnu.org> Date: Sat, 22 Apr 2023 10:57:46 +0100 Message-ID: <87o7ngb5np.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Eli Zaretskii writes: > Are there any terminal emulators besides Kitty which support these > attributes? They should perhaps be mentioned in the NEWS entry. I've tested the following. I'll add the relevant ones to the NEWS file: - vte4 (through libvte). Supports both colored and styled underlines, but for some reason vte4 uses a TERM of xterm-256color for me so it hasn't got the termcaps to expose that it supports it. I guess it expects users to override it or is waiting for xterm to support it :/. - xterm doesn't. I've never used xterm, it might be possible to configure it but I won't bother testing too thoroughly. - St supports styled and colored underlines through the curly underlines patch. - xterm.js apparently supports it [1] but installing hyper to check is taking forever so I can't confirm :/. Darn web terminals. [1]: https://github.com/xtermjs/xterm.js/issues/1145 -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v3 1/1] Add support for colored and styled underlines on tty frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Apr 2023 10:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , 62994@debbugs.gnu.org Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168215891911444 (code B ref 62994); Sat, 22 Apr 2023 10:22:01 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2023 10:21:59 +0000 Received: from localhost ([127.0.0.1]:41901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqANS-0002yU-2q for submit@debbugs.gnu.org; Sat, 22 Apr 2023 06:21:59 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:58994 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqANN-0002yE-Lw for 62994@debbugs.gnu.org; Sat, 22 Apr 2023 06:21:56 -0400 Received: from localhost.localdomain (unknown [146.70.133.87]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 3E342A0FFD; Sat, 22 Apr 2023 12:21:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682158912; bh=IwuBsaHFZkmWm0xIYK0Hqh7ZntEBOz6shNXlC/jvjgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nq7RwZRnxVMyIpNKtlGI95avwKzLJWBvTRoFDUm0PUEQaL1U3YFi1xW8vV+I2gSlY gN8/YFntnAMGLfsE+dnetyTWheNyK9YhHICiQkJlkX0VFyOuciEEJY59AkVC+2Hc7C GxdW9gA8d5KRO8hvsvob8wvgswbWEssD4kB9zv+han+WYy34Iu8t+IBWrMrS/kwow5 RsbZFlQkZ5lJzjEAHzPKQ3GxJgyrAdV3tSi91hh1zi71QsC7PEIhQDKVhyqgw6D/PV Vuk9fyF/De0WBaG/UiSs/QBISQFrn/WTRF8JKmcbcrZgW5jZAAq7CI7xVzm3ny1cW9 S8n37Z3N7/erw== From: mohkale@kisara.moe Date: Sat, 22 Apr 2023 11:21:46 +0100 Message-Id: <20230422102146.93003-2-mohkale@kisara.moe> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230422102146.93003-1-mohkale@kisara.moe> References: <20230422102146.93003-1-mohkale@kisara.moe> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem * 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, Dotted and Dashed. 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, Dotted and Dashed 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): 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. --- etc/NEWS | 13 +++++ lisp/cus-face.el | 5 +- src/dispextern.h | 10 ++-- src/term.c | 54 +++++++++++++++++++-- src/termchar.h | 7 +++ src/xfaces.c | 121 ++++++++++++++++++++++++++++++++++++++++++----- 6 files changed, 190 insertions(+), 20 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 62d2fdcd3a4..b552bb2d75e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1916,6 +1916,19 @@ This command switches to the "*scratch*" buffer. If "*scratch*" doesn't exist, the command creates it first. You can use this command if you inadvertently delete the "*scratch*" buffer. +--- +** 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 or a color other than the foreground-color. +The available underline styles for TTY frames are 'double', 'wave', +'dotted', and 'dashed'. These are currently supported by Kitty, +libvte, and st (through the undercurl patch) among other terminals. + ** Debugging --- diff --git a/lisp/cus-face.el b/lisp/cus-face.el index ec89b4f7ff6..2d6e6c7b73e 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -141,7 +141,10 @@ custom-face-attributes (const :format "" :value :style) (choice :tag "Style" (const :tag "Line" line) - (const :tag "Wave" wave)) + (const :tag "Double" double) + (const :tag "Wave" wave) + (const :tag "Dotted" dotted) + (const :tag "Dashed" dashed)) (const :format "" :value :position) (choice :tag "Position" (const :tag "At Default Position" nil) diff --git a/src/dispextern.h b/src/dispextern.h index 4dcab113ea2..753bee446f1 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1653,9 +1653,13 @@ #define FONT_TOO_HIGH(ft) \ enum face_underline_type { + /* Note: Order matches the order of the Smulx terminfo extension. */ FACE_NO_UNDERLINE = 0, FACE_UNDER_LINE, - FACE_UNDER_WAVE + FACE_DOUBLE_UNDER_LINE, + FACE_UNDER_WAVE, + FACE_DOTTED_UNDER_LINE, + FACE_DASHED_UNDER_LINE, }; /* Structure describing a realized face. @@ -1737,7 +1741,7 @@ #define FONT_TOO_HIGH(ft) \ ENUM_BF (face_box_type) box : 2; /* Style of underlining. */ - ENUM_BF (face_underline_type) underline : 2; + ENUM_BF (face_underline_type) underline : 3; /* If `box' above specifies a 3D type, true means use box_color for drawing shadows. */ @@ -1769,7 +1773,6 @@ #define FONT_TOO_HIGH(ft) \ string meaning the default color of the TTY. */ bool_bf tty_bold_p : 1; bool_bf tty_italic_p : 1; - bool_bf tty_underline_p : 1; bool_bf tty_reverse_p : 1; bool_bf tty_strike_through_p : 1; @@ -3361,6 +3364,7 @@ #define TTY_CAP_BOLD 0x04 #define TTY_CAP_DIM 0x08 #define TTY_CAP_ITALIC 0x10 #define TTY_CAP_STRIKE_THROUGH 0x20 +#define TTY_CAP_UNDERLINE_STYLED 0x32 & TTY_CAP_UNDERLINE /*********************************************************************** diff --git a/src/term.c b/src/term.c index 53ba2a231e4..b4fb607ee1f 100644 --- a/src/term.c +++ b/src/term.c @@ -1948,8 +1948,19 @@ turn_on_face (struct frame *f, int face_id) OUTPUT1 (tty, tty->TS_enter_dim_mode); } - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + if (face->underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) + { + if (face->underline == FACE_UNDER_LINE + || !tty->TF_set_underline_style) + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + else if (tty->TF_set_underline_style) + { + char *p; + p = tparam(tty->TF_set_underline_style, NULL, 0, face->underline, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } + } if (face->tty_strike_through_p && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) @@ -1975,6 +1986,14 @@ turn_on_face (struct frame *f, int face_id) OUTPUT (tty, p); xfree (p); } + + ts = tty->TF_set_underline_color; + if (ts && face->underline_color) + { + p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } } } @@ -1995,7 +2014,7 @@ turn_off_face (struct frame *f, int face_id) if (face->tty_bold_p || face->tty_italic_p || face->tty_reverse_p - || face->tty_underline_p + || face->underline || face->tty_strike_through_p) { OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); @@ -2007,7 +2026,7 @@ turn_off_face (struct frame *f, int face_id) { /* If we don't have "me" we can only have those appearances that have exit sequences defined. */ - if (face->tty_underline_p) + if (face->underline) OUTPUT_IF (tty, tty->TS_exit_underline_mode); } @@ -2036,6 +2055,9 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_UNDERLINE_STYLED, tty->TF_set_underline_style, + NC_UNDERLINE); TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); TTY_CAPABLE_P_TRY (tty, @@ -4250,6 +4272,30 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TF_underscore = tgetflag ("ul"); tty->TF_teleray = tgetflag ("xt"); + /* Styled underlines. Support for this is provided either by the + escape sequence in Smulx or the Su flag. The latter results in a + common default escape sequence and is not recommended. */ +#ifdef TERMINFO + tty->TF_set_underline_style = tigetstr("Smulx"); + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) + tty->TF_set_underline_style = NULL; +#else + tty->TF_set_underline_style = tgetstr("Smulx", address); +#endif + if (!tty->TF_set_underline_style && tgetflag("Su")) + /* Default to the kitty escape sequence. See + https://sw.kovidgoyal.net/kitty/underlines/ */ + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + + if (tty->TF_set_underline_style) + /* This escape sequence for setting the underline color is + consistent with the one described in kitty (see above) and + adapted from the one used by neovim. This sequence has + been altered from the neovim sequence at + https://github.com/neovim/neovim/blob/42f492ac99058bd1cd56c3c7871e7e464b2a5e24/src/nvim/tui/tui.c#L1932 + to require only a single parameter, the color index. */ + tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 5c47679a994..a9c28fff5cf 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -171,6 +171,13 @@ #define EMACS_TERMCHAR_H non-blank position. Must clear before writing _. */ int TF_teleray; /* termcap xt flag: many weird consequences. For t1061. */ + const char *TF_set_underline_style; /* termcap Smulx entry: Switches the underline + style based on the parameter. Param should + be one of: 0 (none), 1 (straight), 2 (double), + 3 (wave), 4 (dotted), or 5 (dashed). */ + const char *TF_set_underline_color; /* Enabled when TF_set_underline_style is set: + Sets the color of the underline. Accepts a + single parameter, the color index. */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index 37b703984be..f07bb6c8eca 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3255,7 +3255,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, } else if (EQ (key, QCstyle) - && !(EQ (val, Qline) || EQ (val, Qwave))) + && !(EQ (val, Qline) + || EQ (val, Qdouble) + || EQ (val, Qwave) + || EQ (val, Qdotted) + || EQ (val, Qdashed))) { valid_p = false; break; @@ -5204,6 +5208,7 @@ gui_supports_face_attributes_p (struct frame *f, Lisp_Object attrs[LFACE_VECTOR_SIZE], struct face *def_face) { + Lisp_Object val; Lisp_Object *def_attrs = def_face->lface; Lisp_Object lattrs[LFACE_VECTOR_SIZE]; @@ -5298,6 +5303,20 @@ gui_supports_face_attributes_p (struct frame *f, return false; } + /* Check supported underline styles. */ + val = attrs[LFACE_UNDERLINE_INDEX]; + if (!UNSPECIFIEDP (val)) + { + if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) + { + return false; /* Unsupported underline style */ + } + } + } + /* Everything checks out, this face is supported. */ return true; } @@ -5390,15 +5409,26 @@ tty_supports_face_attributes_p (struct frame *f, val = attrs[LFACE_UNDERLINE_INDEX]; if (!UNSPECIFIEDP (val)) { - if (STRINGP (val)) - return false; /* ttys can't use colored underlines */ - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) - return false; /* ttys can't use wave underlines */ - else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) - return false; /* same as default */ - else - test_caps |= TTY_CAP_UNDERLINE; - } + if (STRINGP (val)) + test_caps |= TTY_CAP_UNDERLINE_STYLED; + else if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) + { + return false; /* Face uses an unsupported underline style. */ + } + + test_caps |= TTY_CAP_UNDERLINE_STYLED; + } + else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) + return false; /* same as default */ + else + test_caps |= TTY_CAP_UNDERLINE; + } /* inverse video */ val = attrs[LFACE_INVERSE_INDEX]; @@ -6319,6 +6349,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face->underline = FACE_UNDER_LINE; else if (EQ (value, Qwave)) face->underline = FACE_UNDER_WAVE; + else + face->underline = FACE_UNDER_LINE; } else if (EQ (keyword, QCposition)) { @@ -6453,6 +6485,7 @@ realize_tty_face (struct face_cache *cache, { struct face *face; int weight, slant; + Lisp_Object underline; bool face_colors_defaulted = false; struct frame *f = cache->f; @@ -6472,13 +6505,74 @@ realize_tty_face (struct face_cache *cache, face->tty_bold_p = true; if (slant != 100) face->tty_italic_p = true; - if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) - face->tty_underline_p = true; if (!NILP (attrs[LFACE_INVERSE_INDEX])) face->tty_reverse_p = true; if (!NILP (attrs[LFACE_STRIKE_THROUGH_INDEX])) face->tty_strike_through_p = true; + /* Text underline. */ + underline = attrs[LFACE_UNDERLINE_INDEX]; + if (NILP (underline)) + { + face->underline = FACE_NO_UNDERLINE; + face->underline_color = 0; + } + else if (EQ (underline, Qt)) + { + face->underline = FACE_UNDER_LINE; + face->underline_color = 0; + } + else if (STRINGP (underline)) + { + face->underline = FACE_UNDER_LINE; + face->underline_color = load_color (f, face, underline, LFACE_UNDERLINE_INDEX); + } + else if (CONSP (underline)) + { + /* `(:color COLOR :style STYLE)'. + STYLE being one of `line', `double', `wave', `dotted' or `dashed'. */ + face->underline = FACE_UNDER_LINE; + face->underline_color = 0; + + while (CONSP (underline)) + { + Lisp_Object keyword, value; + + keyword = XCAR (underline); + underline = XCDR (underline); + + if (!CONSP (underline)) + break; + value = XCAR (underline); + underline = XCDR (underline); + + if (EQ (keyword, QCcolor)) + { + if (EQ (value, Qforeground_color)) + face->underline_color = 0; + else if (STRINGP (value)) + face->underline_color + = load_color (f, face, value, + LFACE_UNDERLINE_INDEX); + } + else if (EQ (keyword, QCstyle)) + { + if (EQ (value, Qline)) + face->underline = FACE_UNDER_LINE; + else if (EQ (value, Qdouble)) + face->underline = FACE_DOUBLE_UNDER_LINE; + else if (EQ (value, Qwave)) + face->underline = FACE_UNDER_WAVE; + else if (EQ (value, Qdotted)) + face->underline = FACE_DOTTED_UNDER_LINE; + else if (EQ (value, Qdashed)) + face->underline = FACE_DASHED_UNDER_LINE; + else + face->underline = FACE_UNDER_LINE; + } + } + } + /* Map color names to color indices. */ map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); @@ -7165,6 +7259,9 @@ syms_of_xfaces (void) DEFSYM (QCposition, ":position"); DEFSYM (Qline, "line"); DEFSYM (Qwave, "wave"); + DEFSYM (Qdouble, "double"); + DEFSYM (Qdotted, "dotted"); + DEFSYM (Qdashed, "dashed"); DEFSYM (Qreleased_button, "released-button"); DEFSYM (Qpressed_button, "pressed-button"); DEFSYM (Qflat_button, "flat-button"); -- 2.40.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v3 0/1] Support styled underlines on tty Emacs frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Apr 2023 10:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , 62994@debbugs.gnu.org Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168215891911450 (code B ref 62994); Sat, 22 Apr 2023 10:22:02 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2023 10:21:59 +0000 Received: from localhost ([127.0.0.1]:41903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqANT-0002yX-2a for submit@debbugs.gnu.org; Sat, 22 Apr 2023 06:21:59 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:58988 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqANN-0002yD-Lz for 62994@debbugs.gnu.org; Sat, 22 Apr 2023 06:21:57 -0400 Received: from localhost.localdomain (unknown [146.70.133.87]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 07D2DA0FB5; Sat, 22 Apr 2023 12:21:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1682158912; bh=6g0KC4G4H/YUwO7HIoEj+HjhIuo6Y2jWHVVql078lDU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zXeim4WlCdI4O9EWPFGWSYPShk3extrqqldjFOSN9zt8yjWR9JtTQkczR8mW4X1IA bs4Ldl73kow6teI77+0Q/1HRh8cI45MFMTYjWPi4YioaueppB3KIZBzye5DHw32X7G GkBlnvcwYcsxn0N7s06qlqfEFDk31LjJSge/O6W3vBjJqXcPi7QPYm80uylNLu/XsS L6Zdjp8bZYMkq2TufQ/op6Q/4yW8MCZU3ZLhDOc7+uCLnQktXJJUfjp3GeXLlYzyuV s/CHB57Dv0pJxhB+UMm1esvao/NEfSHVPhcH1W69eKvQwHFcuDd5DNOiFcZ/ZQQc0l ZIwEKYti5TpqA== From: mohkale@kisara.moe Date: Sat, 22 Apr 2023 11:21:45 +0100 Message-Id: <20230422102146.93003-1-mohkale@kisara.moe> X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem Modern terminals (such as kitty) support setting the style of an underline with the escape sequence exposed in the Smulx termcap. This allows for (among others) wavy underlines on terminals. These terminals also support setting the color of these underlines using a separate escape sequence that to the best of my knowledge is not exposed as a termcap but has been adopted by other terminal supporting editors like neovim. Version 3: All changed hunks reformatted with M-x tabify. I think the only comment that hasn't been actioned on is whether to retain the original order of underline styles in face_underline_type. Mohsin Kaleem (1): Add support for colored and styled underlines on tty frames etc/NEWS | 13 +++++ lisp/cus-face.el | 5 +- src/dispextern.h | 10 ++-- src/term.c | 54 +++++++++++++++++++-- src/termchar.h | 7 +++ src/xfaces.c | 121 ++++++++++++++++++++++++++++++++++++++++++----- 6 files changed, 190 insertions(+), 20 deletions(-) -- 2.40.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v2 1/1] Add support for colored and styled underlines on tty frames Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Apr 2023 09:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mohkale@kisara.moe Cc: Eli Zaretskii , 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168232811432251 (code B ref 62994); Mon, 24 Apr 2023 09:22:01 +0000 Received: (at 62994) by debbugs.gnu.org; 24 Apr 2023 09:21:54 +0000 Received: from localhost ([127.0.0.1]:47531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqsOQ-0008O7-2R for submit@debbugs.gnu.org; Mon, 24 Apr 2023 05:21:54 -0400 Received: from mail-wm1-f43.google.com ([209.85.128.43]:61787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqsON-0008Nt-Ii for 62994@debbugs.gnu.org; Mon, 24 Apr 2023 05:21:52 -0400 Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-3f1950f5676so29961555e9.3 for <62994@debbugs.gnu.org>; Mon, 24 Apr 2023 02:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682328105; x=1684920105; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=IwUvFTrTku2uHuRl8/j6BwBvKqn/gvsB97A0hY1Qido=; b=kW5mThTjS3+YwadZsiarnem2Y8FnlSE7k+x/CgqXFCkVAgxJJadoniekxY1CmLeYE2 VXhh1QfxX957/IPIh3bCK4mY+l7o3nBhnpiDk1sGcDW+/f+O4njPnIKojWOr1pdAR3q1 eBIvL2rPUMS6zqu+ufXyTnZJSDDbeXVPA7yUnKVlbopuGlQ8Sd1Lwb02eozhJTvSdydF yYonIlpDH9aPVsWcmXjP1UV9Q0eDbcXOJtA50R6AEsskmOdOsnI/UpShCeEsWoWHHWm6 sJrIQ3uImziVCcWbKLfEXCHvs99EjHaNO3FtqkQ+PisYSno2+hKbq9XP01ouYOsJsZKM DCNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682328105; x=1684920105; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IwUvFTrTku2uHuRl8/j6BwBvKqn/gvsB97A0hY1Qido=; b=D4pU+xu04rVu4F7HwjG/X3/hSEPO+L3llK4/0sjk3t89pJMiZCh41tHsva22SFJcCz Y7WodITyg4PYWzWmEevS+IfCRwfIfORi8XvdrSLvckw4j1ZYYCcyKKGean5hEFbZFUYF 72Zjs0+8Kd6vfVDe0e4zyyehr0oMFcsvRyq+vehUtaLZl9wCrNgm4nFpPPQmWPQEtjIO CdUxRWdTs2NJGUbO+Tp/Rmawy9m0tb/lUjWX3PXifnbL0UKfdWWqGCa2tLjMvLqJj+/q e8tUvNvjANnhhXiaXBC0qxQlffXVa5UVzIKnz7UfHU92787bBdTf5U+/mGM2qw3pc1TO oVjQ== X-Gm-Message-State: AAQBX9fKQjAK9lLy5dgtrGr+SX2I694GlUwOIedW4CRIQBQr82VroP9n hl02reHdG/GfVNXn+L783xPPYXfFpi0= X-Google-Smtp-Source: AKy350ZtWEczGaVZKVD2wICovl4Ij0hGVBs+NRsYrzPvajR5PKu/QJDIFKBUnso523r9yDhFa/8XDg== X-Received: by 2002:a1c:4b1a:0:b0:3ef:561d:255d with SMTP id y26-20020a1c4b1a000000b003ef561d255dmr6372939wma.41.1682328105177; Mon, 24 Apr 2023 02:21:45 -0700 (PDT) Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id w9-20020a05600c474900b003f17e37ce60sm15077683wmo.47.2023.04.24.02.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 02:21:44 -0700 (PDT) From: Robert Pluim In-Reply-To: <20230421192433.579140-2-mohkale@kisara.moe> (mohkale@kisara.moe's message of "Fri, 21 Apr 2023 20:24:33 +0100") References: <20230421192433.579140-1-mohkale@kisara.moe> <20230421192433.579140-2-mohkale@kisara.moe> Date: Mon, 24 Apr 2023 11:21:43 +0200 Message-ID: <87sfcpbpp4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Fri, 21 Apr 2023 20:24:33 +0100, mohkale@kisara.moe said: Mohsin> From: Mohsin Kaleem Mohsin> * src/dispextern.h (face, face_underline_type, Mohsin> syms_of_xfacse, This typo tell me you=CA=BCre not using 'C-x 4 a' to generate your ChangeLog entries. =20 Mohsin> +--- Mohsin> +** Support for 'styled' and 'colored' underline face Mohsin> attributes on TTY frames Full stop at the end of the sentence please. Mohsin> + if (face->underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERL= INE)) Mohsin> + { Mohsin> + if (face->underline =3D=3D FACE_UNDER_LINE Mohsin> + || !tty->TF_set_underline_style) Mohsin> + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); Mohsin> + else if (tty->TF_set_underline_style) Mohsin> + { Mohsin> + char *p; Mohsin> + p =3D tparam(tty->TF_set_underline_style, NULL, 0, face->und= erline, 0, 0, 0); Mohsin> + OUTPUT (tty, p); Mohsin> + xfree (p); Mohsin> + } Mohsin> + } space before '(' please. Mohsin> else if (EQ (key, QCstyle) Mohsin> - && !(EQ (val, Qline) || EQ (val, Qwave)= )) Mohsin> + && !(EQ (val, Qline) Mohsin> + || EQ (val, Qdouble) Mohsin> + || EQ (val, Qwave) Mohsin> + || EQ (val, Qdotted) Mohsin> + || EQ (val, Qdashed))) If this was in lisp I=CA=BCd expect to see `memq', but we work with what we have :-) Mohsin> + /* Check supported underline styles. */ Mohsin> + val =3D attrs[LFACE_UNDERLINE_INDEX]; Mohsin> + if (!UNSPECIFIEDP (val)) Mohsin> + { Mohsin> + if (EQ (CAR_SAFE (val), QCstyle)) Mohsin> + { Mohsin> + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) Mohsin> + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) Mohsin> + { Mohsin> + return false; /* Unsupported underline style */ Mohsin> + } Mohsin> + } Mohsin> + } Mohsin> + Mohsin> /* Everything checks out, this face is supported. */ Mohsin> return true; Mohsin> } Your TAB usage here still looks wrong Mohsin> @@ -5390,15 +5409,26 @@ tty_supports_face_attributes_p (struct = frame *f, Mohsin> val =3D attrs[LFACE_UNDERLINE_INDEX]; Mohsin> if (!UNSPECIFIEDP (val)) Mohsin> { Mohsin> - if (STRINGP (val)) Mohsin> - return false; /* ttys can't use colored underlines */ Mohsin> - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (C= DR_SAFE (val)), Qwave)) Mohsin> - return false; /* ttys can't use wave underlines */ Mohsin> - else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLI= NE_INDEX])) Mohsin> - return false; /* same as default */ Mohsin> - else Mohsin> - test_caps |=3D TTY_CAP_UNDERLINE; Mohsin> - } Mohsin> + if (STRINGP (val)) Mohsin> + test_caps |=3D TTY_CAP_UNDERLINE_STYLED; Mohsin> + else if (EQ (CAR_SAFE (val), QCstyle)) Mohsin> + { Mohsin> + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) Mohsin> + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) Mohsin> + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) Mohsin> + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) Mohsin> + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) Mohsin> + { Mohsin> + return false; /* Face uses an unsupported underline style. = */ Mohsin> + } Mohsin> + Mohsin> + test_caps |=3D TTY_CAP_UNDERLINE_STYLED; Mohsin> + } Mohsin> + else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_IN= DEX])) Mohsin> + return false; /* same as default */ Mohsin> + else Mohsin> + test_caps |=3D TTY_CAP_UNDERLINE; Mohsin> + } And here. Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 06 07:07:02 2023 Received: (at control) by debbugs.gnu.org; 6 Sep 2023 11:07:03 +0000 Received: from localhost ([127.0.0.1]:33094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdqNC-0003ij-Na for submit@debbugs.gnu.org; Wed, 06 Sep 2023 07:07:02 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:54619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdqNA-0003i7-Ur for control@debbugs.gnu.org; Wed, 06 Sep 2023 07:07:01 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-50078e52537so5923153e87.1 for ; Wed, 06 Sep 2023 04:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693998414; x=1694603214; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=DddI3oEudR9FOCnYH8KXQ3ksPjhgzB4Y4qbOaavheWI=; b=JoHu9RfUIwABXIbHu3DQKkMWTEzJNGt1RlkIKNnuMAMrqpm1+3t9U3sGhgV4PUj3HO qgbVJF59MC2hQlakU/NlPKcwcrwEgvDJayILrGSEDr4eGPNxXroIF6fT7VVZDOVGQpFW QeuXB7DcHMwCPeV2G2eEp8VjEU8zXOwfpHIxWohLhVCQJzxNkC2YkQuRAEotxkYdwysa GNfJ3scujb8DIB0deuVcU62nfE41pwPXfJDVZl6/TxSemEEt/TN+YDnQvbhVfz9GBdSW ExEADXD1YGHwsqKPxO0ana0SnnNkYSHkwcFsneX8zG1LraWzTAQDLPdQweyohlMozzWS JPpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693998414; x=1694603214; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=DddI3oEudR9FOCnYH8KXQ3ksPjhgzB4Y4qbOaavheWI=; b=OsQhSUKPAItMjuNeCv+BlwFx+ODg3TiiLkyi7X9Vrgnbwq+xh86dWS0nt3YzHgu/yp AUb2qEmWAgjhroAsa0uycuyR0Q1PNu7MLOxg8edca64NoNYkrrqy55gqnmbWcw8RCHKx SQc1cYEQvJzj4yECiRPCgDRVWgpUY1XfYI+5ZXxwmq0QE6ShDxuE2wLSH99gVffmf86b rU6HWmxm2k9BKUPPCrRZnzl+OGA+G33pqeSGzDegxT9ebn5RYTbEImkVARfcwTEIAaBE ank7iL1+ZE2pOxH9Ft7rdEbpYUMuolB9xPLg//aYqQ/zjbqNQvk1FwBV52sODyxyeq25 2Dlw== X-Gm-Message-State: AOJu0YwJ57zCZgHeikOg5DKq2ybtsLwYLO/ba5tP87Zxx7gmnJFBv0Bx HdhcfocHCqk//xB71hnCctBMI6FtXypPOq0G2VYjY4u+bZA= X-Google-Smtp-Source: AGHT+IGXZxOcmS06Df3N8YdQAMhAi/Mg2U4niGpZLZ+sgkC+tvqtmQfrdpFXkAmTqWLbJI3RlMtOKLtYckXXrhMGQQQ= X-Received: by 2002:a19:2d15:0:b0:4fb:94c6:fd63 with SMTP id k21-20020a192d15000000b004fb94c6fd63mr1826861lfj.17.1693998413696; Wed, 06 Sep 2023 04:06:53 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 6 Sep 2023 04:06:53 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Wed, 6 Sep 2023 04:06:53 -0700 Message-ID: Subject: control message for bug #62994 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 62994 wishlist quit From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v3 0/1] Support styled underlines on tty Emacs frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jan 2024 11:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.170644145227487 (code B ref 62994); Sun, 28 Jan 2024 11:31:02 +0000 Received: (at 62994) by debbugs.gnu.org; 28 Jan 2024 11:30:52 +0000 Received: from localhost ([127.0.0.1]:56768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rU3ND-00079G-Ns for submit@debbugs.gnu.org; Sun, 28 Jan 2024 06:30:51 -0500 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:41966 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rU3N8-000793-Cd for 62994@debbugs.gnu.org; Sun, 28 Jan 2024 06:30:50 -0500 Received: from kisara.moe (vps788627.ovh.net [51.38.65.119]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 5DE69A2795; Sun, 28 Jan 2024 12:30:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1706441437; bh=ciCL4xeMRD9S61xlMOEt4uWiLmrLgKlhN7+hvHAFU9s=; h=From:To:Subject:In-Reply-To:References:Date:From; b=eg7D7HAUIxVwTgfAZ5MahlwbuD6B3ncQpq7PbmVr9C64TioA2KwE2W3ANEnoBw3LB YyQHEwhD+F2yRtfZEK67iHw9A5o6GXfPoRKeji5+VlCm/8zB1Tj2dxAVfh9+M5ssJ5 vG7sWjvUPqPQNkvd4ZlsyLV7B8QwfwRiCjE0Uj4V8j5o5IVlIfHYS9aSOIJ8p5DWiW XMuMk8csMuZjk1FXf7bfl1EzwewcDYZkfz8WrtNgZVUB3Nf1ofQGoqAyRaNb3hc8n6 vFDIxY0hRBnAj8ROu3AxWCtDJtlNC3OD+1l9r0mAm/7GMADl91BIKy5nxWRC2kxHCD zgrqapl5QkdqA== From: Mohsin Kaleem In-Reply-To: <20230422102146.93003-1-mohkale@kisara.moe> References: <20230422102146.93003-1-mohkale@kisara.moe> Date: Sun, 28 Jan 2024 12:30:25 +0100 Message-ID: <86le89itke.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) mohkale@kisara.moe writes: Hi there, My copyright situation should be solved now. I was waiting on something else from my work but would rather not put this off any longer. I've figured out how to do the correct resolution for color. Only thing that's confusing me a little is that in src/xfaces:6466 for map_tty_color it looks like we change the color in the face spec itself only on MSDOS frames. What are the ramifications of this? Is this logic we want to keep going forward? For reference I don't this should be done for the underline spec because unlike foreground and background it can be a string or a plist containing the color value and we would not want to update it in place. -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v3 0/1] Support styled underlines on tty Emacs frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jan 2024 12:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.170644355531911 (code B ref 62994); Sun, 28 Jan 2024 12:06:02 +0000 Received: (at 62994) by debbugs.gnu.org; 28 Jan 2024 12:05:55 +0000 Received: from localhost ([127.0.0.1]:56778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rU3v8-0008Id-TE for submit@debbugs.gnu.org; Sun, 28 Jan 2024 07:05:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rU3v5-0008IK-9w for 62994@debbugs.gnu.org; Sun, 28 Jan 2024 07:05:53 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rU3us-0002zm-2Y; Sun, 28 Jan 2024 07:05:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3PwMjgVb65T3npL1jp4FvcPpqs5yZMTMhB+0sZa5Xlc=; b=qPWF6ST0/0Qm UCyfWLzHTb48STM2ek4S5BcRCeaxqGjgEjur1tanNdr2RSWa1Qiw4S3o6Vb05PfvOcPWpnoAPpuyP HJlvMUk3JmkerVg96JoDOwR/gl5XFES0vRhs1aZ0UW63xfK3uyotaDRBSErZFo/HEAvb6EjjWyoqv u/Lz5U5t3AnhSt2ixWHlyYgkV8t5eDMdi2afKsorNJb3xMBUVEN4D3n27GMP/NUNbMYx4gsAOVXZ6 8un5bIfcT/2u9vfg8v9xbOzwRRxkDMAJOn0p7dxykzfc+ipvfBsHfZOxk9BrteYS7n6oZz2Zzx0P0 dxdotO+CPy5UiqfNiZTk+A==; Date: Sun, 28 Jan 2024 14:05:32 +0200 Message-Id: <86a5op64tv.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <86le89itke.fsf@kisara.moe> (message from Mohsin Kaleem on Sun, 28 Jan 2024 12:30:25 +0100) References: <20230422102146.93003-1-mohkale@kisara.moe> <86le89itke.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Date: Sun, 28 Jan 2024 12:30:25 +0100 > > mohkale@kisara.moe writes: > > My copyright situation should be solved now. I was waiting on something > else from my work but would rather not put this off any longer. That's good to know, thanks. > I've > figured out how to do the correct resolution for color. Only thing > that's confusing me a little is that in src/xfaces:6466 for > map_tty_color it looks like we change the color in the face spec itself > only on MSDOS frames. What are the ramifications of this? Is this logic > we want to keep going forward? The MSDOS frames are different from other TTY frames in that we can know the default colors used by the MSDOS terminals. That's why MSDOS needs a special code there. And yes, we want to keep this logic, for MSDOS only. > For reference I don't this should be done for the underline spec > because unlike foreground and background it can be a string or a > plist containing the color value and we would not want to update it > in place. The MSDOS terminal doesn't support underline, so no worries here. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v3 0/1] Support styled underlines on tty Emacs frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jan 2024 12:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.170653184229782 (code B ref 62994); Mon, 29 Jan 2024 12:38:02 +0000 Received: (at 62994) by debbugs.gnu.org; 29 Jan 2024 12:37:22 +0000 Received: from localhost ([127.0.0.1]:59232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUQt7-0007kH-TZ for submit@debbugs.gnu.org; Mon, 29 Jan 2024 07:37:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUQt5-0007k4-AY for 62994@debbugs.gnu.org; Mon, 29 Jan 2024 07:37:19 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUQsr-0001K7-MK; Mon, 29 Jan 2024 07:37:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MIaNbvVpEYAxacRgHckWL1prBwCeB7PlfcTFoY91MCQ=; b=UyZZz/j6GQ3Z /h3We3sPIqnaKu5nBwjn73hiQ1mo7Ygx4Rrvsj51Qs+wERKj8rP/L0Ks5rJbTl00eMbBg25xBmK2e ONc4LnhhzWnVRW7kvoTTN6rv0KK3WbHcoC4xMmYBmc+CLTP+pIRrj5zuU94n+nnrR832Wzk7rAlUn lCDZRGGhmP6+I12SZ1L9kAu25hLgKxVmrqiHQw4EosnYzdCmdabLmkn7k6wBuhh0o8no3qz68grrj ywFrH3q1FKuJ/btzPge3qV4gZnKPyvyVhxBHcIcIcMUc0vLZRSxGYGytkfU3hZke/mbra16zSYgbj wlL6vcuusp4B7RboJep9uA==; Date: Mon, 29 Jan 2024 14:37:03 +0200 Message-Id: <86h6iw48pc.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <86fryg62kh.fsf@kisara.moe> (message from Mohsin Kaleem on Mon, 29 Jan 2024 08:06:38 +0100) References: <20230422102146.93003-1-mohkale@kisara.moe> <86le89itke.fsf@kisara.moe> <86a5op64tv.fsf@gnu.org> <86fryg62kh.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [Please use Reply All to reply, to keep the bug tracker CC'ed.] > From: Mohsin Kaleem > Date: Mon, 29 Jan 2024 08:06:38 +0100 > > Eli Zaretskii writes: > > > The MSDOS frames are different from other TTY frames in that we can > > know the default colors used by the MSDOS terminals. That's why MSDOS > > needs a special code there. And yes, we want to keep this logic, for > > MSDOS only. > > Interesting. Didn't know MSDOS terminals expose that. Neat. Although why > do we update the face spec (face->lface) itself in this case instead of > only the foreground/background values which we do later anyways. AFAIR, it's because those default colors are then used to define the 'default' face and the frame's fore/back-ground pixel values, so we need the actual colors. > face->lface seems to be the actual spec set in the theme/customisation > display (unless I'm misunderstanding). If we change it wouldn't that > alter what's shown in customize for example. How can that alter what is shown, when the colors we stick in the face are the exact colors that the screen uses? It's like you take a "blue" color that is specified by the special name "default" and replace it with an actual "blue" -- how can the result be different. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v4 2/3] Add support for styled underlines on tty frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2024 17:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org, Eli Zaretskii Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.170767178732417 (code B ref 62994); Sun, 11 Feb 2024 17:17:02 +0000 Received: (at 62994) by debbugs.gnu.org; 11 Feb 2024 17:16:27 +0000 Received: from localhost ([127.0.0.1]:32974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDRK-0008Qf-EV for submit@debbugs.gnu.org; Sun, 11 Feb 2024 12:16:27 -0500 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:37578 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDRI-0008QX-6r for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 12:16:25 -0500 Received: from mk-desktop.Home (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 35505A2798; Sun, 11 Feb 2024 18:16:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1707671767; bh=VUWdFYAkLdhoWtAlgUtW6mevFH7NW8tCuwRzOkST0Q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f7N//WysO5NNlbCO3CaME5KKyaioCE/rAtIniWU/RphzCw1p4SWj4mCqoEZuyh7PW o6P1raGD1L4n0L6z0uI8RRpdgbxL2+lWt/Qydx5b4mjT/rHoZom3wR0kxjqs8nR1X1 /hNQE/zExRUbMMx/gJlQHRFhry85/Wpgr+xN+r1q12SpgArDLKO1tAsgloQ/gWn7YS +lqYvo3Ff3xFmjM8c7dI+aB22ayoKd255Vv+krKP1jPhvptcK+X4i6LKJqFHtwlCWb U4gSLmOzT2k231jlC3V2ysllU0Rcnclq7wMgUD+SD0X8/sGB1X+vN3jaFpGW+v4m4i QYGkAvz0SJSwQ== From: mohkale@kisara.moe Date: Sun, 11 Feb 2024 17:15:55 +0000 Message-ID: <20240211171556.597236-3-mohkale@kisara.moe> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240211171556.597236-1-mohkale@kisara.moe> References: <20240211171556.597236-1-mohkale@kisara.moe> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem * src/dispextern.h (face): Convert tty_underline_p from bool to a face_underline_type enumeration. Add a flag to check whether styled underlines are available. * src/termchar.c (tty_display_info): Add an entry for the escape sequence to set the underline style 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. * src/xfaces.c (tty_supports_face_attributes_p, realize_tty_face): Assert whether styled underlines are supported by the current terminal on display-supports-face-attributes-p checks. Populate the correct underline style in the face spec when realizing a face. --- etc/NEWS | 16 +++++++++++++ src/dispextern.h | 3 ++- src/term.c | 35 ++++++++++++++++++++++++---- src/termchar.h | 4 ++++ src/xfaces.c | 60 ++++++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 109 insertions(+), 9 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 5ee1509859b..d868ee773fd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -420,6 +420,22 @@ These characters can now be input with 'C-x 8 a e' and 'C-x 8 A E', respectively, in addition to the existing translations 'C-x 8 / e' and 'C-x 8 / E'. +--- +** Support for 'styled-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'. + +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'. + * Changes in Specialized Modes and Packages in Emacs 30.1 diff --git a/src/dispextern.h b/src/dispextern.h index 470d2eea3ae..31e946c387a 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1812,7 +1812,7 @@ #define FONT_TOO_HIGH(ft) \ string meaning the default color of the TTY. */ bool_bf tty_bold_p : 1; bool_bf tty_italic_p : 1; - bool_bf tty_underline_p : 1; + ENUM_BF (face_underline_type) tty_underline : 3; bool_bf tty_reverse_p : 1; bool_bf tty_strike_through_p : 1; @@ -3425,6 +3425,7 @@ #define TTY_CAP_BOLD 0x04 #define TTY_CAP_DIM 0x08 #define TTY_CAP_ITALIC 0x10 #define TTY_CAP_STRIKE_THROUGH 0x20 +#define TTY_CAP_UNDERLINE_STYLED 0x32 & TTY_CAP_UNDERLINE /*********************************************************************** diff --git a/src/term.c b/src/term.c index 3fa244be824..06dbb95171e 100644 --- a/src/term.c +++ b/src/term.c @@ -2014,8 +2014,17 @@ turn_on_face (struct frame *f, int face_id) OUTPUT1 (tty, tty->TS_enter_dim_mode); } - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + if (face->tty_underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) { + if (face->tty_underline == FACE_UNDER_LINE || + !tty->TF_set_underline_style) { + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + } else if (tty->TF_set_underline_style) { + char *p; + p = tparam(tty->TF_set_underline_style, NULL, 0, face->tty_underline, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } + } if (face->tty_strike_through_p && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) @@ -2061,7 +2070,7 @@ turn_off_face (struct frame *f, int face_id) if (face->tty_bold_p || face->tty_italic_p || face->tty_reverse_p - || face->tty_underline_p + || face->tty_underline || face->tty_strike_through_p) { OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); @@ -2073,7 +2082,7 @@ turn_off_face (struct frame *f, int face_id) { /* If we don't have "me" we can only have those appearances that have exit sequences defined. */ - if (face->tty_underline_p) + if (face->tty_underline) OUTPUT_IF (tty, tty->TS_exit_underline_mode); } @@ -2104,6 +2113,9 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_UNDERLINE_STYLED, tty->TF_set_underline_style, + NC_UNDERLINE); TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); TTY_CAPABLE_P_TRY (tty, @@ -4360,6 +4372,21 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TF_underscore = tgetflag ("ul"); tty->TF_teleray = tgetflag ("xt"); + // Styled underlines. + // + // Support for this is provided either by the escape sequence in + // Smulx or the Su flag. The latter results in a common default + // escape sequence and is not recommended. +#ifdef TERMINFO + tty->TF_set_underline_style = tigetstr("Smulx"); + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) + tty->TF_set_underline_style = NULL; +#else + tty->TF_set_underline_style = tgetstr("Smulx", address); +#endif + if (!tty->TF_set_underline_style && tgetflag("Su")) + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 2d845107e11..7fc1f347230 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -171,6 +171,10 @@ #define EMACS_TERMCHAR_H non-blank position. Must clear before writing _. */ int TF_teleray; /* termcap xt flag: many weird consequences. For t1061. */ + const char *TF_set_underline_style; /* termcap Smulx entry: Switches the underline + style based on the parameter. Param should + be one of: 0 (none), 1 (straight), 2 (double), + 3 (wave), 4 (dotted), or 5 (dashed). */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index a76a9365b8a..684e72bd897 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5470,8 +5470,18 @@ tty_supports_face_attributes_p (struct frame *f, { if (STRINGP (val)) return false; /* ttys can't use colored underlines */ - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) - return false; /* ttys can't use wave underlines */ + else if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) || + EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) || + EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) || + EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) || + EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) { + return false; /* Unsupported underline style */ + } + + test_caps |= TTY_CAP_UNDERLINE_STYLED; + } else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) return false; /* same as default */ else @@ -6397,6 +6407,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face->underline = FACE_UNDER_LINE; else if (EQ (value, Qwave)) face->underline = FACE_UNDER_WAVE; + else + face->underline = FACE_UNDER_LINE; } else if (EQ (keyword, QCposition)) { @@ -6531,6 +6543,7 @@ realize_tty_face (struct face_cache *cache, { struct face *face; int weight, slant; + Lisp_Object underline; bool face_colors_defaulted = false; struct frame *f = cache->f; @@ -6550,13 +6563,52 @@ realize_tty_face (struct face_cache *cache, face->tty_bold_p = true; if (slant != 100) face->tty_italic_p = true; - if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) - face->tty_underline_p = true; if (!NILP (attrs[LFACE_INVERSE_INDEX])) face->tty_reverse_p = true; if (!NILP (attrs[LFACE_STRIKE_THROUGH_INDEX])) face->tty_strike_through_p = true; + /* Text underline. */ + underline = attrs[LFACE_UNDERLINE_INDEX]; + if (NILP (underline)) { + face->tty_underline = FACE_NO_UNDERLINE; + } else if (EQ (underline, Qt)) { + face->tty_underline = FACE_UNDER_LINE; + } else if (STRINGP (underline)) { + face->tty_underline = FACE_UNDER_LINE; + } else if (CONSP (underline)) { + /* `(:style STYLE)'. + STYLE being one of `line', `double', `wave', `dotted' or `dashed'. */ + face->tty_underline = FACE_UNDER_LINE; + + while (CONSP (underline)) { + Lisp_Object keyword, value; + + keyword = XCAR (underline); + underline = XCDR (underline); + + if (!CONSP (underline)) + break; + value = XCAR (underline); + underline = XCDR (underline); + + if (EQ (keyword, QCstyle)) { + if (EQ (value, Qline)) + face->tty_underline = FACE_UNDER_LINE; + else if (EQ (value, Qdouble)) + face->tty_underline = FACE_DOUBLE_UNDER_LINE; + else if (EQ (value, Qwave)) + face->tty_underline = FACE_UNDER_WAVE; + else if (EQ (value, Qdotted)) + face->tty_underline = FACE_DOTTED_UNDER_LINE; + else if (EQ (value, Qdashed)) + face->tty_underline = FACE_DASHED_UNDER_LINE; + else + face->tty_underline = FACE_UNDER_LINE; + } + } + } + /* Map color names to color indices. */ map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); -- 2.43.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v4 0/3] Support styled underlines on tty Emacs frames References: <87pm7x5mxc.fsf@kisara.moe> In-Reply-To: <87pm7x5mxc.fsf@kisara.moe> Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2024 17:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org, Eli Zaretskii Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.170767178832426 (code B ref 62994); Sun, 11 Feb 2024 17:17:02 +0000 Received: (at 62994) by debbugs.gnu.org; 11 Feb 2024 17:16:28 +0000 Received: from localhost ([127.0.0.1]:32976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDRM-0008Qw-62 for submit@debbugs.gnu.org; Sun, 11 Feb 2024 12:16:28 -0500 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:41856 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDRH-0008QQ-U1 for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 12:16:26 -0500 Received: from mk-desktop.Home (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id CDFCFA2796; Sun, 11 Feb 2024 18:16:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1707671765; bh=NYTjEeibMM7p4eYHsQMDrZ4PNL2zjUFhuAM0cwzmMXM=; h=From:To:Cc:Subject:Date:From; b=mwALqW1ryUT4sy0rFP5JURUqMvliU23zW1ZvUuuPLDFN/PYKBQfxOvFFgpDNqhi1F m3/PV2RjKiJWXJQW5oJQfe45G6813H8iAkatdADNDxIV+D7g/tPM0cO6JChGQc7nAZ 5A3kIEorHBUY1FHq120CGoOaYRGxxi64DM1rRmf5zH+WjaHkfQT64pgR7g2fiZFJcr ZK5xZJvzjYzciJjY2k54FVeBeWUDMKzhr9BqhlDKfstuh6T/0UU7X5TY5Z/a7rdihN ttC26yrOSekHLBXhYBV2nAQyQu9wzR6N1S6i42lFau6ObMVm+ZaFZzoDwzAAXiNmRr UnAB+C+CEvBlA== From: mohkale@kisara.moe Date: Sun, 11 Feb 2024 17:15:53 +0000 Message-ID: <20240211171556.597236-1-mohkale@kisara.moe> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem Modern terminals (such as kitty) support setting the style of an underline with the escape sequence exposed in the Smulx termcap. This allows for (among others) wavy underlines on terminals. These terminals also support setting the color of these underlines using a separate escape sequence that to the best of my knowledge is not exposed as a termcap but has been adopted by other terminal supporting editors like neovim. Mohsin Kaleem (3): Add face definitions for more underline styles Add support for styled underlines on tty frames Add support for colored underlines on tty frames etc/NEWS | 19 ++++++++++ lisp/cus-face.el | 5 ++- src/dispextern.h | 11 ++++-- src/term.c | 46 +++++++++++++++++++++--- src/termchar.h | 7 ++++ src/xfaces.c | 93 ++++++++++++++++++++++++++++++++++++++++++++---- 6 files changed, 167 insertions(+), 14 deletions(-) -- 2.43.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v4 1/3] Add face definitions for more underline styles Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2024 17:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org, Eli Zaretskii Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17076722091259 (code B ref 62994); Sun, 11 Feb 2024 17:24:02 +0000 Received: (at 62994) by debbugs.gnu.org; 11 Feb 2024 17:23:29 +0000 Received: from localhost ([127.0.0.1]:33400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDY8-0000KF-I1 for submit@debbugs.gnu.org; Sun, 11 Feb 2024 12:23:29 -0500 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:42464 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDY7-0000K1-I0 for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 12:23:28 -0500 Received: from mk-desktop.Home (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 93DD6A2797; Sun, 11 Feb 2024 18:16:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1707671766; bh=qa8s19TW7PHkAioyt2dFkPPKP42fEL/FW+SjAYYh/qk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bN9ZsSdRb7o9Lsja4RH0uUvDye8EOcBs9GHYy6ydHRN8mxXTOUx/MPHIOgiRtdsbe oi9T3IrMXqBdk1iIAd2qe9LisfmOEK1SOAHzDmUH/gRRRBmMcdTZD8OxWPvCBXXyQ1 ueSBsuiYmYelbEAFR+6O97gLyioY8dABOWNE6Ob6SFwoBsz+6dLfH0Jl7HQm7hLGxV +9vPMIVz0/fnuaSHy4RojO2xIF8thZMupYJnx2X3TsX1xIRJcPnXu/HAwYjq597nwH l9Q/NORiO083OJlqCc4Ek/0aSi5Rrnb2Z6dRmPFuLh6EjLrVB1B9mk9o9ZdEOerqFe A17U1HHxzNYZA== From: mohkale@kisara.moe Date: Sun, 11 Feb 2024 17:15:54 +0000 Message-ID: <20240211171556.597236-2-mohkale@kisara.moe> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240211171556.597236-1-mohkale@kisara.moe> References: <20240211171556.597236-1-mohkale@kisara.moe> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem * src/dispextern.h (face_underline_type, syms_of_xfacse, internal-set-lisp-face-attribute, gui_supports_face_attributes_p): Add definitions for new underline styles of Double, Dotted and Dashed. * lisp/cus-face.el (custom-face-attributes): Add entries for Double, Dotted and Dashed so they can be set through `customize'. --- lisp/cus-face.el | 5 ++++- src/dispextern.h | 8 ++++++-- src/xfaces.c | 21 ++++++++++++++++++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 47afa841f5e..12551e37785 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -141,7 +141,10 @@ custom-face-attributes (const :format "" :value :style) (choice :tag "Style" (const :tag "Line" line) - (const :tag "Wave" wave)) + (const :tag "Double" double) + (const :tag "Wave" wave) + (const :tag "Dotted" dotted) + (const :tag "Dashed" dashed)) (const :format "" :value :position) (choice :tag "Position" (const :tag "At Default Position" nil) diff --git a/src/dispextern.h b/src/dispextern.h index 5387cb45603..470d2eea3ae 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1690,9 +1690,13 @@ #define FONT_TOO_HIGH(ft) \ enum face_underline_type { + // Note: Order matches the order of the Smulx terminfo extension. FACE_NO_UNDERLINE = 0, FACE_UNDER_LINE, - FACE_UNDER_WAVE + FACE_DOUBLE_UNDER_LINE, + FACE_UNDER_WAVE, + FACE_DOTTED_UNDER_LINE, + FACE_DASHED_UNDER_LINE, }; /* Structure describing a realized face. @@ -1776,7 +1780,7 @@ #define FONT_TOO_HIGH(ft) \ ENUM_BF (face_box_type) box : 2; /* Style of underlining. */ - ENUM_BF (face_underline_type) underline : 2; + ENUM_BF (face_underline_type) underline : 3; /* If `box' above specifies a 3D type, true means use box_color for drawing shadows. */ diff --git a/src/xfaces.c b/src/xfaces.c index a558e7328c0..a76a9365b8a 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3311,7 +3311,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, } else if (EQ (key, QCstyle) - && !(EQ (val, Qline) || EQ (val, Qwave))) + && !(EQ (val, Qline) || + EQ (val, Qdouble) || + EQ (val, Qwave) || + EQ (val, Qdotted) || + EQ (val, Qdashed))) { valid_p = false; break; @@ -5266,6 +5270,7 @@ gui_supports_face_attributes_p (struct frame *f, Lisp_Object attrs[LFACE_VECTOR_SIZE], struct face *def_face) { + Lisp_Object val; Lisp_Object *def_attrs = def_face->lface; Lisp_Object lattrs[LFACE_VECTOR_SIZE]; @@ -5360,6 +5365,17 @@ gui_supports_face_attributes_p (struct frame *f, return false; } + /* Check supported underline styles. */ + val = attrs[LFACE_UNDERLINE_INDEX]; + if (!UNSPECIFIEDP (val)) { + if (EQ (CAR_SAFE (val), QCstyle)) { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) || + EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) { + return false; /* Unsupported underline style */ + } + } + } + /* Everything checks out, this face is supported. */ return true; } @@ -7229,6 +7245,9 @@ syms_of_xfaces (void) DEFSYM (QCposition, ":position"); DEFSYM (Qline, "line"); DEFSYM (Qwave, "wave"); + DEFSYM (Qdouble, "double"); + DEFSYM (Qdotted, "dotted"); + DEFSYM (Qdashed, "dashed"); DEFSYM (Qreleased_button, "released-button"); DEFSYM (Qpressed_button, "pressed-button"); DEFSYM (Qflat_button, "flat-button"); -- 2.43.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v4 0/3] Support styled underlines on tty Emacs frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2024 17:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org, Eli Zaretskii Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17076722581431 (code B ref 62994); Sun, 11 Feb 2024 17:25:02 +0000 Received: (at 62994) by debbugs.gnu.org; 11 Feb 2024 17:24:18 +0000 Received: from localhost ([127.0.0.1]:33451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDYw-0000N0-5U for submit@debbugs.gnu.org; Sun, 11 Feb 2024 12:24:18 -0500 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:59996 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDYu-0000Mo-Cn for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 12:24:16 -0500 Received: from mk-desktop (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 816CAA2796; Sun, 11 Feb 2024 18:23:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1707672239; bh=YP6zjiuno3XnowsXRNJXhYHzMxyANRmAmpvgkXT8xgA=; h=From:To:Subject:In-Reply-To:References:Date:From; b=Ze+m2obdgGGozLoprFbwsrhmuDY5HfaL0VAyBFo7+sVBwk4w/erTEX/9pQLwkKTzb /VTcuRbzMc1Wr/v+CsXf4kpKwrwvjQOVTpJx389KtlbZiQFRdRLERG0/xSblfhZPSW fbCximcXc6YMdtncIZS4/iKdfN5W6fDBY4dJWK2iX8T54QI3JPaexJ7QCtAuSOqHo8 SNPvEmdQwijObFz4Q9t/WT752dFrswztki5/HtXGuVO7RCODq5nGDuFzvRvUzHXVCN S5bJEGOXVXr7v0G20X4DRlyxw19NrmQt3qeaY52mdHnDq/cqAun8d9sYP2BAdnhWGc rbzcEAQMIMR+Q== From: Mohsin Kaleem In-Reply-To: <20240211171556.597236-1-mohkale@kisara.moe> References: <20240211171556.597236-1-mohkale@kisara.moe> Date: Sun, 11 Feb 2024 17:23:58 +0000 Message-ID: <8734ty29u9.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) mohkale@kisara.moe writes: Hi, sorry, please disregard this email. I seem to have messed up and published the wrong patchset and also to the wrong email chain. -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v4 3/3] Add support for colored underlines on tty frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2024 17:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org, Eli Zaretskii Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17076728093121 (code B ref 62994); Sun, 11 Feb 2024 17:34:02 +0000 Received: (at 62994) by debbugs.gnu.org; 11 Feb 2024 17:33:29 +0000 Received: from localhost ([127.0.0.1]:34047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDhp-0000oG-5E for submit@debbugs.gnu.org; Sun, 11 Feb 2024 12:33:29 -0500 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:38528 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDhn-0000o2-8q for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 12:33:28 -0500 Received: from mk-desktop.Home (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id C11E7A2799; Sun, 11 Feb 2024 18:16:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1707671767; bh=sr36NDmg7wH9UdOIvqHPh38uCjBSPcb+sv7YnMZF6wU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tc3XRh6uYfUQzOh6ia4zBChqx3a3Yt8BSFa5ka03wCLel2Dze6Om59Np8QB5PUSCP DYSbnRBCNfGTic0GJ3lViP1yP/Mf94vTxJTL57ZDGDBSYJlr1JUWQ53hKPGrx8/qA2 k5vcy13bHG1R8hrt0aSnx58JiHr6yEx5E4hxrT79oI95HR1zs4ahhxpvqoOwAxSvEA UIAARnqGuvucpT6Xr5wNNJ9RptA9LkYr+9O3ZX8wE+bB9vqp+uAiuzncc2HrquHCr8 E8T+XwHQ/TiWSNV91sRZTfs7C2mYgTmCGXBSWeElmtn82R5f0nzQAeiHI6WrEZMQjt MEBEwy1MSjRlg== From: mohkale@kisara.moe Date: Sun, 11 Feb 2024 17:15:56 +0000 Message-ID: <20240211171556.597236-4-mohkale@kisara.moe> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240211171556.597236-1-mohkale@kisara.moe> References: <20240211171556.597236-1-mohkale@kisara.moe> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) From: Mohsin Kaleem * src/term.c (turn_on_face, init_tty): 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/termchar.c (tty_display_info): Add an entry for the escape sequence to set the underline color on terminal frames. * src/xfaces.c (tty_supports_face_attributes_p, realize_tty_face): Assert whether colored underlines are supported by the current terminal on display-supports-face-attributes-p checks. Load and save the color of the underline from the face spec when realizing a face. --- etc/NEWS | 11 +++++++---- src/term.c | 11 +++++++++++ src/termchar.h | 3 +++ src/xfaces.c | 16 +++++++++++++--- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index d868ee773fd..73a15eb44a4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -421,20 +421,23 @@ respectively, in addition to the existing translations 'C-x 8 / e' and 'C-x 8 / E'. --- -** 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. * Changes in Specialized Modes and Packages in Emacs 30.1 diff --git a/src/term.c b/src/term.c index 06dbb95171e..1ab6936db76 100644 --- a/src/term.c +++ b/src/term.c @@ -2050,6 +2050,14 @@ turn_on_face (struct frame *f, int face_id) OUTPUT (tty, p); xfree (p); } + + ts = tty->TF_set_underline_color; + if (ts && face->underline_color) + { + p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } } } @@ -4387,6 +4395,9 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) if (!tty->TF_set_underline_style && tgetflag("Su")) tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + if (tty->TF_set_underline_style) + tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 7fc1f347230..846cd3001cc 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -175,6 +175,9 @@ #define EMACS_TERMCHAR_H style based on the parameter. Param should be one of: 0 (none), 1 (straight), 2 (double), 3 (wave), 4 (dotted), or 5 (dashed). */ + const char *TF_set_underline_color; /* Enabled when TF_set_underline_style is set: + Sets the color of the underline. Accepts a + single parameter, the color index. */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index 684e72bd897..4d860540cb9 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5469,7 +5469,7 @@ tty_supports_face_attributes_p (struct frame *f, if (!UNSPECIFIEDP (val)) { if (STRINGP (val)) - return false; /* ttys can't use colored underlines */ + test_caps |= TTY_CAP_UNDERLINE_STYLED; else if (EQ (CAR_SAFE (val), QCstyle)) { if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) || @@ -6572,14 +6572,18 @@ realize_tty_face (struct face_cache *cache, underline = attrs[LFACE_UNDERLINE_INDEX]; if (NILP (underline)) { face->tty_underline = FACE_NO_UNDERLINE; + face->underline_color = 0; } else if (EQ (underline, Qt)) { face->tty_underline = FACE_UNDER_LINE; + face->underline_color = 0; } else if (STRINGP (underline)) { face->tty_underline = FACE_UNDER_LINE; + face->underline_color = load_color (f, face, underline, LFACE_UNDERLINE_INDEX); } else if (CONSP (underline)) { - /* `(:style STYLE)'. + /* `(:color COLOR :style STYLE)'. STYLE being one of `line', `double', `wave', `dotted' or `dashed'. */ face->tty_underline = FACE_UNDER_LINE; + face->underline_color = 0; while (CONSP (underline)) { Lisp_Object keyword, value; @@ -6592,7 +6596,13 @@ realize_tty_face (struct face_cache *cache, value = XCAR (underline); underline = XCDR (underline); - if (EQ (keyword, QCstyle)) { + if (EQ (keyword, QCcolor)) { + if (EQ (value, Qforeground_color)) + face->underline_color = 0; + else if (STRINGP (value)) + face->underline_color = load_color (f, face, value, LFACE_UNDERLINE_INDEX); + } + else if (EQ (keyword, QCstyle)) { if (EQ (value, Qline)) face->tty_underline = FACE_UNDER_LINE; else if (EQ (value, Qdouble)) -- 2.43.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v4] Add support for colored and styled underlines on tty frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2024 17:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org, Eli Zaretskii Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17076732584431 (code B ref 62994); Sun, 11 Feb 2024 17:41:02 +0000 Received: (at 62994) by debbugs.gnu.org; 11 Feb 2024 17:40:58 +0000 Received: from localhost ([127.0.0.1]:34526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDp2-00019L-O8 for submit@debbugs.gnu.org; Sun, 11 Feb 2024 12:40:57 -0500 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:38516 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDoz-000197-US for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 12:40:55 -0500 Received: from mk-desktop.Home (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 8D20FA2796; Sun, 11 Feb 2024 18:40:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1707673236; bh=KIgfCcFQXfZljzayt/NurpKsejhENrF/8ST2NDDFUn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gFDf3vDMGYHFrRihjy1AhTjOZXGrl4WFnZntYKy+9TQi85mVge+jx2esqIjyJbFgb q++0PoTQX+2hmC4TYBc5GTt/JvocAmAbRCN/QG9u0BfA08uJNKk7jy0MUhfHiOSPoM gGIOChQhBeP0UDA0osdbk+PZL7yG0uVzhh4LbA831K+P9VgxC9kY9PM/G4gm9NllMc 2FC1KenSYaNdRbJOjKbKrkRxoxkW4Pef3FYmfRkGkviU1oNRlfXy76cg9Z2TpwQu3M nf/87wh+R20M9qUWLL9fFzNQf7nxWCs2qJGDZi4bzJN8lw9FVpK9ZzAh91UDSx02ZI RjZRU7oXxipAg== From: mohkale@kisara.moe Date: Sun, 11 Feb 2024 17:40:35 +0000 Message-ID: <20240211174035.651660-1-mohkale@kisara.moe> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Mohsin Kaleem * 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, Dotted and Dashed. [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL blocklist [URIs: sw.kovidgoyal.net] 0.6 URIBL_SBL Contains an URL's NS IP listed in the Spamhaus SBL blocklist [URIs: sw.kovidgoyal.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.1 (/) From: Mohsin Kaleem * 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, Dotted and Dashed. 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, Dotted and Dashed 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): 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. --- etc/NEWS | 13 ++++ lisp/cus-face.el | 5 +- src/dispextern.h | 10 ++- src/term.c | 54 +++++++++++++-- src/termchar.h | 7 ++ src/xfaces.c | 167 +++++++++++++++++++++++++++++++++++++++++++---- 6 files changed, 235 insertions(+), 21 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 5ee1509859b..e6192e09f81 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -311,6 +311,19 @@ Previously, it was set to t but this broke remote file name detection. ** Multi-character key echo now ends with a suggestion to use Help. Customize 'echo-keystrokes-help' to nil to prevent that. +--- +** 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 or a color other than the foreground-color. +The available underline styles for TTY frames are 'double', 'wave', +'dotted', and 'dashed'. These are currently supported by Kitty, +libvte, and st (through the undercurl patch) among other terminals. + * Editing Changes in Emacs 30.1 diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 47afa841f5e..12551e37785 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -141,7 +141,10 @@ custom-face-attributes (const :format "" :value :style) (choice :tag "Style" (const :tag "Line" line) - (const :tag "Wave" wave)) + (const :tag "Double" double) + (const :tag "Wave" wave) + (const :tag "Dotted" dotted) + (const :tag "Dashed" dashed)) (const :format "" :value :position) (choice :tag "Position" (const :tag "At Default Position" nil) diff --git a/src/dispextern.h b/src/dispextern.h index 5387cb45603..574798fc547 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1690,9 +1690,13 @@ #define FONT_TOO_HIGH(ft) \ enum face_underline_type { + /* Note: Order matches the order of the Smulx terminfo extension. */ FACE_NO_UNDERLINE = 0, FACE_UNDER_LINE, - FACE_UNDER_WAVE + FACE_DOUBLE_UNDER_LINE, + FACE_UNDER_WAVE, + FACE_DOTTED_UNDER_LINE, + FACE_DASHED_UNDER_LINE, }; /* Structure describing a realized face. @@ -1776,7 +1780,7 @@ #define FONT_TOO_HIGH(ft) \ ENUM_BF (face_box_type) box : 2; /* Style of underlining. */ - ENUM_BF (face_underline_type) underline : 2; + ENUM_BF (face_underline_type) underline : 3; /* If `box' above specifies a 3D type, true means use box_color for drawing shadows. */ @@ -1808,7 +1812,6 @@ #define FONT_TOO_HIGH(ft) \ string meaning the default color of the TTY. */ bool_bf tty_bold_p : 1; bool_bf tty_italic_p : 1; - bool_bf tty_underline_p : 1; bool_bf tty_reverse_p : 1; bool_bf tty_strike_through_p : 1; @@ -3421,6 +3424,7 @@ #define TTY_CAP_BOLD 0x04 #define TTY_CAP_DIM 0x08 #define TTY_CAP_ITALIC 0x10 #define TTY_CAP_STRIKE_THROUGH 0x20 +#define TTY_CAP_UNDERLINE_STYLED 0x32 & TTY_CAP_UNDERLINE /*********************************************************************** diff --git a/src/term.c b/src/term.c index 3fa244be824..d5a5442cb19 100644 --- a/src/term.c +++ b/src/term.c @@ -2014,8 +2014,19 @@ turn_on_face (struct frame *f, int face_id) OUTPUT1 (tty, tty->TS_enter_dim_mode); } - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + if (face->underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) + { + if (face->underline == FACE_UNDER_LINE + || !tty->TF_set_underline_style) + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + else if (tty->TF_set_underline_style) + { + char *p; + p = tparam(tty->TF_set_underline_style, NULL, 0, face->underline, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } + } if (face->tty_strike_through_p && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) @@ -2041,6 +2052,14 @@ turn_on_face (struct frame *f, int face_id) OUTPUT (tty, p); xfree (p); } + + ts = tty->TF_set_underline_color; + if (ts && face->underline_color) + { + p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } } } @@ -2061,7 +2080,7 @@ turn_off_face (struct frame *f, int face_id) if (face->tty_bold_p || face->tty_italic_p || face->tty_reverse_p - || face->tty_underline_p + || face->underline || face->tty_strike_through_p) { OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); @@ -2073,7 +2092,7 @@ turn_off_face (struct frame *f, int face_id) { /* If we don't have "me" we can only have those appearances that have exit sequences defined. */ - if (face->tty_underline_p) + if (face->underline) OUTPUT_IF (tty, tty->TS_exit_underline_mode); } @@ -2104,6 +2123,9 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_UNDERLINE_STYLED, tty->TF_set_underline_style, + NC_UNDERLINE); TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); TTY_CAPABLE_P_TRY (tty, @@ -4360,6 +4382,30 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TF_underscore = tgetflag ("ul"); tty->TF_teleray = tgetflag ("xt"); + /* Styled underlines. Support for this is provided either by the + escape sequence in Smulx or the Su flag. The latter results in a + common default escape sequence and is not recommended. */ +#ifdef TERMINFO + tty->TF_set_underline_style = tigetstr("Smulx"); + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) + tty->TF_set_underline_style = NULL; +#else + tty->TF_set_underline_style = tgetstr("Smulx", address); +#endif + if (!tty->TF_set_underline_style && tgetflag("Su")) + /* Default to the kitty escape sequence. See + https://sw.kovidgoyal.net/kitty/underlines/ */ + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + + if (tty->TF_set_underline_style) + /* This escape sequence for setting the underline color is + consistent with the one described in kitty (see above) and + adapted from the one used by neovim. This sequence has + been altered from the neovim sequence at + https://github.com/neovim/neovim/blob/42f492ac99058bd1cd56c3c7871e7e464b2a5e24/src/nvim/tui/tui.c#L1932 + to require only a single parameter, the color index. */ + tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 2d845107e11..de9009d32f1 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -171,6 +171,13 @@ #define EMACS_TERMCHAR_H non-blank position. Must clear before writing _. */ int TF_teleray; /* termcap xt flag: many weird consequences. For t1061. */ + const char *TF_set_underline_style; /* termcap Smulx entry: Switches the underline + style based on the parameter. Param should + be one of: 0 (none), 1 (straight), 2 (double), + 3 (wave), 4 (dotted), or 5 (dashed). */ + const char *TF_set_underline_color; /* Enabled when TF_set_underline_style is set: + Sets the color of the underline. Accepts a + single parameter, the color index. */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index a558e7328c0..75fae11dca3 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3311,7 +3311,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, } else if (EQ (key, QCstyle) - && !(EQ (val, Qline) || EQ (val, Qwave))) + && !(EQ (val, Qline) + || EQ (val, Qdouble) + || EQ (val, Qwave) + || EQ (val, Qdotted) + || EQ (val, Qdashed))) { valid_p = false; break; @@ -5266,6 +5270,7 @@ gui_supports_face_attributes_p (struct frame *f, Lisp_Object attrs[LFACE_VECTOR_SIZE], struct face *def_face) { + Lisp_Object val; Lisp_Object *def_attrs = def_face->lface; Lisp_Object lattrs[LFACE_VECTOR_SIZE]; @@ -5360,6 +5365,20 @@ gui_supports_face_attributes_p (struct frame *f, return false; } + /* Check supported underline styles. */ + val = attrs[LFACE_UNDERLINE_INDEX]; + if (!UNSPECIFIEDP (val)) + { + if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) + { + return false; /* Unsupported underline style */ + } + } + } + /* Everything checks out, this face is supported. */ return true; } @@ -5452,15 +5471,26 @@ tty_supports_face_attributes_p (struct frame *f, val = attrs[LFACE_UNDERLINE_INDEX]; if (!UNSPECIFIEDP (val)) { - if (STRINGP (val)) - return false; /* ttys can't use colored underlines */ - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) - return false; /* ttys can't use wave underlines */ - else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) - return false; /* same as default */ - else - test_caps |= TTY_CAP_UNDERLINE; - } + if (STRINGP (val)) + test_caps |= TTY_CAP_UNDERLINE_STYLED; + else if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) + { + return false; /* Face uses an unsupported underline style. */ + } + + test_caps |= TTY_CAP_UNDERLINE_STYLED; + } + else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) + return false; /* same as default */ + else + test_caps |= TTY_CAP_UNDERLINE; + } /* inverse video */ val = attrs[LFACE_INVERSE_INDEX]; @@ -6381,6 +6411,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face->underline = FACE_UNDER_LINE; else if (EQ (value, Qwave)) face->underline = FACE_UNDER_WAVE; + else + face->underline = FACE_UNDER_LINE; } else if (EQ (keyword, QCposition)) { @@ -6434,7 +6466,53 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] /* Map a specified color of face FACE on frame F to a tty color index. IDX is either LFACE_FOREGROUND_INDEX or LFACE_BACKGROUND_INDEX, and specifies which color to map. Set *DEFAULTED to true if mapping to the - default foreground/background colors. */ + default foreground/background colors. TODO(me): Update docstring. */ + +static void +my_map_tty_color (struct frame *f, struct face *face, Lisp_Object color, + enum lface_attribute_index idx) +{ + Lisp_Object frame, def; + unsigned long default_pixel = FACE_TTY_DEFAULT_FG_COLOR; + unsigned long pixel = default_pixel; + + eassert (idx == LFACE_FOREGROUND_INDEX + || idx == LFACE_BACKGROUND_INDEX + || idx == LFACE_UNDERLINE_INDEX); + + XSETFRAME (frame, f); + + if (STRINGP (color) + && SCHARS (color) + && CONSP (Vtty_defined_color_alist) + && (def = assoc_no_quit (color, call1 (Qtty_color_alist, frame)), + CONSP (def))) + { + /* Associations in tty-defined-color-alist are of the form + (NAME INDEX R G B). We need the INDEX part. */ + pixel = XFIXNUM (XCAR (XCDR (def))); + } + + if (pixel == default_pixel && STRINGP (color)) + { + pixel = load_color (f, face, color, idx); + } + + switch (idx) + { + case LFACE_UNDERLINE_INDEX: + face->underline_color = pixel; + break; + case LFACE_FOREGROUND_INDEX: + face->foreground = pixel; + break; + case LFACE_BACKGROUND_INDEX: + face->background = pixel; + break; + default: + emacs_abort (); + } +} static void map_tty_color (struct frame *f, struct face *face, @@ -6515,6 +6593,7 @@ realize_tty_face (struct face_cache *cache, { struct face *face; int weight, slant; + Lisp_Object underline; bool face_colors_defaulted = false; struct frame *f = cache->f; @@ -6534,13 +6613,72 @@ realize_tty_face (struct face_cache *cache, face->tty_bold_p = true; if (slant != 100) face->tty_italic_p = true; - if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) - face->tty_underline_p = true; if (!NILP (attrs[LFACE_INVERSE_INDEX])) face->tty_reverse_p = true; if (!NILP (attrs[LFACE_STRIKE_THROUGH_INDEX])) face->tty_strike_through_p = true; + /* Text underline. */ + underline = attrs[LFACE_UNDERLINE_INDEX]; + if (NILP (underline)) + { + face->underline = FACE_NO_UNDERLINE; + face->underline_color = 0; + } + else if (EQ (underline, Qt)) + { + face->underline = FACE_UNDER_LINE; + face->underline_color = 0; + } + else if (STRINGP (underline)) + { + face->underline = FACE_UNDER_LINE; + my_map_tty_color (f, face, underline, LFACE_UNDERLINE_INDEX); + } + else if (CONSP (underline)) + { + /* `(:color COLOR :style STYLE)'. + STYLE being one of `line', `double', `wave', `dotted' or `dashed'. */ + face->underline = FACE_UNDER_LINE; + face->underline_color = 0; + + while (CONSP (underline)) + { + Lisp_Object keyword, value; + + keyword = XCAR (underline); + underline = XCDR (underline); + + if (!CONSP (underline)) + break; + value = XCAR (underline); + underline = XCDR (underline); + + if (EQ (keyword, QCcolor)) + { + if (EQ (value, Qforeground_color)) + face->underline_color = 0; + else if (STRINGP (value)) + my_map_tty_color (f, face, value, LFACE_UNDERLINE_INDEX); + } + else if (EQ (keyword, QCstyle)) + { + if (EQ (value, Qline)) + face->underline = FACE_UNDER_LINE; + else if (EQ (value, Qdouble)) + face->underline = FACE_DOUBLE_UNDER_LINE; + else if (EQ (value, Qwave)) + face->underline = FACE_UNDER_WAVE; + else if (EQ (value, Qdotted)) + face->underline = FACE_DOTTED_UNDER_LINE; + else if (EQ (value, Qdashed)) + face->underline = FACE_DASHED_UNDER_LINE; + else + face->underline = FACE_UNDER_LINE; + } + } + } + /* Map color names to color indices. */ map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); @@ -7229,6 +7367,9 @@ syms_of_xfaces (void) DEFSYM (QCposition, ":position"); DEFSYM (Qline, "line"); DEFSYM (Qwave, "wave"); + DEFSYM (Qdouble, "double"); + DEFSYM (Qdotted, "dotted"); + DEFSYM (Qdashed, "dashed"); DEFSYM (Qreleased_button, "released-button"); DEFSYM (Qpressed_button, "pressed-button"); DEFSYM (Qflat_button, "flat-button"); -- 2.43.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v4 0/3] Support styled underlines on tty Emacs frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2024 17:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17076736455525 (code B ref 62994); Sun, 11 Feb 2024 17:48:02 +0000 Received: (at 62994) by debbugs.gnu.org; 11 Feb 2024 17:47:25 +0000 Received: from localhost ([127.0.0.1]:34933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDvJ-0001R3-CB for submit@debbugs.gnu.org; Sun, 11 Feb 2024 12:47:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZDvH-0001Qf-BD for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 12:47:24 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZDuv-0000SL-HT; Sun, 11 Feb 2024 12:47:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=aJimpN2EIlh8b44SiqtiL0pnJTbMnBSFUW/CdVwr8qI=; b=lmsVFLx3aR6S e7v4tLzIXHbYC3PnkCVaW0qLFKrzOBwnQiJqcB6g7lzgCmQkqOx29mwl3ZF1rXUPV7MrRPPJT4D/q bSBxVJ3ohU+Qr7GlZJb3tsGSplROuMTQKud4gpv6Ud+5YiT5aNnrjtpxDzeu85XxvI8ZYgYGyiwz3 VMiBXLyZHFZhWQzsINZm5yPilD74U/s8lrurKVEigyAmVqMaPkn+w/FZ6e9uPQYxEguCNJJqJtXpA A7ZUROeoX86ohLvHRczMNp9xJlNfiR/oWxbqHgG9JHPVfENepbJbnHixav6ldN7bqLcNXubyaLUPS DHHgyN0zyJvZAlNYjvOeSw==; Date: Sun, 11 Feb 2024 19:46:58 +0200 Message-Id: <86h6iesxkd.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <8734ty29u9.fsf@kisara.moe> (message from Mohsin Kaleem on Sun, 11 Feb 2024 17:23:58 +0000) References: <20240211171556.597236-1-mohkale@kisara.moe> <8734ty29u9.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Date: Sun, 11 Feb 2024 17:23:58 +0000 > > mohkale@kisara.moe writes: > > Hi, sorry, please disregard this email. I seem to have messed up and > published the wrong patchset and also to the wrong email chain. If you are going to post this patch again, please note that I prefer to see a single large patch instead of a series of smaller ones, especially if some files are touched by more than one patch in the series. Having a single patch makes reviewing the changeset easier. TIA From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2024 18:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org, Eli Zaretskii Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17076747249173 (code B ref 62994); Sun, 11 Feb 2024 18:06:01 +0000 Received: (at 62994) by debbugs.gnu.org; 11 Feb 2024 18:05:24 +0000 Received: from localhost ([127.0.0.1]:36252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZECh-0002Np-64 for submit@debbugs.gnu.org; Sun, 11 Feb 2024 13:05:24 -0500 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:32900 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZECf-0002NZ-2y for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 13:05:22 -0500 Received: from mk-desktop.Home (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 5AB35A2796; Sun, 11 Feb 2024 19:05:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1707674703; bh=xil7DJZqSf5l9NAZTyC6hUecXVBjEVIkQInbdedCE7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y/m6ARmIlf+ntrLE+7FHNUvJqVDIBXTlpZMgPY17H2yFZ7FYD6y8RFwg+tJPjaZlB nKCZUOSZLRfcKq2foSL3giuisMqhGAawAA2Elw0qXa1Ale1uPP5QX9k1jtxwHVbwMT J02nKYNxzHvhcEXeJ66o8kJ9XBQ4ROHmedTaShy//1P7jqkDTZE8Ohh+Hbh42cGADa TpPscb4c+j7TmcdWP6t2Ayw/SfNr5uiX/NeTJLSCpIQfo7FNe2Kn/yX6YbLoC4+6v0 J+HPVjnhHZIgefu/foHbgz2Sny4usmO6ySeKpCO/OWCM1C/dpJEY9ZNz7xExo7JCSc AqrJYF2o10Epg== From: mohkale@kisara.moe Date: Sun, 11 Feb 2024 18:05:01 +0000 Message-ID: <20240211180501.695192-1-mohkale@kisara.moe> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Mohsin Kaleem * 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, Dotted and Dashed. [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL blocklist [URIs: sw.kovidgoyal.net] 0.6 URIBL_SBL Contains an URL's NS IP listed in the Spamhaus SBL blocklist [URIs: sw.kovidgoyal.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.1 (/) From: Mohsin Kaleem * 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, Dotted and Dashed. 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, Dotted and Dashed 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, map_tty_color2): 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. A new variant map_tty_color2 was added for contexts where caller doesn't care about foreground/background face defaulting. --- etc/NEWS | 15 +++++ lisp/cus-face.el | 5 +- src/dispextern.h | 10 ++- src/term.c | 54 +++++++++++++-- src/termchar.h | 7 ++ src/xfaces.c | 171 +++++++++++++++++++++++++++++++++++++++-------- 6 files changed, 227 insertions(+), 35 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 5ee1509859b..d8cf8671d9d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -311,6 +311,21 @@ Previously, it was set to t but this broke remote file name detection. ** Multi-character key echo now ends with a suggestion to use Help. Customize 'echo-keystrokes-help' to nil to prevent that. +** Terminal Emacs + ++++ +*** 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 or a color other than the foreground-color. +The available underline styles for TTY frames are 'double', 'wave', +'dotted', and 'dashed'. These are currently supported by Kitty, +libvte, and st (through the undercurl patch) among other terminals. + * Editing Changes in Emacs 30.1 diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 47afa841f5e..12551e37785 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -141,7 +141,10 @@ custom-face-attributes (const :format "" :value :style) (choice :tag "Style" (const :tag "Line" line) - (const :tag "Wave" wave)) + (const :tag "Double" double) + (const :tag "Wave" wave) + (const :tag "Dotted" dotted) + (const :tag "Dashed" dashed)) (const :format "" :value :position) (choice :tag "Position" (const :tag "At Default Position" nil) diff --git a/src/dispextern.h b/src/dispextern.h index 5387cb45603..574798fc547 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1690,9 +1690,13 @@ #define FONT_TOO_HIGH(ft) \ enum face_underline_type { + /* Note: Order matches the order of the Smulx terminfo extension. */ FACE_NO_UNDERLINE = 0, FACE_UNDER_LINE, - FACE_UNDER_WAVE + FACE_DOUBLE_UNDER_LINE, + FACE_UNDER_WAVE, + FACE_DOTTED_UNDER_LINE, + FACE_DASHED_UNDER_LINE, }; /* Structure describing a realized face. @@ -1776,7 +1780,7 @@ #define FONT_TOO_HIGH(ft) \ ENUM_BF (face_box_type) box : 2; /* Style of underlining. */ - ENUM_BF (face_underline_type) underline : 2; + ENUM_BF (face_underline_type) underline : 3; /* If `box' above specifies a 3D type, true means use box_color for drawing shadows. */ @@ -1808,7 +1812,6 @@ #define FONT_TOO_HIGH(ft) \ string meaning the default color of the TTY. */ bool_bf tty_bold_p : 1; bool_bf tty_italic_p : 1; - bool_bf tty_underline_p : 1; bool_bf tty_reverse_p : 1; bool_bf tty_strike_through_p : 1; @@ -3421,6 +3424,7 @@ #define TTY_CAP_BOLD 0x04 #define TTY_CAP_DIM 0x08 #define TTY_CAP_ITALIC 0x10 #define TTY_CAP_STRIKE_THROUGH 0x20 +#define TTY_CAP_UNDERLINE_STYLED 0x32 & TTY_CAP_UNDERLINE /*********************************************************************** diff --git a/src/term.c b/src/term.c index 3fa244be824..d5a5442cb19 100644 --- a/src/term.c +++ b/src/term.c @@ -2014,8 +2014,19 @@ turn_on_face (struct frame *f, int face_id) OUTPUT1 (tty, tty->TS_enter_dim_mode); } - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + if (face->underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) + { + if (face->underline == FACE_UNDER_LINE + || !tty->TF_set_underline_style) + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + else if (tty->TF_set_underline_style) + { + char *p; + p = tparam(tty->TF_set_underline_style, NULL, 0, face->underline, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } + } if (face->tty_strike_through_p && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) @@ -2041,6 +2052,14 @@ turn_on_face (struct frame *f, int face_id) OUTPUT (tty, p); xfree (p); } + + ts = tty->TF_set_underline_color; + if (ts && face->underline_color) + { + p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } } } @@ -2061,7 +2080,7 @@ turn_off_face (struct frame *f, int face_id) if (face->tty_bold_p || face->tty_italic_p || face->tty_reverse_p - || face->tty_underline_p + || face->underline || face->tty_strike_through_p) { OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); @@ -2073,7 +2092,7 @@ turn_off_face (struct frame *f, int face_id) { /* If we don't have "me" we can only have those appearances that have exit sequences defined. */ - if (face->tty_underline_p) + if (face->underline) OUTPUT_IF (tty, tty->TS_exit_underline_mode); } @@ -2104,6 +2123,9 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_UNDERLINE_STYLED, tty->TF_set_underline_style, + NC_UNDERLINE); TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); TTY_CAPABLE_P_TRY (tty, @@ -4360,6 +4382,30 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TF_underscore = tgetflag ("ul"); tty->TF_teleray = tgetflag ("xt"); + /* Styled underlines. Support for this is provided either by the + escape sequence in Smulx or the Su flag. The latter results in a + common default escape sequence and is not recommended. */ +#ifdef TERMINFO + tty->TF_set_underline_style = tigetstr("Smulx"); + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) + tty->TF_set_underline_style = NULL; +#else + tty->TF_set_underline_style = tgetstr("Smulx", address); +#endif + if (!tty->TF_set_underline_style && tgetflag("Su")) + /* Default to the kitty escape sequence. See + https://sw.kovidgoyal.net/kitty/underlines/ */ + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + + if (tty->TF_set_underline_style) + /* This escape sequence for setting the underline color is + consistent with the one described in kitty (see above) and + adapted from the one used by neovim. This sequence has + been altered from the neovim sequence at + https://github.com/neovim/neovim/blob/42f492ac99058bd1cd56c3c7871e7e464b2a5e24/src/nvim/tui/tui.c#L1932 + to require only a single parameter, the color index. */ + tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 2d845107e11..de9009d32f1 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -171,6 +171,13 @@ #define EMACS_TERMCHAR_H non-blank position. Must clear before writing _. */ int TF_teleray; /* termcap xt flag: many weird consequences. For t1061. */ + const char *TF_set_underline_style; /* termcap Smulx entry: Switches the underline + style based on the parameter. Param should + be one of: 0 (none), 1 (straight), 2 (double), + 3 (wave), 4 (dotted), or 5 (dashed). */ + const char *TF_set_underline_color; /* Enabled when TF_set_underline_style is set: + Sets the color of the underline. Accepts a + single parameter, the color index. */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index a558e7328c0..a39e2bb6781 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3311,7 +3311,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, } else if (EQ (key, QCstyle) - && !(EQ (val, Qline) || EQ (val, Qwave))) + && !(EQ (val, Qline) + || EQ (val, Qdouble) + || EQ (val, Qwave) + || EQ (val, Qdotted) + || EQ (val, Qdashed))) { valid_p = false; break; @@ -5266,6 +5270,7 @@ gui_supports_face_attributes_p (struct frame *f, Lisp_Object attrs[LFACE_VECTOR_SIZE], struct face *def_face) { + Lisp_Object val; Lisp_Object *def_attrs = def_face->lface; Lisp_Object lattrs[LFACE_VECTOR_SIZE]; @@ -5360,6 +5365,20 @@ gui_supports_face_attributes_p (struct frame *f, return false; } + /* Check supported underline styles. */ + val = attrs[LFACE_UNDERLINE_INDEX]; + if (!UNSPECIFIEDP (val)) + { + if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) + { + return false; /* Unsupported underline style */ + } + } + } + /* Everything checks out, this face is supported. */ return true; } @@ -5452,15 +5471,26 @@ tty_supports_face_attributes_p (struct frame *f, val = attrs[LFACE_UNDERLINE_INDEX]; if (!UNSPECIFIEDP (val)) { - if (STRINGP (val)) - return false; /* ttys can't use colored underlines */ - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) - return false; /* ttys can't use wave underlines */ - else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) - return false; /* same as default */ - else - test_caps |= TTY_CAP_UNDERLINE; - } + if (STRINGP (val)) + test_caps |= TTY_CAP_UNDERLINE_STYLED; + else if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) + { + return false; /* Face uses an unsupported underline style. */ + } + + test_caps |= TTY_CAP_UNDERLINE_STYLED; + } + else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) + return false; /* same as default */ + else + test_caps |= TTY_CAP_UNDERLINE; + } /* inverse video */ val = attrs[LFACE_INVERSE_INDEX]; @@ -6381,6 +6411,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] face->underline = FACE_UNDER_LINE; else if (EQ (value, Qwave)) face->underline = FACE_UNDER_WAVE; + else + face->underline = FACE_UNDER_LINE; } else if (EQ (keyword, QCposition)) { @@ -6431,17 +6463,18 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] } -/* Map a specified color of face FACE on frame F to a tty color index. - IDX is either LFACE_FOREGROUND_INDEX or LFACE_BACKGROUND_INDEX, and - specifies which color to map. Set *DEFAULTED to true if mapping to the - default foreground/background colors. */ +/* Map the specified color COLOR of face FACE on frame F to a tty + color index. IDX is one of LFACE_FOREGROUND_INDEX, + LFACE_BACKGROUND_INDEX or LFACE_UNDERLINE_INDEX, and specifies + which color to map. Set *DEFAULTED to true if mapping to the + default foreground/background colors. */ static void -map_tty_color (struct frame *f, struct face *face, +map_tty_color (struct frame *f, struct face *face, Lisp_Object color, enum lface_attribute_index idx, bool *defaulted) { - Lisp_Object frame, color, def; - bool foreground_p = idx == LFACE_FOREGROUND_INDEX; + Lisp_Object frame, def; + bool foreground_p = idx != LFACE_BACKGROUND_INDEX; unsigned long default_pixel = foreground_p ? FACE_TTY_DEFAULT_FG_COLOR : FACE_TTY_DEFAULT_BG_COLOR; unsigned long pixel = default_pixel; @@ -6450,10 +6483,11 @@ map_tty_color (struct frame *f, struct face *face, foreground_p ? FACE_TTY_DEFAULT_BG_COLOR : FACE_TTY_DEFAULT_FG_COLOR; #endif - eassert (idx == LFACE_FOREGROUND_INDEX || idx == LFACE_BACKGROUND_INDEX); + eassert (idx == LFACE_FOREGROUND_INDEX + || idx == LFACE_BACKGROUND_INDEX + || idx == LFACE_UNDERLINE_INDEX); XSETFRAME (frame, f); - color = face->lface[idx]; if (STRINGP (color) && SCHARS (color) @@ -6498,10 +6532,28 @@ map_tty_color (struct frame *f, struct face *face, #endif /* MSDOS */ } - if (foreground_p) - face->foreground = pixel; - else - face->background = pixel; + switch (idx) + { + case LFACE_FOREGROUND_INDEX: + face->foreground = pixel; + break; + case LFACE_BACKGROUND_INDEX: + face->background = pixel; + break; + case LFACE_UNDERLINE_INDEX: + face->underline_color = pixel; + break; + default: + emacs_abort (); + } +} + +static void +map_tty_color2 (struct frame *f, struct face *face, Lisp_Object color, + enum lface_attribute_index idx) +{ + bool face_colors_defaulted = false; + map_tty_color (f, face, color, idx, &face_colors_defaulted); } @@ -6515,6 +6567,7 @@ realize_tty_face (struct face_cache *cache, { struct face *face; int weight, slant; + Lisp_Object underline; bool face_colors_defaulted = false; struct frame *f = cache->f; @@ -6534,16 +6587,77 @@ realize_tty_face (struct face_cache *cache, face->tty_bold_p = true; if (slant != 100) face->tty_italic_p = true; - if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) - face->tty_underline_p = true; if (!NILP (attrs[LFACE_INVERSE_INDEX])) face->tty_reverse_p = true; if (!NILP (attrs[LFACE_STRIKE_THROUGH_INDEX])) face->tty_strike_through_p = true; + /* Text underline. */ + underline = attrs[LFACE_UNDERLINE_INDEX]; + if (NILP (underline)) + { + face->underline = FACE_NO_UNDERLINE; + face->underline_color = 0; + } + else if (EQ (underline, Qt)) + { + face->underline = FACE_UNDER_LINE; + face->underline_color = 0; + } + else if (STRINGP (underline)) + { + face->underline = FACE_UNDER_LINE; + map_tty_color2 (f, face, underline, LFACE_UNDERLINE_INDEX); + } + else if (CONSP (underline)) + { + /* `(:color COLOR :style STYLE)'. + STYLE being one of `line', `double', `wave', `dotted' or `dashed'. */ + face->underline = FACE_UNDER_LINE; + face->underline_color = 0; + + while (CONSP (underline)) + { + Lisp_Object keyword, value; + + keyword = XCAR (underline); + underline = XCDR (underline); + + if (!CONSP (underline)) + break; + value = XCAR (underline); + underline = XCDR (underline); + + if (EQ (keyword, QCcolor)) + { + if (EQ (value, Qforeground_color)) + face->underline_color = 0; + else if (STRINGP (value)) + map_tty_color2 (f, face, value, LFACE_UNDERLINE_INDEX); + } + else if (EQ (keyword, QCstyle)) + { + if (EQ (value, Qline)) + face->underline = FACE_UNDER_LINE; + else if (EQ (value, Qdouble)) + face->underline = FACE_DOUBLE_UNDER_LINE; + else if (EQ (value, Qwave)) + face->underline = FACE_UNDER_WAVE; + else if (EQ (value, Qdotted)) + face->underline = FACE_DOTTED_UNDER_LINE; + else if (EQ (value, Qdashed)) + face->underline = FACE_DASHED_UNDER_LINE; + else + face->underline = FACE_UNDER_LINE; + } + } + } + /* Map color names to color indices. */ - map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); - map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); + map_tty_color (f, face, face->lface[LFACE_FOREGROUND_INDEX], + LFACE_FOREGROUND_INDEX, &face_colors_defaulted); + map_tty_color (f, face, face->lface[LFACE_BACKGROUND_INDEX], + LFACE_BACKGROUND_INDEX, &face_colors_defaulted); /* Swap colors if face is inverse-video. If the colors are taken from the frame colors, they are already inverted, since the @@ -7229,6 +7343,9 @@ syms_of_xfaces (void) DEFSYM (QCposition, ":position"); DEFSYM (Qline, "line"); DEFSYM (Qwave, "wave"); + DEFSYM (Qdouble, "double"); + DEFSYM (Qdotted, "dotted"); + DEFSYM (Qdashed, "dashed"); DEFSYM (Qreleased_button, "released-button"); DEFSYM (Qpressed_button, "pressed-button"); DEFSYM (Qflat_button, "flat-button"); -- 2.43.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2024 18:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org, Eli Zaretskii Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17076748689598 (code B ref 62994); Sun, 11 Feb 2024 18:08:02 +0000 Received: (at 62994) by debbugs.gnu.org; 11 Feb 2024 18:07:48 +0000 Received: from localhost ([127.0.0.1]:36444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZEF1-0002Uj-Rt for submit@debbugs.gnu.org; Sun, 11 Feb 2024 13:07:48 -0500 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:43852 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZEF0-0002UY-Cd for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 13:07:46 -0500 Received: from mk-desktop (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 7CA71A2796; Sun, 11 Feb 2024 19:07:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1707674849; bh=Ij+wU7nP89z7d9l+81RmjGei9DpFLR8zWRIthpyrm7w=; h=From:To:Subject:In-Reply-To:References:Date:From; b=iD6oMMLXMDE+KjXZNqJJaqDs4y6hA9Al4Y5wMLAWbh7p6FCstJGEyucPgVmnVVf1H M//nAqun06TuBscz7H2oMxP+cPPTgrYKhhXEEkzyM1yR+pF/9ql9vLMjPtaHgNdKXe VpFfSKp9rebRnzRq3vu8/ERRw4yLm1uMK5dbCRFSmLVjasGZCSWILCpw1JHU3ZfFNB gULoM9kycIatKeFaR2VKT68OzYTp4A9CPg5Ca0QrIomwH2DJutM6/ZWstkpdXcH0DI lfwPhpLDihPLMhWqtxtsmBaz6QHhvCgC6EpmvYZ2ud7D71ANYssD+F5V7JUA9fgurF l065ClzInJoyw== From: Mohsin Kaleem In-Reply-To: <20240211180501.695192-1-mohkale@kisara.moe> References: <20240211180501.695192-1-mohkale@kisara.moe> Date: Sun, 11 Feb 2024 18:07:29 +0000 Message-ID: <87v86uzxge.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) mohkale@kisara.moe writes: Finally got there XD. This is the correct commit. Please disregard V4. -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v3 1/1] Add support for colored and styled underlines on tty frames Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Feb 2024 01:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mohkale@kisara.moe Cc: Eli Zaretskii , 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.170770131926302 (code B ref 62994); Mon, 12 Feb 2024 01:29:02 +0000 Received: (at 62994) by debbugs.gnu.org; 12 Feb 2024 01:28:39 +0000 Received: from localhost ([127.0.0.1]:39057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZL7f-0006q7-Bz for submit@debbugs.gnu.org; Sun, 11 Feb 2024 20:28:39 -0500 Received: from sonic317-33.consmr.mail.ne1.yahoo.com ([66.163.184.44]:38078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZL7d-0006pg-4k for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 20:28:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1707701294; bh=6C9yvClYKkAMu1LG+3z0xVzDY9FQYzLsdgACzAuIHPk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=ZQ+LKbi3BJDHd8J+dK5JaEmHLCdrdrv3ZNYSnChPNEisX2VbASj9YuWD731ArGhoggjYGC5f0lY/0dM7/9E88gcMwvLe9rs2VfEu+Lq8VJHJjmHv9eDS+MiGGK88wrGl3gt0iTdMV6h4Cqt+hQVdcbGIDlJ/4RWSqs3YUlpS4Jsx2V+ceIfn02qRfkQfprjDJwM4gCZmhHbMxk0EI9txHvkuwijKVU/BlThy5JjRqe3QtqDCEj3v00dUIfwuySW+fmYxNqc0ZEP6Cl99FqxVd1ae6bUa6CZB5K2eLm/LqRJizJFLE4bKdK+J/HJjoM8O8WchUuzCW4umMUHX3w0txw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1707701294; bh=kyR2gRFMEuH+IYnfck9lhq1cqZyZsKPJzHjZv+qnkYm=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=SWpdHOhqYXXe7hyCnQt9jUhLITJSd/09CNnPwnmBa+hY2LfrfIpSNjbR+jVnyI2ppLosiN66B33tPl60uGsqeo94OToVfcHJOyomNv7t3b5+3hD2nLVSnR88wL2wCRPiOaCXE9BmFvePFL1iacDoFQzyFk4a9SxxpDpfclD4ufFNX1GCE6vA/4Le7/kENGqCMKH/1gHl7c1lovxccpnK6YqQyxzgQZPM/gs58C7zg+z8OidsiZl4P04zdKh1/sHNcga7CDp/amXwViIupYht57O40zmzTqZFR87nhpl5WUEp26UNOSfHs7/Oq2wIHpF4wf7VPVliI0XOHbb7DfQ+xg== X-YMail-OSG: RyzlzWAVM1nNx2uXNxOpiRrZggTb0Wc60XLPvh6fWyTvaXGGy1GBZ.gXiVWmKAy qdLndq8ynAh.DlJmUJ.HM6weUokXviQP8UoZNtKz7wf5OJmQSa1920vqtG3T6lrPMo31jwDsQhXq gZ0XEjzZ2bEQ29UqqALxowf06eCLmItMBhdhxpNmj4SH01zeTiKqpVtcPf04M_jrYwjCfNU_B1M2 4ImYoG8BoG_hzwrshtK3dElgSO.jnQOVRyXJ1oBc19auZg9gcEED7Jcm0lwYIAOKHvxYkyYKL5TV ROHcetyO5nmiO3O6A6Qf_YLa.c.gE3f0qImaOcPAAkxzCxc03_oPZJgtFpufga8uF5YqfAdBpiTC 1zikVzmke5aFWJ4fF1c2.HfLC4GYRTIEsfaePgvlD_xPIl0YOdnIPwuCcS6gyxlaICLgE55zfROW TPzK1mEVhvUoaJGooFRYQALVaCykaxH3nZUiTtE9A7iaw2FLHWf2FEUqXVcBhFN.F5LhVQcO2PsV vkfsJROfG1dYWAKjVkDxDaq9Qx1LxV49a9QVo9MIEiHEDOV9jPahRaEps1haBpP0HgLVmsdiRFbd Glxf69VsgGvmGiUXA5jgzrqQ6WRGRmxsE0pOhlVbz89S1FYE2.ohndu.rcXGSxRo4aP9UzOvaRDu HR9WBmETwlsW4_ZqkPVjtXSxmgifT0DKMHLCEOk9L0gWH56h3zVDluAR2ZcCByuZkXdea8hO_YYX wDprO6Cff9CV4DcCnUZAfa1WxBck_EA0PAiWQWXRw4bC35X9hjWhT8l_cCk.zVTfmCCxJDRraLmM _A24OA8.T_.Vlo0M_RbQ8cwyHqXUvfrvRKIlJflJGziuWk6RemXctUGL6gEy7iNg3w4j2u.C2lIH qYNL2U6aSRZpPQREUkrGfsBxBkMTym7B1hYJTM7EBMv5i5QYymwbthFGsnSy_cjsbCi5mwVX0ppo 1u0pEBflnfyX.hY6G3E0VFqDqLHFJ7wLrPF7bBOk9P6JOEl0eO6sevw1GVEY8WQySuCgQZ0EZdhd 4qguxAulc6OUJcfDN52eDfvjirKs0r0PXCkKJZgtMXHvskHqqgvEzcNPPoIbW1dNW7OE8nmmDvZi Z_G.Mqrna0POQ_caqtgiJzcsGzRw2ZIsIY49DT.AswOwfaTPBmwpmTuuPIu13Xwd1hx1FPxEsOqd HUG1h0K_sN6DRhOETXgWZNxmEBhbp.JlfohmaZQLqGcHBHyEmPWfuDa5a1IGxX_gb4SfzhL_Ch6R E_FBWWsksLwMnyo.ZsL0nH27YNAqzULwIyay5SOMxTY6NKJFSt5O5aKGgm9.pil0jIxxoo7HIffT xCFZIG21inoulTjqpof.nxMu2RK0Lv84ZE2tCST1njgte1UpkcwXdkQaj5OhMbJlX2gmmvE5ICvh TlagcyttA5qyztYs5Zw3.VBwrG_3mnXEq2riuA83lbnZRzoAcdIYBcY77KFGpXdBZl4VWm34MCH5 Je5_FkO4vSq0OHYGc4XLJx85oWzJNfkGnDeqe95ZwrFans7j_.sBeadxZnuX1kRzQSCSIqYOGL17 T6mUx.cqHPG8P0uqBwdCK7R33fKm_SeJvW3wLXs4aZLzyzVLxwqA2Y__tR2yCa4Exaslrzle6G3Q pdTWJ6dpYk7ZmahGYgBpAqVT9McQEkc1D4l.hJzMXNZRbdgV3jKrp5jlg1PSaY.SZePvoOlNJoyI jwsikDIeHSu0EDT8uZ.mw8_NzBtzxDMa5QH8fXSLxt2CsZ09hMQ39RGQbY6Kk7lLvemyk8G5XUiQ haE9y1lHhZjsy1WF.PQDwsW_hlmMRYzHOP04zzcQegzngaFXgTPqRBh2K_LkmJoC9o73sGeeMTfH o_lnIUtqCV3pibmfW424a_dmqtEveOZ.Cmq2xDZehwDJP4b_4Lnf0TbCw5ibmBUTdBYNyqiFJKws Qlr8Y_MDyvuXO91lb8vY3lg7Paq_iTdITntBZjvPwt6dvFKWOcFLllzzBigEcHxjlQLeGGxYvYyk 7rRaVcodKVm2HJ3FagYXifb6HhANwLmzWqwjLYM0GeGEuSLtFazkgTCZebScI6m0vLSkTsl7m5wz v9eSrexMros71_7R6X4KeguZjcKynI26RU7rpEsdmbXCXNYfQY7SB632P3sGMJActMgjRswYlmlg 2eWDoRhqIXL2OGzjHaf_Wi0_ztf35SgaZNjO.2StTmieDP2AY.sSHHQmhWqkUTsW0Fa12DaTmHHW Duj1kh7UaSvQcMUku9KwLb38Yh.uwl3C94c2VszjpLfW.GG4sRAj0jhVTBpfubX2h9PIc X-Sonic-MF: X-Sonic-ID: 92075f8a-0872-4b33-aea6-8588bef8f6fd Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Mon, 12 Feb 2024 01:28:14 +0000 Received: by hermes--production-sg3-6dc75bc8fb-dgkh5 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f52d843df0db60b75df30273f4fd7cf0; Mon, 12 Feb 2024 01:28:10 +0000 (UTC) From: Po Lu In-Reply-To: <20230422102146.93003-2-mohkale@kisara.moe> (mohkale@kisara.moe's message of "Sat, 22 Apr 2023 11:21:46 +0100") References: <20230422102146.93003-1-mohkale@kisara.moe> <20230422102146.93003-2-mohkale@kisara.moe> Date: Mon, 12 Feb 2024 09:28:03 +0800 Message-ID: <87il2u1nfg.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.22077 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 464 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) mohkale@kisara.moe writes: > From: Mohsin Kaleem > > * src/dispextern.h (face, face_underline_type, syms_of_xfacse, > internal-set-lisp-face-attribute, gui_supports_face_attributes_p): Type `C-c C-w' within a *vc-log* buffer to generate commit messages, and fill them with `M-q'. Otherwise, you will wind up with typos and errors such as this entry, where a newline is used to separate entries within a single pair of parentheses. Thanks. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Feb 2024 01:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mohkale@kisara.moe Cc: Eli Zaretskii , 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.170770222929104 (code B ref 62994); Mon, 12 Feb 2024 01:44:02 +0000 Received: (at 62994) by debbugs.gnu.org; 12 Feb 2024 01:43:49 +0000 Received: from localhost ([127.0.0.1]:40230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZLMK-0007ZI-Rm for submit@debbugs.gnu.org; Sun, 11 Feb 2024 20:43:49 -0500 Received: from sonic315-21.consmr.mail.ne1.yahoo.com ([66.163.190.147]:36964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZLMI-0007Yl-AN for 62994@debbugs.gnu.org; Sun, 11 Feb 2024 20:43:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1707702203; bh=368x4V/BaXRnthyFl7g7loq/CkSHeXJl4FzxK1E57oA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=NwVMCh5Tdh+xqdmeNWaC3V9ZQjNHUJiBFQ/LOeSnT1U6lm+R4T/AHTTmRIffGdixKS/HdDgPEnQgkbFlEotPhFqtWhcheA20M71/88zrFj9NisWMY4PoEbSxvAoZej36BbUsZnnW2wVOj3gNXIog7JYmYUsO5Jh0I1Ghr6kBXpLpsUP+lHu+1PrUky3aQlw7PLdLhMW/dzb6OPW2zdVKbO9Y2iDST3YfuWfogx5mYF3SLyR5jRaklhz8FgLCHeRKoydPsYhDGXxGbBUeYuZIuD6ySBQ5KCAX++n2kP2Q+ylz/abjAklSCZQNpSsaIoef9VGH8El/6hwd3OicDb5s2g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1707702203; bh=E1PEKkp+2fvKq4llQsaHvlpVjWGqsLQFCXQW2exxpfE=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=FDoKdRLtj3t54JdLkps5ZibzpKkGh7WJ2w5BUhN3Jh7lLLFfSoZJpLlCTdv0R6+tFNjcYDH7auFN4VLt3pz4XKOWvhPCq8lLsIm41gIL0CcCidAilV3xlEKYoFClGS6ib83a1cwymw2ZhdGEAixAzt7KlJ0Y2WYFMHJbf81HnB5yd3NAz5I6JpLYoKm0nyLzwqlu0Ka8WvfRvdGkIlACrnWXhoHfOv+FJdSxAzfCn+FEixf+NDjT6RGMqckEvodJKIIu9+KlHU1HLqZsvkl2gHGvbQwipxPidoMbmNXHY/0uiqlo3vhE8YkH6m6fxgyslh5ApMBSofNlIeR6pvgVCQ== X-YMail-OSG: QFPpR9sVM1lquRZanvGXpE0.DUVOrvWGWPd75mdwHBmNnr0nBOAPEvzIPnrySB9 VM_dazvmELRfwRTImUsdBqJQSfj.G3cEKPyxE_rDY_7uO2ZM5xtmVi9xVLb6HmVrsHe9lt5XkRCh SPFukaA34kiD.UntTkaQkVmYHa27zpX.4u1Z8gVLSAYjexH.w9o6G_vW8655k0vbvh3EeoLg0CLf hJjL6pg5twXkIUr3EQs3Ogv2lL1ssPTrAPcp8IWGom8Fv6uRSOWDIyjAm0RbRBqOP9f2o1jsZEq0 z2NaNpHRmZhJy2eVuFk9_E2lRD55HJ8vTP8G3GVTIhMUzAMl7bhd5HNh2O7L50idpcdmLhzEUVjp pfSrZiFwW68tpCoXw4FaOwc.pLyN6dQaSjSkUoGulQJgViNIEb7rKkKGHme1QNdJ7BXB7eF2ln7Y jxD2mCZBE8mE8BU.fkMgwEAVSg2xsMfYenRmBiDNkKQoVYHxVIOaVmYYYJRsjqz8PO92i1erR.YU ZW8_gEz9C0BWgn.pzytmFjw9fHJxYInPC8gFY.e1LHAx.APQgMZFQ079RVVxheIRUftEaaLnNyKk fgAPxkroAWnO9ra5zxXQPpaXM8OerxuZOqQ5OVXVki.nyciuzMMF74zft7f8XXeuMD3Cl3l6beTT zm3KTGt5Df276c13cWnMXla9.OELnV9ndXyMKNIGx6OZSfdCbhoW1kr6Fh_nXQJxZG5GQLsotSvg bJhwSxu2Wt8751VuzKGbfJ6clAPTiA5iG63DhueHUTn2XjJkEQurhYR8z7H35L9Zb1IqH684ISCE mwcf1afI_p774yvgg5.Pe77z7EmFlCFb9BTTASPzKS9pKulb9CBKbHd03_Ajyicni3CrXAGsdmYj n1bbSiLNgL8n3.m91P5GQMkYPyLZXpr4Jgx.DeWTwIhYlNBIuJe74rVgTNrIsO3lJosoBYSMCP5e VwpKaYV8B5F7LzhYRNm5lTIsFk69Cv_h7UJLUWQEonmmhhhShvBqO3OYdr2U7LdDZDbaEiIG00Z6 n6dEP4KgG00Mx_33nWJOarYzTNMoVrRu_KhliU2_w0hdRh4iDsXMTjCgJY6Rm58Hen4.YVB6WhQt 8WUyCiLZKaXCaLbX7S9DuwSgYLK2.1omp3aj_BoQMjgRu5YRnULp_Gzxxeomiq9Qwg9L2x2KziNN AwihZ9XH3gK6P1QGskf.FAxrKBpsSrOhPftuU0z.j6cPzHlZ6vvnjMvjkTXPs7NiiOLIjE2tViml EkTeKxsP9bxiarS5Y1yL8EyCCx2qW6zcZN6au9JaTpnRfn_j_YAptakWuLeK1ucQCaFYPPqmIudG C0ZSce_dl4W9oM8S7meifZrJ6Rxkdhxxpnurj5SEa9BwHBcyjExiyZSTNsARhTrL8_eeBk5eZc4t RUJ2MGk0f.IN9uFIQ6E6_3cpbbjAoCO.3nfNC.c8UYQgKuSIrDHgctTBeITILfUmxDHpoKPDYd5j raoFBwRNpIp42bvR4pAjJupVFfo4B20DyK.BiRwsoHHy1LOMXmRFPDl8CdXvMgal8VAJzUZaRAj5 jW0jaXCKBkWzKQGOsbTUY8AQEVxLBplAUL3xWcgiIPCiJzq.z6ZO75quYE9Qa6dJo00dugaTSc1O 0o.i3bvNcqnGWRvgDMJbBk8K2r_EE98Q7zfVRJ.nEv1MREGOuc4WRlakGcSk210oyk3x9NDZsBES iG2oKcNs_8qsgMYpyfz4AADF8Dwh6li0ZZeb4R2QoQoXHeBwkMtZyoYIFblb1PF5q39cmZpramk2 KejNIrEG_uSHVDVcvNzyVIQAfNxFgR_o9hJsoBTLwQYnrB9QJQStoTS42LBagosRbvkm5R6R7ZMq cFCja23.QDINOIpkGJPu58dTAVpU857.lJCsJy_0jjmSmMi4_KrfPgTTQp_L85.WaytK.xPPJiBH N5jnXrvE06HD1Gf6RI6ich_59RiLyRXxzbis.djuX8NXhW5WHcnsauDrcdwBwkGQMaguO9jjZYko 7K_EN_uM7vnVM7e50KdVsPVCy1fbMc9CNREum_Qs79PVhrPSog19LglnKfXhxW9_dz3mG9Tq4BF1 EG8YnY9WEKl3pdjok0xTFltwhUw8llEkZwwEEGaN4eOMGulux1S3Nk8tzCnWQIGKDW.eY4bJY.fL 8ZodAlajKa.Mjg9NI.XZm7FKcpiQEixH7qEhhtR0z15YEB7X6lY4J1ZFbyrzAfEk5OzeHl2Nv2Yb 2nJsgmj1Zjv9f4jvMc0I8AwP6grs9v2rDiuIB9FaGyM.GTppaMDeFy3YYPs92S3V6Cny0 X-Sonic-MF: X-Sonic-ID: f56269a4-586e-45f7-90ea-af98f08c794a Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.ne1.yahoo.com with HTTP; Mon, 12 Feb 2024 01:43:23 +0000 Received: by hermes--production-sg3-6dc75bc8fb-pccgz (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 5dff8a142c89abb311616b2cab7bff2a; Mon, 12 Feb 2024 01:43:18 +0000 (UTC) From: Po Lu In-Reply-To: <20240211180501.695192-1-mohkale@kisara.moe> (mohkale@kisara.moe's message of "Sun, 11 Feb 2024 18:05:01 +0000") References: <20240211180501.695192-1-mohkale@kisara.moe> Date: Mon, 12 Feb 2024 09:43:11 +0800 Message-ID: <87bk8m1mq8.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.22077 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 15055 X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) mohkale@kisara.moe writes: > ++++ Where's the documentation for this change? > +*** Support for 'styled' and 'colored' underline face attributes on TTY frames We prefer to punctuate sentences within NEWS headings. > +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 or a color other than the foreground-color. > +The available underline styles for TTY frames are 'double', 'wave', > +'dotted', and 'dashed'. These are currently supported by Kitty, > +libvte, and st (through the undercurl patch) among other terminals. What about GUI frames? I don't want to see a display feature installed before it is also implemented for the likes of X. > > * Editing Changes in Emacs 30.1 > > diff --git a/lisp/cus-face.el b/lisp/cus-face.el > index 47afa841f5e..12551e37785 100644 > --- a/lisp/cus-face.el > +++ b/lisp/cus-face.el > @@ -141,7 +141,10 @@ custom-face-attributes > (const :format "" :value :style) > (choice :tag "Style" > (const :tag "Line" line) > - (const :tag "Wave" wave)) > + (const :tag "Double" double) > + (const :tag "Wave" wave) > + (const :tag "Dotted" dotted) > + (const :tag "Dashed" dashed)) > (const :format "" :value :position) > (choice :tag "Position" > (const :tag "At Default Position" nil) > diff --git a/src/dispextern.h b/src/dispextern.h > index 5387cb45603..574798fc547 100644 > --- a/src/dispextern.h > +++ b/src/dispextern.h > @@ -1690,9 +1690,13 @@ #define FONT_TOO_HIGH(ft) \ > > enum face_underline_type > { > + /* Note: Order matches the order of the Smulx terminfo extension. */ > FACE_NO_UNDERLINE = 0, > FACE_UNDER_LINE, > - FACE_UNDER_WAVE > + FACE_DOUBLE_UNDER_LINE, > + FACE_UNDER_WAVE, > + FACE_DOTTED_UNDER_LINE, > + FACE_DASHED_UNDER_LINE, > }; > > /* Structure describing a realized face. > @@ -1776,7 +1780,7 @@ #define FONT_TOO_HIGH(ft) \ > ENUM_BF (face_box_type) box : 2; > > /* Style of underlining. */ > - ENUM_BF (face_underline_type) underline : 2; > + ENUM_BF (face_underline_type) underline : 3; > > /* If `box' above specifies a 3D type, true means use box_color for > drawing shadows. */ > @@ -1808,7 +1812,6 @@ #define FONT_TOO_HIGH(ft) \ > string meaning the default color of the TTY. */ > bool_bf tty_bold_p : 1; > bool_bf tty_italic_p : 1; > - bool_bf tty_underline_p : 1; > bool_bf tty_reverse_p : 1; > bool_bf tty_strike_through_p : 1; > > @@ -3421,6 +3424,7 @@ #define TTY_CAP_BOLD 0x04 > #define TTY_CAP_DIM 0x08 > #define TTY_CAP_ITALIC 0x10 > #define TTY_CAP_STRIKE_THROUGH 0x20 > +#define TTY_CAP_UNDERLINE_STYLED 0x32 & TTY_CAP_UNDERLINE #define TTY_CAP_UNDERLINE_STYLED (0x32 & TTY_CAP_UNDERLINE) > + if (face->underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) > + { > + if (face->underline == FACE_UNDER_LINE > + || !tty->TF_set_underline_style) > + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); > + else if (tty->TF_set_underline_style) > + { > + char *p; > + p = tparam(tty->TF_set_underline_style, NULL, 0, face->underline, 0, 0, 0); > + OUTPUT (tty, p); > + xfree (p); > + } > + } In Emacs, we format code with a mixture of tabs and spaces, using tabs to indent by whole tab stops and spaces to indent to the desired column, which is a multiple of 2 columns for most statements or the column after the opening paren where applicable. Please also insert a space between function identifiers and argument lists, and confine all text to 80 columns. > if (face->tty_strike_through_p > && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) > @@ -2041,6 +2052,14 @@ turn_on_face (struct frame *f, int face_id) > OUTPUT (tty, p); > xfree (p); > } > + > + ts = tty->TF_set_underline_color; > + if (ts && face->underline_color) > + { > + p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0); > + OUTPUT (tty, p); > + xfree (p); > + } > } > } Likewise. > @@ -2061,7 +2080,7 @@ turn_off_face (struct frame *f, int face_id) > if (face->tty_bold_p > || face->tty_italic_p > || face->tty_reverse_p > - || face->tty_underline_p > + || face->underline > || face->tty_strike_through_p) > { > OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); > @@ -2073,7 +2092,7 @@ turn_off_face (struct frame *f, int face_id) > { > /* If we don't have "me" we can only have those appearances > that have exit sequences defined. */ > - if (face->tty_underline_p) > + if (face->underline) > OUTPUT_IF (tty, tty->TS_exit_underline_mode); > } > > @@ -2104,6 +2123,9 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ > TTY_CAPABLE_P_TRY (tty, > TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, > NC_UNDERLINE); > + TTY_CAPABLE_P_TRY (tty, > + TTY_CAP_UNDERLINE_STYLED, tty->TF_set_underline_style, > + NC_UNDERLINE); > TTY_CAPABLE_P_TRY (tty, > TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); > TTY_CAPABLE_P_TRY (tty, > @@ -4360,6 +4382,30 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) > tty->TF_underscore = tgetflag ("ul"); > tty->TF_teleray = tgetflag ("xt"); > > + /* Styled underlines. Support for this is provided either by the > + escape sequence in Smulx or the Su flag. The latter results in a > + common default escape sequence and is not recommended. */ Here you have evidently typed `M-x tabify' with a comment selected. Do not insert tabs by whatever means within the body of a comment, although it is best to indent the body itself with them, whenever possible. > +#ifdef TERMINFO > + tty->TF_set_underline_style = tigetstr("Smulx"); > + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) > + tty->TF_set_underline_style = NULL; > +#else > + tty->TF_set_underline_style = tgetstr("Smulx", address); > +#endif > + if (!tty->TF_set_underline_style && tgetflag("Su")) > + /* Default to the kitty escape sequence. See > + https://sw.kovidgoyal.net/kitty/underlines/ */ > + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; > + > + if (tty->TF_set_underline_style) > + /* This escape sequence for setting the underline color is > + consistent with the one described in kitty (see above) and > + adapted from the one used by neovim. This sequence has > + been altered from the neovim sequence at > + https://github.com/neovim/neovim/blob/42f492ac99058bd1cd56c3c7871e7e464b2a5e24/src/nvim/tui/tui.c#L1932 > + to require only a single parameter, the color index. */ > + tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm"; More indentation problems. Please don't link to Github, and explain instead the reasoning behind the sequence itself. > #else /* DOS_NT */ > #ifdef WINDOWSNT > { > diff --git a/src/termchar.h b/src/termchar.h > index 2d845107e11..de9009d32f1 100644 > --- a/src/termchar.h > +++ b/src/termchar.h > @@ -171,6 +171,13 @@ #define EMACS_TERMCHAR_H > non-blank position. Must clear before writing _. */ > int TF_teleray; /* termcap xt flag: many weird consequences. > For t1061. */ > + const char *TF_set_underline_style; /* termcap Smulx entry: Switches the underline > + style based on the parameter. Param should > + be one of: 0 (none), 1 (straight), 2 (double), > + 3 (wave), 4 (dotted), or 5 (dashed). */ > + const char *TF_set_underline_color; /* Enabled when TF_set_underline_style is set: > + Sets the color of the underline. Accepts a > + single parameter, the color index. */ Egregious indentation error. > int RPov; /* # chars to start a TS_repeat */ > > diff --git a/src/xfaces.c b/src/xfaces.c > index a558e7328c0..a39e2bb6781 100644 > --- a/src/xfaces.c > +++ b/src/xfaces.c > @@ -3311,7 +3311,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, > } > > else if (EQ (key, QCstyle) > - && !(EQ (val, Qline) || EQ (val, Qwave))) > + && !(EQ (val, Qline) > + || EQ (val, Qdouble) > + || EQ (val, Qwave) > + || EQ (val, Qdotted) > + || EQ (val, Qdashed))) > { > valid_p = false; > break; > @@ -5266,6 +5270,7 @@ gui_supports_face_attributes_p (struct frame *f, > Lisp_Object attrs[LFACE_VECTOR_SIZE], > struct face *def_face) > { > + Lisp_Object val; > Lisp_Object *def_attrs = def_face->lface; > Lisp_Object lattrs[LFACE_VECTOR_SIZE]; > > @@ -5360,6 +5365,20 @@ gui_supports_face_attributes_p (struct frame *f, > return false; > } > > + /* Check supported underline styles. */ > + val = attrs[LFACE_UNDERLINE_INDEX]; > + if (!UNSPECIFIEDP (val)) > + { > + if (EQ (CAR_SAFE (val), QCstyle)) > + { > + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) > + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) > + { > + return false; /* Unsupported underline style */ > + } > + } > + } > + > /* Everything checks out, this face is supported. */ > return true; > } > @@ -5452,15 +5471,26 @@ tty_supports_face_attributes_p (struct frame *f, > val = attrs[LFACE_UNDERLINE_INDEX]; > if (!UNSPECIFIEDP (val)) > { > - if (STRINGP (val)) > - return false; /* ttys can't use colored underlines */ > - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) > - return false; /* ttys can't use wave underlines */ > - else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) > - return false; /* same as default */ > - else > - test_caps |= TTY_CAP_UNDERLINE; > - } > + if (STRINGP (val)) > + test_caps |= TTY_CAP_UNDERLINE_STYLED; > + else if (EQ (CAR_SAFE (val), QCstyle)) > + { > + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) > + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) > + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) > + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) > + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) > + { > + return false; /* Face uses an unsupported underline style. */ > + } > + > + test_caps |= TTY_CAP_UNDERLINE_STYLED; > + } > + else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) > + return false; /* same as default */ > + else > + test_caps |= TTY_CAP_UNDERLINE; > + } Ditto. Please also avoid inserting redundant braces in if statements. > static void > -map_tty_color (struct frame *f, struct face *face, > +map_tty_color (struct frame *f, struct face *face, Lisp_Object color, > enum lface_attribute_index idx, bool *defaulted) > { > - Lisp_Object frame, color, def; > - bool foreground_p = idx == LFACE_FOREGROUND_INDEX; > + Lisp_Object frame, def; > + bool foreground_p = idx != LFACE_BACKGROUND_INDEX; > unsigned long default_pixel = > foreground_p ? FACE_TTY_DEFAULT_FG_COLOR : FACE_TTY_DEFAULT_BG_COLOR; > unsigned long pixel = default_pixel; > @@ -6450,10 +6483,11 @@ map_tty_color (struct frame *f, struct face *face, > foreground_p ? FACE_TTY_DEFAULT_BG_COLOR : FACE_TTY_DEFAULT_FG_COLOR; > #endif > > - eassert (idx == LFACE_FOREGROUND_INDEX || idx == LFACE_BACKGROUND_INDEX); > + eassert (idx == LFACE_FOREGROUND_INDEX > + || idx == LFACE_BACKGROUND_INDEX > + || idx == LFACE_UNDERLINE_INDEX); > > XSETFRAME (frame, f); > - color = face->lface[idx]; > > if (STRINGP (color) > && SCHARS (color) > @@ -6498,10 +6532,28 @@ map_tty_color (struct frame *f, struct face *face, > #endif /* MSDOS */ > } > > - if (foreground_p) > - face->foreground = pixel; > - else > - face->background = pixel; > + switch (idx) > + { > + case LFACE_FOREGROUND_INDEX: > + face->foreground = pixel; > + break; > + case LFACE_BACKGROUND_INDEX: > + face->background = pixel; > + break; > + case LFACE_UNDERLINE_INDEX: > + face->underline_color = pixel; > + break; > + default: > + emacs_abort (); > + } > +} > + > +static void > +map_tty_color2 (struct frame *f, struct face *face, Lisp_Object color, > + enum lface_attribute_index idx) > +{ > + bool face_colors_defaulted = false; > + map_tty_color (f, face, color, idx, &face_colors_defaulted); > } Ditto. > @@ -6515,6 +6567,7 @@ realize_tty_face (struct face_cache *cache, > { > struct face *face; > int weight, slant; > + Lisp_Object underline; > bool face_colors_defaulted = false; > struct frame *f = cache->f; > > @@ -6534,16 +6587,77 @@ realize_tty_face (struct face_cache *cache, > face->tty_bold_p = true; > if (slant != 100) > face->tty_italic_p = true; > - if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) > - face->tty_underline_p = true; > if (!NILP (attrs[LFACE_INVERSE_INDEX])) > face->tty_reverse_p = true; > if (!NILP (attrs[LFACE_STRIKE_THROUGH_INDEX])) > face->tty_strike_through_p = true; > > + /* Text underline. */ > + underline = attrs[LFACE_UNDERLINE_INDEX]; > + if (NILP (underline)) > + { > + face->underline = FACE_NO_UNDERLINE; > + face->underline_color = 0; > + } > + else if (EQ (underline, Qt)) > + { > + face->underline = FACE_UNDER_LINE; > + face->underline_color = 0; > + } > + else if (STRINGP (underline)) > + { > + face->underline = FACE_UNDER_LINE; > + map_tty_color2 (f, face, underline, LFACE_UNDERLINE_INDEX); > + } > + else if (CONSP (underline)) > + { > + /* `(:color COLOR :style STYLE)'. > + STYLE being one of `line', `double', `wave', `dotted' or `dashed'. */ > + face->underline = FACE_UNDER_LINE; > + face->underline_color = 0; > + > + while (CONSP (underline)) > + { > + Lisp_Object keyword, value; > + > + keyword = XCAR (underline); > + underline = XCDR (underline); > + > + if (!CONSP (underline)) > + break; > + value = XCAR (underline); > + underline = XCDR (underline); > + > + if (EQ (keyword, QCcolor)) > + { > + if (EQ (value, Qforeground_color)) > + face->underline_color = 0; > + else if (STRINGP (value)) > + map_tty_color2 (f, face, value, LFACE_UNDERLINE_INDEX); > + } > + else if (EQ (keyword, QCstyle)) > + { > + if (EQ (value, Qline)) > + face->underline = FACE_UNDER_LINE; > + else if (EQ (value, Qdouble)) > + face->underline = FACE_DOUBLE_UNDER_LINE; > + else if (EQ (value, Qwave)) > + face->underline = FACE_UNDER_WAVE; > + else if (EQ (value, Qdotted)) > + face->underline = FACE_DOTTED_UNDER_LINE; > + else if (EQ (value, Qdashed)) > + face->underline = FACE_DASHED_UNDER_LINE; > + else > + face->underline = FACE_UNDER_LINE; > + } > + } > + } And ditto. Thanks. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Feb 2024 12:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mohkale@kisara.moe Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17077421599225 (code B ref 62994); Mon, 12 Feb 2024 12:50:01 +0000 Received: (at 62994) by debbugs.gnu.org; 12 Feb 2024 12:49:19 +0000 Received: from localhost ([127.0.0.1]:54726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZVkM-0002Oa-55 for submit@debbugs.gnu.org; Mon, 12 Feb 2024 07:49:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZVkJ-0002NR-0Z for 62994@debbugs.gnu.org; Mon, 12 Feb 2024 07:49:16 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZVjw-0000NR-ID; Mon, 12 Feb 2024 07:48:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=YlrGzxzIq8mYnnXChmXSFaXD4KUU9SVAIiONugrJKks=; b=ixex278BcEzc i8s19p5m1pe2NVqllYULzusPikDPq0TWX8q6agPgru+Yr8b6YykmMLbIrjsojOGTJrT6u62PqTJqP ihANTYpk2FM7A7f+yKZSo1FcEXBu8WnvhqO09uLSPngX5gOrzKj/ffwvNrN7yKOk6xPCTdFEMHi4y ZtkvrUvszZKHW1wcs+SES5alqQJyq0fs2RdAsZQPEU9G2FPtdyAqWmkP+i+JetCloHCOR5cUfCDM0 9hm9x8l1wy4vx9vTQJflS4dUSoMYobPc6o87L84C0XwnkBen5CdekxTVWG5iPOvcKGdhuifeLavuw rUzSlY6fryVhzX7cb1WwsQ==; Date: Mon, 12 Feb 2024 14:48:49 +0200 Message-Id: <86a5o5sv9q.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <20240211180501.695192-1-mohkale@kisara.moe> References: <20240211180501.695192-1-mohkale@kisara.moe> X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) > From: mohkale@kisara.moe > Cc: Mohsin Kaleem > Date: Sun, 11 Feb 2024 18:05:01 +0000 > > From: Mohsin Kaleem > > * 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, Dotted and Dashed. > 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, > Dotted and Dashed 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, map_tty_color2): 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. A new variant map_tty_color2 was added > for contexts where caller doesn't care about foreground/background > face defaulting. > --- > etc/NEWS | 15 +++++ > lisp/cus-face.el | 5 +- > src/dispextern.h | 10 ++- > src/term.c | 54 +++++++++++++-- > src/termchar.h | 7 ++ > src/xfaces.c | 171 +++++++++++++++++++++++++++++++++++++++-------- > 6 files changed, 227 insertions(+), 35 deletions(-) Thanks. I think in addition to NEWS, we'd need to update the ELisp Reference manual, because the new underline styles are not currently mentioned there. > --- a/src/term.c > +++ b/src/term.c > @@ -2014,8 +2014,19 @@ turn_on_face (struct frame *f, int face_id) > OUTPUT1 (tty, tty->TS_enter_dim_mode); > } > > - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) > - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); > + if (face->underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) > + { > + if (face->underline == FACE_UNDER_LINE > + || !tty->TF_set_underline_style) > + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); > + else if (tty->TF_set_underline_style) > + { > + char *p; Here and elsewhere in the patch, you use indentation style slightly different from ours, so please reindent to follow our style (which uses TABs and SPACEs, not just TABs). > + p = tparam(tty->TF_set_underline_style, NULL, 0, face->underline, 0, 0, 0); ^^ Our style is to leave a single SPACE between the name of a function and the opening parenthesis. Several places in the patch don't leave that SPACE. > + /* Styled underlines. Support for this is provided either by the ^^^^^^^ Please don't use TABs inside comments, except as indentation. > + if (!tty->TF_set_underline_style && tgetflag("Su")) > + /* Default to the kitty escape sequence. See > + https://sw.kovidgoyal.net/kitty/underlines/ */ ^^ This should be a period. Also, our style is to leave two SPACEs after the final sentence of a comment, before the "*/" comment delimiter. > + return false; /* Unsupported underline style */ ^ Period and one more SPACE are missing there. > + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) > + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) > + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) > + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) > + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) > + { > + return false; /* Face uses an unsupported underline style. */ > + } Our style is not to use braces for single-statement blocks. > +/* Map the specified color COLOR of face FACE on frame F to a tty > + color index. IDX is one of LFACE_FOREGROUND_INDEX, > + LFACE_BACKGROUND_INDEX or LFACE_UNDERLINE_INDEX, and specifies > + which color to map. Set *DEFAULTED to true if mapping to the > + default foreground/background colors. */ ^^ One more SPACE there. > - if (foreground_p) > - face->foreground = pixel; > - else > - face->background = pixel; > + switch (idx) > + { > + case LFACE_FOREGROUND_INDEX: > + face->foreground = pixel; > + break; > + case LFACE_BACKGROUND_INDEX: > + face->background = pixel; > + break; > + case LFACE_UNDERLINE_INDEX: > + face->underline_color = pixel; > + break; > + default: > + emacs_abort (); The original code didn't call emacs_abort, but instead simply used PIXEL as the background color. Why would we do something different now? > +static void > +map_tty_color2 (struct frame *f, struct face *face, Lisp_Object color, > + enum lface_attribute_index idx) > +{ > + bool face_colors_defaulted = false; > + map_tty_color (f, face, color, idx, &face_colors_defaulted); > } Is this function really justified? why not call map_tty_color? From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Feb 2024 13:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Po Lu Cc: mohkale@kisara.moe, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.170774611828073 (code B ref 62994); Mon, 12 Feb 2024 13:56:02 +0000 Received: (at 62994) by debbugs.gnu.org; 12 Feb 2024 13:55:18 +0000 Received: from localhost ([127.0.0.1]:58185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZWmE-0007Ih-0I for submit@debbugs.gnu.org; Mon, 12 Feb 2024 08:55:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZWiA-0006zy-18 for 62994@debbugs.gnu.org; Mon, 12 Feb 2024 08:51:06 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZWhn-0005JV-DX; Mon, 12 Feb 2024 08:50:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NHr/+aNQoJLGzahZFn9XpdiJJKRQc0aqat8EM9HPDqE=; b=HulZdCSvi1Qj FeYXZJCMcxURSsis4GW6JopJRId3SSLHGmLxu6CJzmHNUGv7CK/U9go6qeSGRGG6zYx1JPPTOuTy+ /gAzDr3TzEOAJM5kKxEyYfyGpjGhIQ90H0+/khzZ8ZbiXRQ07v+tM9NgViSMhEGTXeZC2MualB2zU L8Ydn0vZYViYXv3uxqpji03fmWQcNPwGAE8vX/N4pyAKhFCovh8vWYz2DNqhoBUaTsNl5APGWHyNx s5sauuPCf/W92WSv3FEvzJfNcG9jitILdPu4JRduKuGUr2eFvqywF+iqSyWT0G1vy2IDxcFYlRvkf wylDs6kSoCIkn4w6xPBTCA==; Date: Mon, 12 Feb 2024 15:50:40 +0200 Message-Id: <865xytssen.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87bk8m1mq8.fsf@yahoo.com> (message from Po Lu on Mon, 12 Feb 2024 09:43:11 +0800) References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: 62994@debbugs.gnu.org, Eli Zaretskii > Date: Mon, 12 Feb 2024 09:43:11 +0800 > > > +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 or a color other than the foreground-color. > > +The available underline styles for TTY frames are 'double', 'wave', > > +'dotted', and 'dashed'. These are currently supported by Kitty, > > +libvte, and st (through the undercurl patch) among other terminals. > > What about GUI frames? I don't want to see a display feature installed > before it is also implemented for the likes of X. Unless you are saying that implementing this on X would be impossible or very hard, I don't think we need to delay installing this feature until it is also available on X. Of course, if Mohsin can also provide an X-based implementation, that would be super. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Feb 2024 15:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: mohkale@kisara.moe, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.170775121010090 (code B ref 62994); Mon, 12 Feb 2024 15:21:02 +0000 Received: (at 62994) by debbugs.gnu.org; 12 Feb 2024 15:20:10 +0000 Received: from localhost ([127.0.0.1]:36499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZY6L-0002ce-Ic for submit@debbugs.gnu.org; Mon, 12 Feb 2024 10:20:09 -0500 Received: from sonic316-20.consmr.mail.ne1.yahoo.com ([66.163.187.146]:43392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZY6I-0002bb-LA for 62994@debbugs.gnu.org; Mon, 12 Feb 2024 10:20:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1707751183; bh=IztugPn46oEnrKzIkrkBgQI69D7+ZPtIFwvniy++bo0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=aOekMa1BV4aqjIk3H/5oEacwxULNB4GJIf1M3NIsY/3XZfi6HlzAH286jbSOD/aKjMiGAiAdQzmA+TggqRdUZQBiAWipDlRksjGotK/YW6oo+zIZmuN76uPltMwPn9WfApKqqnHrK7miSen5GQV6DgG8O5PxJmGuRWQ1AfygOuQ8Oll2kyq49Y5IEzQiDhEr6A1EW92lWZbBO8xv2m1yhyAAtikzWndP23wlT9+UNQLXQtqfTtaDqp1ip//jDKqNhCH3zsuvTTg5sNcIT34Ss7iNRiHyvPPvMdiHpQos6h/Z1w637mSMUak/BiVvYgQlP5k674ATVkcyXOJ6k6k2XQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1707751183; bh=fUWqRpoK3dw5ikQeR/DgwrpPR2fjzsiQ5RtJj9pXeeC=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=g2TG8TeNxeoQxK1M/RoeLZQs0Nn75xgoKpBnEN6bowzWcchNhbSStM1i/RjrrQdtfkyCaa1Bdmn99AQfKvG3tXPPNcm8TUm+LXxXnQo81YFsenjFmXvxqSfNrtr7MBlL11TT6EiNWge3gYgeUk69QXXNk4uZ34vzjuunOAwUG47S1IAYW19D5HKjNukPGjZrLuOwp8kB0zBPsGFaFYWQ6ckzJrZhIopBOEJmRY/n6pgJGRM+1stuhUzMhhBBTitgGqIAGBXfRCyxinajFyYG2gAuVRaRWtHwq5A2hqHMKlonq9eT+g2xG3kCXKjOazJu7kH/cHfBPI6l/jaEAlWmGQ== X-YMail-OSG: drUY8BwVM1nqEapyppW3tHh14ZWWeGayQDRLLgSdAUhtpIzAhe1bPIvri_wspwt 77N.NXjaSvyxbsQeXgeGCXYf8Qx_lBoVOJy1wZmcmiJo.7.KJAdLc4zHRbqWwyKdWovhUreq3zos xlSbolq1Gumbv_8hYMqVmLhJCBkgYOkOtqfXLVLBwt5UNbDorXmdH.b5YPg.4RonFtC2td9QPHqE 4RZJG2z1VRCI1Nhr13XfWhnnuLgUgxK9OKqxT7ljZoRThJoX8RJABqVsbhCqCV84_Cgx5Pj97Ijm qE5_aJnW3XOLSuAf4wmxXQ7llpHV4KMAr4faIHp_8xszlVmsMZ8h.JpGzw6VWWZ64A8YWVTt3Qfm yKtQBTQIBH3WYlQVMVbfKPlHcdh5pnvvmDOAdhpeb8bjx4woFOSaZVQ.7SBELY5eoBa06YcJQ9PT Q2X1mvUC4iyefsA27uaGcOzg7MeuvLXaDk2wtWkYmMSw5ipVm381qF274KPuyapN8hMB7wP5B.8A YcR3hv.zOiNvVJVbptgJqX.kWx7mzb5Ps.579dNNT.3Kl.oUeTiVfel2jC6T0KIB6_uzzCHFuoDm Z3kcebN3K5TP25ElLIq5Pq_xIGQ5VeTRns.yO48uFlnD2Uc5lTQKR.5uLmzaQNNY7RfZzrfsqhiz 3nQKqxIu1r0o7rR0S2zg7hrzG5fxK3N3AeU.HIogdffjQLKZYnC6FRRKJD7u4s1pMMzdigxqIEQG aW9eUV44q74z_HkledL3kTY9SL6vjw2Y8c_s6p85lWjGEEAGMLIsZjTkrYeFWgZgqBqazAuoAXD7 lM.ia6_X8FziV9m5jQy4uQaI9Mx4eY8wUs86uuYRv1ETcSEsMPZ9jADiwNoDCdFyfKovbCFWve9F VRWXA81j_BGvCh66ff7Q7t.jETKiXiLf7ga2pWuSTH9JMnOPO7KZ8TDvQjg0tjAlj4g2Wo3s6sT0 vt7841BwynPWpg9EqxWJt8mKMVhveO4.bwqVHVItdix16CkawPOltCs6oeoIw7UV1l50yXzZmKY. 9OR_tGJconoXu7uBnQs4P4Fd1FtQoFIwcbf38kl_ems.tGY.HAOFROkalVAbp4hRnx7F7YdjsObb gNKAbqM8r5MjJwe2Lcg6az8Uax2lBhct239VMwsKd.FNrRI7.PeIKPZwoeNQxHNlA1lwEV8KC9L2 3ivTX24_cz0jXY99TN1O83GQHp0IpzQ276B7dGL8Sk5sTcswitI5TFIs.HmVaG_d7AZmo6eZoAMF 7GPgJPygbjKBN7J4CjdFLfmqBe3NLGSMia7T1pjQHTTs.mSebNCWxD9b73oaNOv_rsSAHjgi9SEn wsNPFFsu9OuBEEjrbTQfCBrt2g95A7tPNPUBpuP9mJBR1xQYN6c8JJCpZvYcxjjAdqKiPfPOXz4_ B1JSWBXOKhxLCr47eKjeEj81VJOHgag9UCF.NrwiKbXixW_VXIQoP_sPhZMUvtAq1zU7tYFPxbFq YxsmJqGwfAZ2Agyn8AYTZxCHHBWAKoQIUh20DYJE.5vzuE10am4PVNU5QBmgT55ZZcLi2syWQ.9_ BRAakAnTG3025rGZlcSVAaS8EO7x1etUDRIRiD.EID_QhRMYHsMkYkRGNjq0Ti.XirZTyABIHJk1 V8wUSsd1xhfCtd4dgUqZzL_vKKQC4J7dwR3shIYsuaMxwK.O0qZ75ue1OWTmQfZ8rKS55nF49MYQ YcW1YE0DLsN.L2KDdRFcn19SPxCI1ApEp8swJhDXQ6LmhRjMJtIlC7hZdupEfDkgY4xvRR30KP6S jBhJlsfxQK8cl_sxxqf.TLNdas5ZaQZEkcqnOXsPV1TrFcSiW3aLaurEPCmFrtuH4JuUD2i5wjCW tqXxBQ8onfDL1F30qunfxnALmMguTgptmEpg8B4YuqHZ1b4HF2c0AJ3rBmIaONiv8sWT1oA0uY.v D39LiKeO2QQ6W9QHFfpaJTEs.uO1LeAMRz5VfgUgWXgpZVzXpRpCj9jtn0AaJ2s16N0CzErkt_Qf aVQY04sFoV_BFDl433JYFCEnlRWxLO9DRfOgP2NNvH5EZVOvhVeRg1uxBszdLO5LoVHD2mfjTB3_ lfms2qTxxKdQVuCRXHonbF79MAj8xpZ8KXE3aO7BE2rUgbasQdPwiaXMypUKDm9uy7TgdOh1P_bG y4z5.PtoKseWabpfobk3wqS5_FU9qxtnJeAB0b_g6Xaa2uabGb__Mk4DdA87FkkLqHgppq2L2O_y povjRLzKnKU4g.hyg6O0RD3xNfhvSR4HwbR.TmX1tdLad3qfxM9jxezFf_p.qMQxV X-Sonic-MF: X-Sonic-ID: f5f4602a-a80f-4dbf-ab20-dbd668555c28 Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Mon, 12 Feb 2024 15:19:43 +0000 Received: by hermes--production-sg3-6dc75bc8fb-8hvwv (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f3cb1eb3ddff85524c44cc695335f9e5; Mon, 12 Feb 2024 14:49:35 +0000 (UTC) From: Po Lu In-Reply-To: <865xytssen.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Feb 2024 15:50:40 +0200") References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> <865xytssen.fsf@gnu.org> Date: Mon, 12 Feb 2024 22:49:28 +0800 Message-ID: <871q9h20w7.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.22077 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 165 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > Of course, if Mohsin can also provide an X-based implementation, that > would be super. This was my question, yes. Thanks. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Feb 2024 19:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mohkale@kisara.moe, 62994@debbugs.gnu.org, Eli Zaretskii Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17079397235554 (code B ref 62994); Wed, 14 Feb 2024 19:43:02 +0000 Received: (at 62994) by debbugs.gnu.org; 14 Feb 2024 19:42:03 +0000 Received: from localhost ([127.0.0.1]:53147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raL8t-0001RU-D1 for submit@debbugs.gnu.org; Wed, 14 Feb 2024 14:42:03 -0500 Received: from mail-pj1-f44.google.com ([209.85.216.44]:52370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raL8q-0001Qz-DQ for 62994@debbugs.gnu.org; Wed, 14 Feb 2024 14:42:01 -0500 Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-29041136f73so152641a91.0 for <62994@debbugs.gnu.org>; Wed, 14 Feb 2024 11:41:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707939636; x=1708544436; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=JjEIxjTgJkhYMeO88fFOf9IuIkGs4pKcK+4u4UTXzaI=; b=W6Z+S2DRLHRubvF0dnUVJljxWVGS3lIOMKbuu2cYc+u2AneaLOQ954f6wLjJzySSiN RfMLtmeYNF9QJ5bUV2i4MW69LYyc53jahWI87HDHjR4NL0aAPsz7cq0mkzUBq5O5wrrL vE3iYjp+P21D30RUNIn0E/66cj+kQtbp4rtXvPbW/GJ1+AOJ2l896uNqnuoq5v6680TD ZvMTSMKLnSLSfzaped5LUml+p8yVOowCd6BWDf+GX6LHuD4UMsF+bMRCNXsa9iGGfEcC zlokAcx3LtnQyLEZ1ZrEkr3PQ1WTwCI/bQ+ycvkd7lIWnK1FRPlxKF/+gLvFh4FO1IPL keMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707939636; x=1708544436; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JjEIxjTgJkhYMeO88fFOf9IuIkGs4pKcK+4u4UTXzaI=; b=QuI4CT8E6zLNujYWu1DgGjcUXNqr4vRKq3hJKuidAUGt9rAwVIF31PyeL1WtuILd90 JJajy73DWgmnEaYjdyt+lt6GAKxs30EE07pigQPOCczdZhrCbHNI5UZ2cJFVu8Ce1gNz RpfcCPdfF+WcOZXkt1HSF4WQVD40bykl7dvk2KOde1Tsw1xKtIb95Ei7R34pcgrhqebE aqLjitrz3BgbOIk1bwhDli2NyPp5CTWkkMRBL4YvHjAXV49E0NILtpb5Rosb8E4Z7qlI bZzT7u+t9ACKe1zHWI9EsKyfW6hrRvW4SOcvsoPQF1ymJZYDMI/MEPS9JVKEdAkqtlN9 4b6g== X-Forwarded-Encrypted: i=1; AJvYcCXT0u1jhdrVMKNbX3IjTMj5KJaeXQay2jRbo0Wmqd6ukvhGb6tZWyB4N3QFhOd7YB0J5WYPspyB+1eb0vuiPMrP/SZY234= X-Gm-Message-State: AOJu0YwbJg/oLBkukCmS/QMF79ENY2HX1Lq9m3FWSeg8nV0+5NU73aDG 1vjT/ju5WYS+MX4XjWqttJoExnE76hnPjI1W32+NawRf0BwSQ+dY X-Google-Smtp-Source: AGHT+IFU1IQ6jZdGyFtOap8xCjsgnp77X/tUMjVLGP8xt5QV3f/Q+Ez0CNHUSsb46hd+LM2CiY0xgA== X-Received: by 2002:a17:90a:ac0a:b0:298:d21a:976c with SMTP id o10-20020a17090aac0a00b00298d21a976cmr2629780pjq.17.1707939636156; Wed, 14 Feb 2024 11:40:36 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXSEmPj1Xk3QxsXUHqsYT7Da8QYtedRTMXj/1dBK3NkmM+D/R8cm6WpmtSA9TeoHNxsEKcUL2DMwv8gWBeZSASFNHedzJ1szrmypFzDYC7ol2/ddQ== Received: from [192.168.1.2] (076-168-148-233.res.spectrum.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id hi20-20020a17090b30d400b00298ca46547fsm1821058pjb.36.2024.02.14.11.40.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Feb 2024 11:40:35 -0800 (PST) Message-ID: <749abb29-48ab-0d72-3031-3b87fe1fce54@gmail.com> Date: Wed, 14 Feb 2024 11:40:34 -0800 MIME-Version: 1.0 Content-Language: en-US References: <20240211180501.695192-1-mohkale@kisara.moe> From: Jim Porter In-Reply-To: <20240211180501.695192-1-mohkale@kisara.moe> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) On 2/11/2024 10:05 AM, mohkale@kisara.moe wrote: > @@ -7229,6 +7343,9 @@ syms_of_xfaces (void) > DEFSYM (QCposition, ":position"); > DEFSYM (Qline, "line"); > DEFSYM (Qwave, "wave"); > + DEFSYM (Qdouble, "double"); > + DEFSYM (Qdotted, "dotted"); > + DEFSYM (Qdashed, "dashed"); > DEFSYM (Qreleased_button, "released-button"); > DEFSYM (Qpressed_button, "pressed-button"); > DEFSYM (Qflat_button, "flat-button"); This is very minor, but for consistency with the existing styles ("line" and "wave"), maybe we should use a noun form for the new styles. For example "dots", "dashes", and maybe "double-line"? That would hopefully be easier for programmers to remember, and leaves the door open for some other kind of doubled underline in the future too (e.g. a double wave). From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 17:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Po Lu Cc: Eli Zaretskii , 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171009096329392 (code B ref 62994); Sun, 10 Mar 2024 17:17:01 +0000 Received: (at 62994) by debbugs.gnu.org; 10 Mar 2024 17:16:03 +0000 Received: from localhost ([127.0.0.1]:37789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjMmJ-0007e0-7X for submit@debbugs.gnu.org; Sun, 10 Mar 2024 13:16:03 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:60014 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjMmH-0007dX-8r for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 13:16:01 -0400 Received: from mk-desktop (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 93350A2796; Sun, 10 Mar 2024 18:15:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1710090926; bh=B+jVQkQjNrgHA6Jf+dFFZAotfVcE5pCJJVzmmwVPGU8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=1lUUYr9aa5V5Bl0gdsUvsbw2RtvOMXt6L+39PZ/3Ca1aik2iROCPj5nh++LU5bN5i jSpWDzGbPLtoa4Fn4niAvaY32XXUpxs8QbMxKrFqkT/JllzMTzIDKaGvgJUKsojSG7 rw5VOQmrFPaMIbAO57DSsSFOl8i+7B0vdWRl+WWSSaIjjJMaL14uepfGP3HcM7J+T3 G3y/gUuTOba/EutTMEgMnE5jW5mYTOBiG/UI2287WaJQnbg49HF/7JwQr4QBE9ISkG uggu5OYE2MtMLZOskE5EqmNgrh180XX5cha0kKIFcx41pfPhBobTmv5xhttfa6eBfb axp4kphVoCd5Q== From: Mohsin Kaleem In-Reply-To: <87bk8m1mq8.fsf@yahoo.com> References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> Date: Sun, 10 Mar 2024 17:15:25 +0000 Message-ID: <87wmqaf1oy.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Po Lu writes: > mohkale@kisara.moe writes: > >> ++++ > > Where's the documentation for this change? Referring to the pluses themselves? Or I might be misunderstanding? I was trying to match the format of other records in this file. Many headings seemed to be followed by a mix of +++ or --- so I thought it was required? If not I'll just remove it. > We prefer to punctuate sentences within NEWS headings. Added trailing period. > What about GUI frames? I don't want to see a display feature installed > before it is also implemented for the likes of X. Is this absolutely necessary? I had thought if the framework for supporting this was in place then someone could contribute it down the line but didn't want to prevent a possible terminal feature based on GUI support (and vice versa). Currently if one tries to set a unsupported underline style on GUI frames they'll be met with a single underline as if they didn't specify a style at all. This is the same behaviour we'd get if a you tried setting a face attribute on terminal frames that's only supported by GUI frames. > #define TTY_CAP_UNDERLINE_STYLED (0x32 & TTY_CAP_UNDERLINE) Nice catch. Fixed. > In Emacs, we format code with a mixture of tabs and spaces, using tabs > to indent by whole tab stops and spaces to indent to the desired column, > which is a multiple of 2 columns for most statements or the column after > the opening paren where applicable. Please also insert a space between > function identifiers and argument lists, and confine all text to 80 > columns. > > Here you have evidently typed `M-x tabify' with a comment selected. Do > not insert tabs by whatever means within the body of a comment, although > it is best to indent the body itself with them, whenever possible. > > More indentation problems. I had thought `M-x tabify` was supposed to normalize this to the Emacs code standards. Should I manually reindent this to match or is there another function that can do this for me? Sorry if this is unusual, I'm accustomed to formatting and linting tools that do this in bulk for me :-). > Please don't link to Github, and explain > instead the reasoning behind the sequence itself. > Please also avoid inserting redundant braces in if statements. Fixed and I've looked through a few other places where braces could be remvoed. -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 17:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Po Lu , Eli Zaretskii Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171009127129919 (code B ref 62994); Sun, 10 Mar 2024 17:22:02 +0000 Received: (at 62994) by debbugs.gnu.org; 10 Mar 2024 17:21:11 +0000 Received: from localhost ([127.0.0.1]:37798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjMrH-0007mU-Hw for submit@debbugs.gnu.org; Sun, 10 Mar 2024 13:21:11 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:37378 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjMrE-0007mH-Vl for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 13:21:09 -0400 Received: from mk-desktop (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 020D6A2796; Sun, 10 Mar 2024 18:20:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1710091235; bh=xNViJb1btMUCmbxAL9LJTTRxkDNirO89Yl8cHxNT/6Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=GDp3hE+byEgDHWU6UD2MqrqB4bpnXN20B/PxwObaKu6XyCdIiKjYAtAl4KDu9Z2W3 zX3QThIH3asF3N/u+LbTY3QFe5fflj1kitEdKIhpvCQ6sTz3Wpsf4uPi9NuyP/HiNo 2xugidsazCp3bT4nhICw0eP1I4bPJXfcWIU4RLFODvFABx2q79vE4OTS6d3cK3I13z AuVYnCHRITG7RpDliaQSGsubXMM3wffyBecbhf0TqaCG90aZgdpkVh9B/6shGAXzw5 zZ30BIQj1XteBEY2z0HpOgx6zAmzzEAJ1tUkiYbdvnQw1K4tsx6t1f7f/D6+zQOQ1L apnlW5XJFFRQg== From: Mohsin Kaleem In-Reply-To: <871q9h20w7.fsf@yahoo.com> References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> <865xytssen.fsf@gnu.org> <871q9h20w7.fsf@yahoo.com> Date: Sun, 10 Mar 2024 17:20:34 +0000 Message-ID: <87sf0yf1gd.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Po Lu writes: >> Of course, if Mohsin can also provide an X-based implementation, that >> would be super. > > This was my question, yes. Thanks. Ah, my bad, I responded to this in the root email. I don't really have much interest in adding this to GUI frames. If preferred I can remove the extra underline support from this patch set (my primary goal was really just colored underlines). -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 17:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: luangruo@yahoo.com, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171009274732352 (code B ref 62994); Sun, 10 Mar 2024 17:46:01 +0000 Received: (at 62994) by debbugs.gnu.org; 10 Mar 2024 17:45:47 +0000 Received: from localhost ([127.0.0.1]:37833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjNF5-0008Pk-1j for submit@debbugs.gnu.org; Sun, 10 Mar 2024 13:45:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjNF2-0008PN-CM for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 13:45:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjNEP-00048u-7O; Sun, 10 Mar 2024 13:45:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wOivX5U7c9FsRTZ843GW+lR3/D1oH62hk+P8XpLjmZM=; b=L2sW5fV4blCk 9GPsKi3ZdIv+weTm4dhLLzme0AVohOxQwVNd5zB20RTwHZE8Zd99MdU+sRhBY8uKWxIbCo8kNgdEe F3qlMpHhJWT7W02sKBfzGPnIqJ/bsKpnkbBtPKVrPCi4w0HT9RaSB2sazLIZVwWKwNt5IDfkIcOxD ocd9MwNFepEtvE2uZIQriraCKNSNVcH5kuX9xe1L4HOSADfL5E/T7js4otE5h8j4VoyxPmrcQM/me Wr6G6KBC2oLR7yPxF7agxSmTfR9s9yBePYGu/FIZxXVmIuHmB+WrQVWzZlAuD54+WkOeL98UEsfxg vOUb/Ehrzrk2tn2AuqNK5g==; Date: Sun, 10 Mar 2024 19:45:01 +0200 Message-Id: <86v85uugki.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87wmqaf1oy.fsf@kisara.moe> (message from Mohsin Kaleem on Sun, 10 Mar 2024 17:15:25 +0000) References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> <87wmqaf1oy.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Cc: 62994@debbugs.gnu.org, Eli Zaretskii > Date: Sun, 10 Mar 2024 17:15:25 +0000 > > Po Lu writes: > > > mohkale@kisara.moe writes: > > > >> ++++ > > > > Where's the documentation for this change? > > Referring to the pluses themselves? Or I might be misunderstanding? I > was trying to match the format of other records in this file. Many > headings seemed to be followed by a mix of +++ or --- so I thought it > was required? If not I'll just remove it. The "+++" thingy means the manuals were updated for this change, which is why Po Lu asked where are those updates. > > We prefer to punctuate sentences within NEWS headings. > > Added trailing period. > > > What about GUI frames? I don't want to see a display feature installed > > before it is also implemented for the likes of X. > > Is this absolutely necessary? Not absolutely necessary, but very much preferred. It is unheard of in Emacs to have some face attribute that is supported on TTY frames but not on GUI frames. > > Here you have evidently typed `M-x tabify' with a comment selected. Do > > not insert tabs by whatever means within the body of a comment, although > > it is best to indent the body itself with them, whenever possible. > > > > More indentation problems. > > I had thought `M-x tabify` was supposed to normalize this to the Emacs > code standards. No, you should mark the region and then press C-M-\. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 18:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17100941402470 (code B ref 62994); Sun, 10 Mar 2024 18:09:01 +0000 Received: (at 62994) by debbugs.gnu.org; 10 Mar 2024 18:09:00 +0000 Received: from localhost ([127.0.0.1]:37858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjNbU-0000dj-VK for submit@debbugs.gnu.org; Sun, 10 Mar 2024 14:09:00 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:56272 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjNbS-0000dZ-Ts for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 14:08:55 -0400 Received: from mk-desktop (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 5627DA2796; Sun, 10 Mar 2024 19:08:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1710094100; bh=H5gky1lhdYPp3GGbkxvrIoYf5ufQHSJs2WfsZRAMZt8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=0IOkkiZCNHIqFNFru2LO/JZxewWC2nGGp/kHxA8+t0LWl9KyJZEwsRrxgDWn8xJz/ eDfoI/7HaIhpnY+NFKPaXaG4n3JP7UQtYyamRddnu6omRCl4oAXwwwpCKk6qac42Bf eqJkxT6s2DIrgRNAmh9wsjCic6nwNauoKeW6KHNHh5X+vK90tMt2P3pj8ewyuGd4XS zwot6UxtdVTx6ttGfep/HNpsPS4oxLQlkTX3ZLa/LhOqk1HVs8y3m/P8LQud8tLLEf beO2Rno3CzxRLeyhUsC68FMayRzKIsI+QJQJWDTat1sC7rsQ3CJUDOq8uGDXPkpySl Qwu5sKL8KTXiA== From: Mohsin Kaleem In-Reply-To: <86a5o5sv9q.fsf@gnu.org> References: <20240211180501.695192-1-mohkale@kisara.moe> <86a5o5sv9q.fsf@gnu.org> Date: Sun, 10 Mar 2024 18:08:19 +0000 Message-ID: <87o7bmez8s.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Eli Zaretskii writes: > Thanks. I think in addition to NEWS, we'd need to update the ELisp > Reference manual, because the new underline styles are not currently > mentioned there. Added. Should I mention display support between GUI and TTY frames or is it sufficient just to mention these are the options? > Here and elsewhere in the patch, you use indentation style slightly > different from ours, so please reindent to follow our style (which > uses TABs and SPACEs, not just TABs). I did just run M-x tabify over all the lines I changed but looks like that was a mistake. I've tried just manually re-adjusting all the changesets in the next patchset but still not fully clear if it adheres to the conventions wanted here =F0=9F=98=85. >> + p =3D tparam(tty->TF_set_underline_style, NULL, 0, face->underline, 0= , 0, 0); > ^^ > Our style is to leave a single SPACE between the name of a function > and the opening parenthesis. Several places in the patch don't leave > that SPACE. Did a quick grep for `[^ ](` and fixed all offending lines. > >> + /* Styled underlines. Support for this is provided either by the > ^^^^^^^ > Please don't use TABs inside comments, except as indentation. Seems to have been a byproduct of `M-x tabify`. Apologies. >> + return false; /* Unsupported underline style */ > ^ > Period and one more SPACE are missing there. Added. > >> + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) >> + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble) >> + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) >> + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdotted) >> + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashed))) >> + { >> + return false; /* Face uses an unsupported underline style. */ >> + } > > Our style is not to use braces for single-statement blocks. Removed. > >> +/* Map the specified color COLOR of face FACE on frame F to a tty >> + color index. IDX is one of LFACE_FOREGROUND_INDEX, >> + LFACE_BACKGROUND_INDEX or LFACE_UNDERLINE_INDEX, and specifies >> + which color to map. Set *DEFAULTED to true if mapping to the >> + default foreground/background colors. */ > ^^ > One more SPACE there. Added. > >> - if (foreground_p) >> - face->foreground =3D pixel; >> - else >> - face->background =3D pixel; >> + switch (idx) >> + { >> + case LFACE_FOREGROUND_INDEX: >> + face->foreground =3D pixel; >> + break; >> + case LFACE_BACKGROUND_INDEX: >> + face->background =3D pixel; >> + break; >> + case LFACE_UNDERLINE_INDEX: >> + face->underline_color =3D pixel; >> + break; >> + default: >> + emacs_abort (); > > The original code didn't call emacs_abort, but instead simply used > PIXEL as the background color. Why would we do something different > now? Earlier in the function we call eassert on the index parameter. I might've misunderstood but I thought that check would terminate the function at that point so this line where we handle a index value outside the supported range should never be called. If preferred I can fallthrough into the background statement to stay consistent? > >> +static void >> +map_tty_color2 (struct frame *f, struct face *face, Lisp_Object color, >> + enum lface_attribute_index idx) >> +{ >> + bool face_colors_defaulted =3D false; >> + map_tty_color (f, face, color, idx, &face_colors_defaulted); >> } > > Is this function really justified? why not call map_tty_color? The extra parameter face_colors_defaulted doesn't really make sense for anything but foreground/background color calls. Using the existing one would make the callsite for the underline color set more noisy with an extra output param that we then just ignore. I thought this was a slightly nicer solution from the caller side. If preferred I can remove and go the alternate route? --=20 Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 18:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter , 62994@debbugs.gnu.org, Eli Zaretskii Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17100942542667 (code B ref 62994); Sun, 10 Mar 2024 18:11:02 +0000 Received: (at 62994) by debbugs.gnu.org; 10 Mar 2024 18:10:54 +0000 Received: from localhost ([127.0.0.1]:37862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjNdN-0000gt-Mh for submit@debbugs.gnu.org; Sun, 10 Mar 2024 14:10:54 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:52196 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjNdH-0000ge-RS for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 14:10:52 -0400 Received: from mk-desktop (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id D3143A2796; Sun, 10 Mar 2024 19:10:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1710094213; bh=noCpsFik1fp9NtYc//hjlz/6h+9G8bIhiWh+7oaui8w=; h=From:To:Subject:In-Reply-To:References:Date:From; b=liuoVYhVF+TlHVwWJbt1c4SUvGTG1CNHeV6NEethQMvg/+RDFQUpBQWQ5iZucz49H 1CAfHk5qDmTVA6PHHJE3QbinBUkJKQQtVQkcSlP/9todPw5eRjqIzQ5ge913lZ+2kz +1ymMovH8CuNkaMbaDpPby7xO/q7lVvmHWjZvYlZp2ovy8b6jCtHLFtUjl+bIYNWD7 PZ6Qp1Ot5rJQpgvbA+NtFMc3CPDoA63wyqSfDHXCTGW+HjjvuT01SrlaxBJMvHuKcW h9VxpzRYqXHy81yEFxnR8Tj7BmJRUOyeZB4Ojp+BOh55HLzzY07XHzPU0XJUzhokAO h1vJiFUpZIuQg== From: Mohsin Kaleem In-Reply-To: <749abb29-48ab-0d72-3031-3b87fe1fce54@gmail.com> References: <20240211180501.695192-1-mohkale@kisara.moe> <749abb29-48ab-0d72-3031-3b87fe1fce54@gmail.com> Date: Sun, 10 Mar 2024 18:10:13 +0000 Message-ID: <87le6qez5m.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Jim Porter writes: > On 2/11/2024 10:05 AM, mohkale@kisara.moe wrote: >> @@ -7229,6 +7343,9 @@ syms_of_xfaces (void) >> DEFSYM (QCposition, ":position"); >> DEFSYM (Qline, "line"); >> DEFSYM (Qwave, "wave"); >> + DEFSYM (Qdouble, "double"); >> + DEFSYM (Qdotted, "dotted"); >> + DEFSYM (Qdashed, "dashed"); >> DEFSYM (Qreleased_button, "released-button"); >> DEFSYM (Qpressed_button, "pressed-button"); >> DEFSYM (Qflat_button, "flat-button"); > > This is very minor, but for consistency with the existing styles ("line" > and "wave"), maybe we should use a noun form for the new styles. For > example "dots", "dashes", and maybe "double-line"? That would hopefully > be easier for programmers to remember, and leaves the door open for some > other kind of doubled underline in the future too (e.g. a double wave). The current names were just what kitty decided to call the related underline styles [1] but no reason to stick to that. I'll update as suggested. Just to clarify wave will stay wave (instead of wavy) but the remaining will be converted to nouns. [1]: https://sw.kovidgoyal.net/kitty/underlines/ -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 18:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: luangruo@yahoo.com, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17100950003784 (code B ref 62994); Sun, 10 Mar 2024 18:24:02 +0000 Received: (at 62994) by debbugs.gnu.org; 10 Mar 2024 18:23:20 +0000 Received: from localhost ([127.0.0.1]:37866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjNpQ-0000yy-6B for submit@debbugs.gnu.org; Sun, 10 Mar 2024 14:23:20 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:50140 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjNpN-0000yp-IG for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 14:23:18 -0400 Received: from mk-desktop (05408574.skybroadband.com [5.64.133.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id D7256A2796; Sun, 10 Mar 2024 19:22:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1710094962; bh=EzzmuRTeoDXVMzgHQhfhod/gAc6KNLU4j3elBIq0xLI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=bfRZm+9Mp1xoPlo8SJg4nnRzc1rpL84KA9h363xaVF0FORfM3/gnQ14KBcAjj/9wX tN8FQ7RQ+hovB0V9tBP9JBrcTfyqLQOQJWEfDDT26iSZoXPks8SzAYWx8RB4ocP1VH A59bohhtXtMR/TygTHmPB2g6vZ80qU855ckZYANKaWq3zClsgTI4BLy4lT+DYYQ55w YtzM3JIz9SGLDvY+BrsQLuJof6mWsqMRvxaNXKxGO/XBNaCLkSd+MbP6rkb7VT/c+B 8tz+2ks+DgDyNjS3gMFZjIMPdXiChE7SGpDFkra0oS5qaxtJp3M6+PgLql22bBRab0 5Fd9DdvR6wg8w== From: Mohsin Kaleem In-Reply-To: <86v85uugki.fsf@gnu.org> References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> <87wmqaf1oy.fsf@kisara.moe> <86v85uugki.fsf@gnu.org> Date: Sun, 10 Mar 2024 18:22:39 +0000 Message-ID: <87msr6vte8.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Eli Zaretskii writes: > The "+++" thingy means the manuals were updated for this change, which > is why Po Lu asked where are those updates. I see, does --- have a similar alternate meaning or can I just replace the pluses with minuses? >> Is this absolutely necessary? > > Not absolutely necessary, but very much preferred. It is unheard of > in Emacs to have some face attribute that is supported on TTY frames > but not on GUI frames. I see. If a blocker I'm happy to remove the extra underline styles? I'm not sure how long it would take me to add GUI support and as I don't use the GUI I'd be unlikely to prioritise it any time soon. > No, you should mark the region and then press C-M-\. I see. So I should run this over all the lines I've changed to normalize them? -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 18:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem , Eli Zaretskii Cc: luangruo@yahoo.com, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17100968156485 (code B ref 62994); Sun, 10 Mar 2024 18:54:01 +0000 Received: (at 62994) by debbugs.gnu.org; 10 Mar 2024 18:53:35 +0000 Received: from localhost ([127.0.0.1]:37887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjOIg-0001gX-UG for submit@debbugs.gnu.org; Sun, 10 Mar 2024 14:53:35 -0400 Received: from mail-pf1-f181.google.com ([209.85.210.181]:54628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjOIe-0001gJ-SW for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 14:53:33 -0400 Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6e64647af39so3589697b3a.1 for <62994@debbugs.gnu.org>; Sun, 10 Mar 2024 11:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710096713; x=1710701513; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=ryvGHOpKruiVPI5McbXpkFjq5T4HR4CpbQemIFMMRT8=; b=XIyVDQIJY/GoUaceMIdoN6mE9EmY48nmfDYnGBjZK6vDeNe/dv+W4kVkWKuZM/1LvG SitNOHRjtdN6r8iZqjKd2HBaUq3hT4Tv4TrRLzWTA8v7UvMc57PfQNqC/sjwhrbocruY HaolsJWnwhPz1yTiBd59TCjOUnXLDKVJGcBGDn2/A2iaj2oEmhiN76LhwwsHbu8F5Awd nNRi7G8HljSp1EaLmc7y6H1i3uSZBhRK3k+pfUiiIm8jXfAMFLHiIzJQE9cbNG9uTvuU vgwet47UBxKAw4pI9Qcx/tnANSd/iLYVcby7lYUBopCpV7wanly+8KDc3OTqEkujmUgS e9XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710096713; x=1710701513; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ryvGHOpKruiVPI5McbXpkFjq5T4HR4CpbQemIFMMRT8=; b=IxmQ2ld0QKcuYCD71xM6ryDdM6XdpSXTWnLHr91RQLlRmqSM8C0pZWdu9wVFNN4oxB gg4T10rZh5d7fBpeUojo+e7ZL0F+AU6BzZ/L41GDuqY65wsYa5A1m97iyGhToYDDfopq 6/B9Guj+JDKtCsKb6KjK/zCvZpnj66giUFUXABLNb3SJMO65BpehCkmFcsGtO2wdgpaI ua6GWc5rg4LNZ6tNeoBiX+t4s0+dXU5q9/h/CHzXishvhRbNYXxRW2sA7DbosbASVz6j PQpAgXkLjwUjlWZ0MSTC6mwZsZHbyiXXiPTnVFRY1s0TH82qU1OLELjPDQNV10dx9x6p Hz6A== X-Forwarded-Encrypted: i=1; AJvYcCWO8mNaPJpXZpmgrkpYSZ+HnKOFrntgAcOvoma1Cn3MxfPJn92gOm7N2/kVuwh7tDpUXwPvxM1XQ6a/lBDBnNlXTAi5MSo= X-Gm-Message-State: AOJu0YwD6V0YF8Yoy33a8UFJa+oMyMwQATXLyDk238QNf5lonUB/jgFR bRDsEPdRP46M3QhZXbsNmsS9XIQxQQy+yz6qtyg1YpNK2ad4g+K9 X-Google-Smtp-Source: AGHT+IG3eqbYAAo849KT9yF8vjgh1hlkd8RXe0mhXovbdUOU+BK2NzNGYe3ABkl34uNlZG/d+tBZeQ== X-Received: by 2002:a05:6a00:3ccc:b0:6e5:e8ee:3af8 with SMTP id ln12-20020a056a003ccc00b006e5e8ee3af8mr8264883pfb.26.1710096713419; Sun, 10 Mar 2024 11:51:53 -0700 (PDT) Received: from [192.168.1.2] (076-168-148-233.res.spectrum.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id y39-20020a056a00182700b006e3f09fd6a5sm2812582pfa.163.2024.03.10.11.51.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Mar 2024 11:51:52 -0700 (PDT) Message-ID: Date: Sun, 10 Mar 2024 11:51:51 -0700 MIME-Version: 1.0 Content-Language: en-US References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> <87wmqaf1oy.fsf@kisara.moe> <86v85uugki.fsf@gnu.org> <87msr6vte8.fsf@kisara.moe> From: Jim Porter In-Reply-To: <87msr6vte8.fsf@kisara.moe> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 3/10/2024 11:22 AM, Mohsin Kaleem wrote: > Eli Zaretskii writes: > >> The "+++" thingy means the manuals were updated for this change, which >> is why Po Lu asked where are those updates. > > I see, does --- have a similar alternate meaning or can I just replace > the pluses with minuses? "---" means there's no need to update the manuals for that change in NEWS. >> Not absolutely necessary, but very much preferred. It is unheard of >> in Emacs to have some face attribute that is supported on TTY frames >> but not on GUI frames. > > I see. If a blocker I'm happy to remove the extra underline styles? I'm > not sure how long it would take me to add GUI support and as I don't use > the GUI I'd be unlikely to prioritise it any time soon. If someone points me in the right direction, I could take a look (I'd particularly like to use the dotted underlines in GUI frames). It'll probably be a couple weeks at least until I could work on it though. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 19:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: luangruo@yahoo.com, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17100988749586 (code B ref 62994); Sun, 10 Mar 2024 19:28:02 +0000 Received: (at 62994) by debbugs.gnu.org; 10 Mar 2024 19:27:54 +0000 Received: from localhost ([127.0.0.1]:37909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjOpt-0002UY-Vb for submit@debbugs.gnu.org; Sun, 10 Mar 2024 15:27:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjOps-0002UM-6L for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 15:27:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjOpF-0002tf-98; Sun, 10 Mar 2024 15:27:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=DAilOz2fGiPW6FguaEXYaLfdhjZfQEB4i+bbukb093k=; b=HigIViOuFD6F zi273UO4MWAOA72ZwAp3gylHz9E2TG9x9TnBHCe/lAjJjSV8r8TmZR7p8Xwm2oFL/73lv2sQIXxfn HKEdcNP0036Bsg93TQWHAUVwg94epqxzUcX0qhwr7JK5a25Xw243VhjxgUsxEvsKCTC+NgoYj4/hu rNuEosoHgxU78V353gFULSVu4trS4b4wgtyfuTPjz7vK2B2Aat0boVYm/SxMVTWWf2S0caBXGIp2X mUtp6PlfZvyYSSUxZq/QDo1IhuxWnkFtqGUEhlc3XajSk1JUh7eePKIyHhm/l4OE+V28P6hN5T+vu uHe13X1u9kmQ/fSNsdAsUA==; Date: Sun, 10 Mar 2024 21:27:10 +0200 Message-Id: <86plw1vqep.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87msr6vte8.fsf@kisara.moe> (message from Mohsin Kaleem on Sun, 10 Mar 2024 18:22:39 +0000) References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> <87wmqaf1oy.fsf@kisara.moe> <86v85uugki.fsf@gnu.org> <87msr6vte8.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Cc: luangruo@yahoo.com, 62994@debbugs.gnu.org > Date: Sun, 10 Mar 2024 18:22:39 +0000 > > Eli Zaretskii writes: > > > The "+++" thingy means the manuals were updated for this change, which > > is why Po Lu asked where are those updates. > > I see, does --- have a similar alternate meaning or can I just replace > the pluses with minuses? "---" means the change is so minor it will not require any manual changes. When in doubt leave the entry with neither "+++" nor "---". > >> Is this absolutely necessary? > > > > Not absolutely necessary, but very much preferred. It is unheard of > > in Emacs to have some face attribute that is supported on TTY frames > > but not on GUI frames. > > I see. If a blocker I'm happy to remove the extra underline styles? I'm > not sure how long it would take me to add GUI support and as I don't use > the GUI I'd be unlikely to prioritise it any time soon. I'm not sure it should be a blocker. > > No, you should mark the region and then press C-M-\. > > I see. So I should run this over all the lines I've changed to normalize > them? Yes. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter Cc: luangruo@yahoo.com, mohkale@kisara.moe, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17100989809751 (code B ref 62994); Sun, 10 Mar 2024 19:30:02 +0000 Received: (at 62994) by debbugs.gnu.org; 10 Mar 2024 19:29:40 +0000 Received: from localhost ([127.0.0.1]:37914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjOrb-0002XD-HM for submit@debbugs.gnu.org; Sun, 10 Mar 2024 15:29:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjOrZ-0002X0-UT for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 15:29:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjOqx-00031t-6Y; Sun, 10 Mar 2024 15:28:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=jM12CljonlXWNOqBjQY5dBEPGS8Ovw2TOdoc8hb1pb8=; b=j0T1flaG9Dne NDjPbNGj1GQjunXwITyEe9OW3B98I7jYyCEneY2Gm93A51j7CTfmR/0eboQ2rKLjPhAcX1PKyjNlg LubRuDpD2MkItJFyW9CK5pcxJAyhY7jS2CWMhSb56vjO3MadU8SAsIjKG/n96oLRX77BDUMIPa18r l4UO9e7vqCUpDVfc2thBA+OkRo6H4wRJwPBn5V2I7xlH0rQIMxa3lQyW98fpBJVdz3vT2r0FoBDUe sYXrsdi8ggvoTDz3RxSf7bc8ez9EnGsAj60EIsaKGF8E21ojSFUhpQFb9XfrUA3ESFiTNzYkSWUDM ZWqjj2NegCy8kYhEmvvIqg==; Date: Sun, 10 Mar 2024 21:28:56 +0200 Message-Id: <86o7blvqbr.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Jim Porter on Sun, 10 Mar 2024 11:51:51 -0700) References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> <87wmqaf1oy.fsf@kisara.moe> <86v85uugki.fsf@gnu.org> <87msr6vte8.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 10 Mar 2024 11:51:51 -0700 > Cc: luangruo@yahoo.com, 62994@debbugs.gnu.org > From: Jim Porter > > On 3/10/2024 11:22 AM, Mohsin Kaleem wrote: > > Eli Zaretskii writes: > > > >> The "+++" thingy means the manuals were updated for this change, which > >> is why Po Lu asked where are those updates. > > > > I see, does --- have a similar alternate meaning or can I just replace > > the pluses with minuses? > > "---" means there's no need to update the manuals for that change in NEWS. > > >> Not absolutely necessary, but very much preferred. It is unheard of > >> in Emacs to have some face attribute that is supported on TTY frames > >> but not on GUI frames. > > > > I see. If a blocker I'm happy to remove the extra underline styles? I'm > > not sure how long it would take me to add GUI support and as I don't use > > the GUI I'd be unlikely to prioritise it any time soon. > > If someone points me in the right direction, I could take a look (I'd > particularly like to use the dotted underlines in GUI frames). It'll > probably be a couple weeks at least until I could work on it though. Thanks. I'm not sure I understand where you want to be directed. Is it to the code which implements underwave on GUI frames? something else? From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 19:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: luangruo@yahoo.com, mohkale@kisara.moe, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171010016611887 (code B ref 62994); Sun, 10 Mar 2024 19:50:01 +0000 Received: (at 62994) by debbugs.gnu.org; 10 Mar 2024 19:49:26 +0000 Received: from localhost ([127.0.0.1]:37926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjPAk-00035d-Bz for submit@debbugs.gnu.org; Sun, 10 Mar 2024 15:49:26 -0400 Received: from mail-oo1-f50.google.com ([209.85.161.50]:57802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjPAi-00034r-Mb for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 15:49:25 -0400 Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-59fdcf8ebbcso2459969eaf.3 for <62994@debbugs.gnu.org>; Sun, 10 Mar 2024 12:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710100065; x=1710704865; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=mc65/eEK7aPF2J1c+bO6OCbERg0JjDWe8qhRZiCvig0=; b=JXSIPh/0uLeR5F1R2EbXiW4Di9rPtQDjmaTopUfy1vSwBxdocSDaA7SN1dNaGFoKHG 0NNrvdQjzhBWKawJlAHFCAG0aJelsQLL70aX391wtacWODmyDk1JFQ64q0rIchPr1Ns1 ObXXR9UjrYprFTXhNgcc9kHX4/qfNqyt/KNodqZYW817ymcHpZ4B96Olmoh6iNiPmL8G g54EvAFVU94v/oDP1Kt0rCcEKbG06fay31JjUi0Fn9Ljl6MnPVIDnmn+J7q6fc4F5fKa /hfgUK5Gz82iwSSz+QgdU+9wOA80DrkLZAmGlDRS7I+HIGCvSIdrbVoGk+ykJKqzvb4W Qynw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710100065; x=1710704865; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mc65/eEK7aPF2J1c+bO6OCbERg0JjDWe8qhRZiCvig0=; b=i/AVwb2BWfAgri+t+222m1BQVbxdAaYjmtT1PcsvXNqortPbNUyNiKefZ5p3MfAebP p9JcIqkXPqeRyf5phOEKkQPSqYazAf1JNmcZM7i4DowhwQkAH9Y7RYN613PF6JisOqPf ZT6hQM+rBdV4O1S96hjx5tRsi5KgZq1NslC3OBGY/CchGFzzOab0CIntvVYUkOqo0NAW DH5LsnjWHS5gQJmLb/wIidXtp2bWk5+ct/DdWuNNxDEUsKJpfA33JZSCfI5tHcTIwVVj JnLVk0W1adE2JP4UaL2qgjmNwln/EZhSw0cjUSME9pOT/o+w3NK1mNMH/jR0JRvQYTBV A77w== X-Forwarded-Encrypted: i=1; AJvYcCWpccwVuzO/cBTUAkzN0AoKzk/EaoEHGez1PdjTFQ1FhHLS2Wx8NRGDiRodpPFm+vooTzJRVxAiMB3BwKLoI4EkVENYapY= X-Gm-Message-State: AOJu0YzhIWW3HcY9fNAMh6rPOn9Gr3WQMNcTJnDgkBotRwS0ioLJWWMD eBrLwyBmMCR9LTE5o/ottZCGpFxyN6TvMZ6WliS3xaf31O7dRAqc X-Google-Smtp-Source: AGHT+IFVMg35Tn65u6jR8Xgs3sFGcxl7imOyWouQD+AYyeudf8HJzd/iWEeJeZbdwCd2wMla2hTr+Q== X-Received: by 2002:a05:6808:118c:b0:3c2:1868:d9cf with SMTP id j12-20020a056808118c00b003c21868d9cfmr6170380oil.16.1710100065496; Sun, 10 Mar 2024 12:47:45 -0700 (PDT) Received: from [192.168.1.2] (076-168-148-233.res.spectrum.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id 23-20020a630e57000000b005ceeeea1816sm395675pgo.77.2024.03.10.12.47.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Mar 2024 12:47:45 -0700 (PDT) Message-ID: <018a23ba-dd11-7792-98ab-f9216d99c605@gmail.com> Date: Sun, 10 Mar 2024 12:47:44 -0700 MIME-Version: 1.0 Content-Language: en-US References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> <87wmqaf1oy.fsf@kisara.moe> <86v85uugki.fsf@gnu.org> <87msr6vte8.fsf@kisara.moe> <86o7blvqbr.fsf@gnu.org> From: Jim Porter In-Reply-To: <86o7blvqbr.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 3/10/2024 12:28 PM, Eli Zaretskii wrote: >> Date: Sun, 10 Mar 2024 11:51:51 -0700 >> Cc: luangruo@yahoo.com, 62994@debbugs.gnu.org >> From: Jim Porter >> >> If someone points me in the right direction, I could take a look (I'd >> particularly like to use the dotted underlines in GUI frames). It'll >> probably be a couple weeks at least until I could work on it though. > > Thanks. I'm not sure I understand where you want to be directed. Is > it to the code which implements underwave on GUI frames? something > else? Yeah, exactly. I could probably find it myself with some searching, but if someone already knows where to start, that would save me some time. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 02:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Jim Porter , 62994@debbugs.gnu.org, mohkale@kisara.moe Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171012292016469 (code B ref 62994); Mon, 11 Mar 2024 02:09:01 +0000 Received: (at 62994) by debbugs.gnu.org; 11 Mar 2024 02:08:40 +0000 Received: from localhost ([127.0.0.1]:38209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjV5k-0004HZ-6b for submit@debbugs.gnu.org; Sun, 10 Mar 2024 22:08:40 -0400 Received: from sonic314-22.consmr.mail.ne1.yahoo.com ([66.163.189.148]:43913) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjV5i-0004HL-Fx for 62994@debbugs.gnu.org; Sun, 10 Mar 2024 22:08:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1710122879; bh=WjzdQmHv0ATr5j/mjvrPrz9qIPiJnmV+tF5WYeyQAsc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=tSvTBRpZRA5ie5r5CSIcHG3bCCSCeY4u0VsbewveUaQu6ZG62g3iyYsWr/MCNPinzNwOZdjuJtBfgUF5xuwU1al5/7NuJcFrz8yiN1BNM1UN+Dh1DesoWYIXfGdm03eKF5DbecBvO8Q1X4rvvANGXlPP1Zpeu3u3DQeYcyRUjOtapU2LByfnMAnQZAPTY3sC4CQVGb6e3BWDQ0NRn/z1pLGrYlhES6IPk+UITtapZTRLN1MBE5OxeYBUnjVxhc9JouY6Ei9LyVoFC72j6SO3wpcMlZF6ToAf87qeNslRpgInf6D1JOR6sebl2zvD69H6ejSf630PDNk4H1+H+YU+zQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1710122879; bh=810ozeJ4J1dlklP0SacpQVHiKpxUlgWd2P4xI3cCZCX=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=nQ/Q4nuXZL1aamlPDiQjUegac8HfZN0H0EWaNPnlnBrL2/QWRHXrUcG9G+7mJ3/ukPCF8IwsdrumjhZLSO6pPyrRXSqKmOS2lcyAmfAskHjZj/dza5BVPGaJWT69ksi++g6sN2c85Md4fAeFWQyJ7UHskXrvpGE9LOY7VJdd2BUaPLkIH36OywW2PDa7jLQUJjdXSgfnbiso1g0HMcJPdi2gExgjM1hTyaCvI1VWvVJeh1QmFk8aROFxj1rj2B3X4MdElTYxGdH6Pwt4aHplS0t/cWNMAaTMcWmRQUwLkWLuTcgj9ZwNJ0blpZcxVDCCj6s6hPNqEQDZ7lPEvVTKYg== X-YMail-OSG: ROfSt4MVM1maULVbUsZRsUue_TA4ZR8XaUROJ4qGQMsEh4U_Gf0lRVq7B3LwGnh 3.cCxkqBmyTqfr0oW44YvK8uBic9Fg9izMrLyImow_R9VvlbnZZwo7mmw2nfLRs0Od40CtrHxdxv zoOswafUQceo0YtEwR0N7G472gEc4ervD_.sa5tB9R0dxMM2kU8sgR0Jdwu1SBGVXhcNlmOWimUX LQCRBCbmztHYs_PmYatxSkM8QiDbHlHRWp0FfX9UMt4pzdntKtoIUdh7Q8foDoOhBTfgKhgZH7Wt sn7SqOxK.RFfzi4gaLM.Rrd1FZJfDEpaQlJCkqrDhB.1AM0oreYWNoHOkH8ejmLEaepZrV.iMeP. q5J8phOo826kgLnvCvxbDdk1WqvmYqwXysXT.avGuwlestUcjpFhqFEmQb6NkDdJfhEhtWRIcAnA i10eCEXXunCDOdl9fPJuo65WKF.sav7zteqjdU15kDS6jsskdWOTQB0IwovHmY5FhtZbtH9XQIjP gikU16JUlycJoNdNWpbaR4ab35IlK2VXxf2WRUpclI_oT9.VWsiG0X1DjIvt46UkY3iEOch233yu c9_nIN7bdxeq_wZX4yYLghZ7KFFKLMDsSA4euYYC1W94ahXL9dVTXXccjNL8sK9w61T5Njftui9I tlkuLtcAWnnNF19UAYhiJCZ8pMm3CIiGyyg_mSXGlFk9yw2kIsH9b7eqLEY4cT6gc8WIV4Wrkgzo a5ROsAtXK4ExDJr.bVXn5IWkwB7PfzScZ0YTcVXT55_PvP2l1nVNW_8pHBA0lb1wmqrIcwq18GTh nCo0H4zrGiR_RYJIcZ_IFmr6pdoDUl1TBNuFTz2aRg6G4WfczwTVGvq1eXcfcnZeEJKV._mcJ7bT 0MYF_e21X3RI8huqaaDohKuz_Cmhb8oMjiFFOlc6CJw._WqZE7jFrSJCyVYW78BEHCRRvb0LXU8C diVBx6sYHn.1ta.6SYQwoBZCIfUbIaqzS8HHwIV3yxoNzicIryHHhUzw4gRCGXPk.UeGvnHHqhrS 57rSZ7KDBahgpUEAPVqAAoikHzAoOpJ8leGwKdXEEhOig6bK3_Snsn66JsBG_hvJaK1y2xlY5qUF okEOcONBKHa5QX6YE.XkXbc1QihZ9pr4quNkKpti5iP_TTmVD_pEatJ2yaU0D1FSR3sjZoAvOvsq XZWGqDAg7rfqVC29Dejoi5guUtXIa61G.PVFWsNXSKCAz531tXGQvZ2ONti8YMupLHO6l8NzDkVY P4aOJYGEVhIqpT8PH98BpxAQfA8P0unZFEg7b8MLVQUF5h9641NA7kUdl6zDkfVPe3tfiqFXneWj d0dFF6xpmV1qJN6mgPyxcimWYX324UUftbgLWAa2Wnhm4Ala5gJu1VQNIIRyrl6FSp4zWEvG2c66 OT8ZBEhhz7vozGVVjfriLf_cDEyMqIYTyW8MYP2M9UggGH9YM8ipXN7dW0uURsEA2KBGj.H325b. NvnRZyN_JlZ4pzaLz78m8VdjJUAySf8izcNKC.3e0tMvD.m2rtc6hteHugy9E.xCcYZ77ip4AaJC 2ypKbdfJXalXWyLIfvUhEK9UTEyMe7vb4Men45dFblioh8M3CtepHddTiGVbOrBp8QBODWi1PH9V KQ1Q0xfmBvGKGFPSwgIgJ8_xRBtE8bJH6FWInbd6CKKOKNxbF2UmIq5B4nYXohedwzS.4lWof0LB _y9I8Pvo5W78WHa4idNYyyURPOl6oRn.934h3PmIQezHG8zqKnQpA6eV5PPVyTYNJbIcvNuzQadK Atk6TGnU7WvKKE8FP2IsAtifxmLiQBtlqhnhbAN6_YSnH9YDfFk4.Aff_Zi57Myl.QxDKTaAronu i2YxDUNouwE1tBOqZsWqSYY2WgRzuoDw8Kt9tfWsYBXNzs3tYkzX7dg4REVx_Om5JpzZjENc1_pq 9R4X5bIGdSnc4OxQyYWIISYT96B4iLL0xprLJ8yQ1xv0h6tpmllzjX4GskkxR8dsy0Zhnft5hyok R7dcSf_I4GH7YzvqWUpbTakj91yzfv8PCVqGzvWuTYYDfzj5MK3GimYQVDgCAZ59rzMSNV7Lk6ys a6VhpjE7MR_94U21jc2i3kxPd8APCNNC4cVejBlR4F6y9A_vzpqKba12VlkmTwx20xNxFv9cuQLJ TxgjYDdUqDFfrNJeLXPI.BRA9qtJ2DpIWpkALImJj_TUSnrtKqJOm07TfoQP.apc1fSzoo44M8X6 QxDVRKhxe0hmBi39_orr3OkGQ5z1hOa6GWG2EzQ4vRVKTfdcha2NBB8UNykrXuDw- X-Sonic-MF: X-Sonic-ID: a4f31717-fb24-4158-8f83-9025448d16a4 Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Mon, 11 Mar 2024 02:07:59 +0000 Received: by hermes--production-sg3-6dc75bc8fb-smdnz (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID aea3dc24d5f1d9806bc74725b88cee6f; Mon, 11 Mar 2024 02:07:53 +0000 (UTC) From: Po Lu In-Reply-To: <86o7blvqbr.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 10 Mar 2024 21:28:56 +0200") References: <20240211180501.695192-1-mohkale@kisara.moe> <87bk8m1mq8.fsf@yahoo.com> <87wmqaf1oy.fsf@kisara.moe> <86v85uugki.fsf@gnu.org> <87msr6vte8.fsf@kisara.moe> <86o7blvqbr.fsf@gnu.org> Date: Mon, 11 Mar 2024 10:07:47 +0800 Message-ID: <87plw1wmfg.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.22129 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 307 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > Thanks. I'm not sure I understand where you want to be directed. Is > it to the code which implements underwave on GUI frames? something > else? It's x_draw_underwave and its siblings in each of the *term.[cm] files, though only X support is absolutely essential. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v5] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Mar 2024 10:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171041169512211 (code B ref 62994); Thu, 14 Mar 2024 10:22:01 +0000 Received: (at 62994) by debbugs.gnu.org; 14 Mar 2024 10:21:35 +0000 Received: from localhost ([127.0.0.1]:48396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkiDP-0003As-Bs for submit@debbugs.gnu.org; Thu, 14 Mar 2024 06:21:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkiDN-0003Ad-JV for 62994@debbugs.gnu.org; Thu, 14 Mar 2024 06:21:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rkiCh-0001EB-4E; Thu, 14 Mar 2024 06:20:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NTiHfY9bLx2SjjSQppN3zHi0LTzb0RBNC0r45oYC4SM=; b=jm6lz/GWhn5M GbOirIugZIrwHM9xKhUglDdzZ0cdJ9b531QXhM4AA3SQsLt5mX7t1gQxnzbRoWZXizF2AgUpuIqYq f3sRU/7Jx/v0A6Z6llMFNoZG7FxQhxeCuPZh2AcOmowjqoTfvDrvSK1Xc0KAUd1pS6eBxIPOhe+ye pdYpVJRu74p83xzaLEflSCteLj1fAQwW9/uQMcemLYfrTG3sHprM+qZENij+zQ1GL78xLzVtBNyXL rkF0aWbZRUzJIzB8CmljlPKFwXWVWWQtOHqDl8TLdzBrRq7cahZ2kGv570/6vQ8Kj1t79z1CO0JHj rqdNDI20MixXXpjGvPpvWQ==; Date: Thu, 14 Mar 2024 12:20:17 +0200 Message-Id: <86v85p9kta.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87o7bmez8s.fsf@kisara.moe> (message from Mohsin Kaleem on Sun, 10 Mar 2024 18:08:19 +0000) References: <20240211180501.695192-1-mohkale@kisara.moe> <86a5o5sv9q.fsf@gnu.org> <87o7bmez8s.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Cc: 62994@debbugs.gnu.org > Date: Sun, 10 Mar 2024 18:08:19 +0000 > > Eli Zaretskii writes: > > > Thanks. I think in addition to NEWS, we'd need to update the ELisp > > Reference manual, because the new underline styles are not currently > > mentioned there. > > Added. Should I mention display support between GUI and TTY frames or is > it sufficient just to mention these are the options? The documentation should say which displays support this. > >> - if (foreground_p) > >> - face->foreground = pixel; > >> - else > >> - face->background = pixel; > >> + switch (idx) > >> + { > >> + case LFACE_FOREGROUND_INDEX: > >> + face->foreground = pixel; > >> + break; > >> + case LFACE_BACKGROUND_INDEX: > >> + face->background = pixel; > >> + break; > >> + case LFACE_UNDERLINE_INDEX: > >> + face->underline_color = pixel; > >> + break; > >> + default: > >> + emacs_abort (); > > > > The original code didn't call emacs_abort, but instead simply used > > PIXEL as the background color. Why would we do something different > > now? > > Earlier in the function we call eassert on the index parameter. I > might've misunderstood but I thought that check would terminate the > function at that point so this line where we handle a index value > outside the supported range should never be called. eassert are only active in debug builds with --enable-checking; they compile to nothing in production builds. > If preferred I can > fallthrough into the background statement to stay consistent? Yes, please. > >> +static void > >> +map_tty_color2 (struct frame *f, struct face *face, Lisp_Object color, > >> + enum lface_attribute_index idx) > >> +{ > >> + bool face_colors_defaulted = false; > >> + map_tty_color (f, face, color, idx, &face_colors_defaulted); > >> } > > > > Is this function really justified? why not call map_tty_color? > > The extra parameter face_colors_defaulted doesn't really make sense for > anything but foreground/background color calls. Using the existing one > would make the callsite for the underline color set more noisy with an > extra output param that we then just ignore. I thought this was a > slightly nicer solution from the caller side. If preferred I can remove > and go the alternate route? How many callers does this function have? If just one or two, I don't think a separate function is worth our while. Thanks. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v6] Add support for colored and styled underlines on tty frames Resent-From: mohkale@kisara.moe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Apr 2024 13:58:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org Cc: Mohsin Kaleem Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171310302732117 (code B ref 62994); Sun, 14 Apr 2024 13:58:06 +0000 Received: (at 62994) by debbugs.gnu.org; 14 Apr 2024 13:57:07 +0000 Received: from localhost ([127.0.0.1]:34727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rw0Lp-0008Jy-G1 for submit@debbugs.gnu.org; Sun, 14 Apr 2024 09:57:06 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:57090 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rw0Lf-0008H4-6O for 62994@debbugs.gnu.org; Sun, 14 Apr 2024 09:56:54 -0400 Received: from mk-desktop.Home (bcde7b88.skybroadband.com [188.222.123.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 4A5BAA2796; Sun, 14 Apr 2024 15:56:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1713102994; bh=TBxzyGqAovYxQHhbLtt4A38nE14VsBvQsOGyfbBYi9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hsccKaQLDI+kaJTtiUMaF7Txbbtrrmx2ERb84EXGiF6GlB4qHb4elTHPwl+YjF3lk Jb5QYa2dADE+woDpemjo7l7/ZDhKBvhb6ScicWyTGJFVHzzi9LvZglKcIYZ3SlEFnB 8x39x61BHXa7CtRZ9QWE7LLnRWwW7Lfk5Uxk5GxiW15iQ6ggzlaLRlkuEqaIzTdQEi LpBapMmWC17OvrYrxpITJZQNbdH5WFb+pKksAR51VXXbcS7ZQFO/dHuX/JXJC+Uyqq sel1mlm6iaEDa/kvcR+0Dj35L3vbifPXm/rWaWSuI7cd3ASs61pJUjyl/h5d/ZkZZP YzjBfK4W0tf/g== From: mohkale@kisara.moe Date: Sun, 14 Apr 2024 14:56:32 +0100 Message-ID: <20240414135632.432193-1-mohkale@kisara.moe> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Mohsin Kaleem * 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 Dash [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL blocklist [URIs: sw.kovidgoyal.net] 0.6 URIBL_SBL Contains an URL's NS IP listed in the Spamhaus SBL blocklist [URIs: sw.kovidgoyal.net] 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.1 (/) From: Mohsin Kaleem * 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. * src/xterm.c (x_draw_glyph_string): Updated to use renamed FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type enumerations. --- doc/lispref/display.texi | 15 ++-- etc/NEWS | 16 ++++ lisp/cus-face.el | 5 +- src/dispextern.h | 12 ++- src/term.c | 50 +++++++++++- src/termchar.h | 7 ++ src/xfaces.c | 161 ++++++++++++++++++++++++++++++++------- src/xterm.c | 6 +- 8 files changed, 226 insertions(+), 46 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index fba15578f4f..8425aa23422 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2685,12 +2685,15 @@ Face Attributes @var{color} is either a string, or the symbol @code{foreground-color}, meaning the foreground color of the face. Omitting the attribute @code{:color} means to use the foreground color of the face. -@var{style} should be a symbol @code{line} or @code{wave}, meaning to -use a straight or wavy line. Omitting the attribute @code{:style} -means to use a straight line. @var{position}, if non-@code{nil}, means to -display the underline at the descent of the text, instead of at the -baseline level. If it is a number, then it specifies the amount of -pixels above the descent to display the underline. +@var{style} is a symbol which sets the line-style to of the underline. +It should be one of @code{line}, @code{double-line}, @code{wave}, +@code{dots}, or @code{dashes}. GUI frames only support @code{line} and +@code{wave}. Terminal frames can support all aforementioned underline +styles. Omitting the attribute @code{:style} means to use a straight +line. @var{position}, if non-@code{nil}, means to display the underline +at the descent of the text, instead of at the baseline level. If it is +a number, then it specifies the amount of pixels above the descent to +display the underline. @end table @cindex overlined text diff --git a/etc/NEWS b/etc/NEWS index bc8be557711..7926f34f85a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -424,6 +424,22 @@ Use 'TAB' in the minibuffer to show or hide the password. Likewise, there is an icon on the mode-line, which toggles the visibility of the password when clicking with 'mouse-1'. +** Terminal Emacs + +--- +*** 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 or a color other than the foreground-color. +The available underline styles for TTY frames are 'single', +'double-line', 'wave', 'dots, and 'dashes'. These are currently +supported by Kitty, libvte, and st (through the undercurl patch) among +other terminals. + * Editing Changes in Emacs 30.1 diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 47afa841f5e..d0a1a66e29f 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -141,7 +141,10 @@ custom-face-attributes (const :format "" :value :style) (choice :tag "Style" (const :tag "Line" line) - (const :tag "Wave" wave)) + (const :tag "Double line" double-line) + (const :tag "Wave" wave) + (const :tag "Dots" dots) + (const :tag "Dashes" dashes)) (const :format "" :value :position) (choice :tag "Position" (const :tag "At Default Position" nil) diff --git a/src/dispextern.h b/src/dispextern.h index f29377f3596..fc5e53bb055 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1690,9 +1690,13 @@ #define FONT_TOO_HIGH(ft) \ enum face_underline_type { + /* Note: Order matches the order of the Smulx terminfo extension. */ FACE_NO_UNDERLINE = 0, - FACE_UNDER_LINE, - FACE_UNDER_WAVE + FACE_UNDERLINE_SINGLE, + FACE_UNDERLINE_DOUBLE_LINE, + FACE_UNDERLINE_WAVE, + FACE_UNDERLINE_DOTS, + FACE_UNDERLINE_DASHES, }; /* Structure describing a realized face. @@ -1776,7 +1780,7 @@ #define FONT_TOO_HIGH(ft) \ ENUM_BF (face_box_type) box : 2; /* Style of underlining. */ - ENUM_BF (face_underline_type) underline : 2; + ENUM_BF (face_underline_type) underline : 3; /* If `box' above specifies a 3D type, true means use box_color for drawing shadows. */ @@ -1808,7 +1812,6 @@ #define FONT_TOO_HIGH(ft) \ string meaning the default color of the TTY. */ bool_bf tty_bold_p : 1; bool_bf tty_italic_p : 1; - bool_bf tty_underline_p : 1; bool_bf tty_reverse_p : 1; bool_bf tty_strike_through_p : 1; @@ -3426,6 +3429,7 @@ #define TTY_CAP_BOLD 0x04 #define TTY_CAP_DIM 0x08 #define TTY_CAP_ITALIC 0x10 #define TTY_CAP_STRIKE_THROUGH 0x20 +#define TTY_CAP_UNDERLINE_STYLED (0x32 & TTY_CAP_UNDERLINE) /*********************************************************************** diff --git a/src/term.c b/src/term.c index 3fa244be824..37174027e04 100644 --- a/src/term.c +++ b/src/term.c @@ -2014,8 +2014,19 @@ turn_on_face (struct frame *f, int face_id) OUTPUT1 (tty, tty->TS_enter_dim_mode); } - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + if (face->underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) + { + if (face->underline == FACE_UNDERLINE_SINGLE + || !tty->TF_set_underline_style) + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + else if (tty->TF_set_underline_style) + { + char *p; + p = tparam (tty->TF_set_underline_style, NULL, 0, face->underline, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } + } if (face->tty_strike_through_p && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) @@ -2041,6 +2052,14 @@ turn_on_face (struct frame *f, int face_id) OUTPUT (tty, p); xfree (p); } + + ts = tty->TF_set_underline_color; + if (ts && face->underline_color) + { + p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } } } @@ -2061,7 +2080,7 @@ turn_off_face (struct frame *f, int face_id) if (face->tty_bold_p || face->tty_italic_p || face->tty_reverse_p - || face->tty_underline_p + || face->underline || face->tty_strike_through_p) { OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); @@ -2073,7 +2092,7 @@ turn_off_face (struct frame *f, int face_id) { /* If we don't have "me" we can only have those appearances that have exit sequences defined. */ - if (face->tty_underline_p) + if (face->underline) OUTPUT_IF (tty, tty->TS_exit_underline_mode); } @@ -2104,6 +2123,9 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_UNDERLINE_STYLED, tty->TF_set_underline_style, + NC_UNDERLINE); TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); TTY_CAPABLE_P_TRY (tty, @@ -4360,6 +4382,26 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TF_underscore = tgetflag ("ul"); tty->TF_teleray = tgetflag ("xt"); + /* Styled underlines. Support for this is provided either by the + escape sequence in Smulx or the Su flag. The latter results in a + common default escape sequence and is not recommended. */ +#ifdef TERMINFO + tty->TF_set_underline_style = tigetstr ("Smulx"); + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) + tty->TF_set_underline_style = NULL; +#else + tty->TF_set_underline_style = tgetstr ("Smulx", address); +#endif + if (!tty->TF_set_underline_style && tgetflag ("Su")) + /* Default to the kitty escape sequence. See + https://sw.kovidgoyal.net/kitty/underlines/ */ + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + + if (tty->TF_set_underline_style) + /* Standard escape sequence to set the underline color. + Requires a single parameter, the color index. */ + tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 2d845107e11..a1df5a19518 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -171,6 +171,13 @@ #define EMACS_TERMCHAR_H non-blank position. Must clear before writing _. */ int TF_teleray; /* termcap xt flag: many weird consequences. For t1061. */ + const char *TF_set_underline_style; /* termcap Smulx entry: Switches the underline + style based on the parameter. Param should + be one of: 0 (none), 1 (straight), 2 (double-line), + 3 (wave), 4 (dots), or 5 (dashes). */ + const char *TF_set_underline_color; /* Enabled when TF_set_underline_style is set: + Sets the color of the underline. Accepts a + single parameter, the color index. */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index d4583e1a78f..6480bfe1fff 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3311,7 +3311,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, } else if (EQ (key, QCstyle) - && !(EQ (val, Qline) || EQ (val, Qwave))) + && !(EQ (val, Qline) + || EQ (val, Qdouble_line) + || EQ (val, Qwave) + || EQ (val, Qdots) + || EQ (val, Qdashes))) { valid_p = false; break; @@ -5275,6 +5279,7 @@ gui_supports_face_attributes_p (struct frame *f, Lisp_Object attrs[LFACE_VECTOR_SIZE], struct face *def_face) { + Lisp_Object val; Lisp_Object *def_attrs = def_face->lface; Lisp_Object lattrs[LFACE_VECTOR_SIZE]; @@ -5369,6 +5374,14 @@ gui_supports_face_attributes_p (struct frame *f, return false; } + /* Check supported underline styles. */ + val = attrs[LFACE_UNDERLINE_INDEX]; + if (!UNSPECIFIEDP (val)) + if (EQ (CAR_SAFE (val), QCstyle)) + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) + return false; /* Unsupported underline style. */ + /* Everything checks out, this face is supported. */ return true; } @@ -5462,11 +5475,20 @@ tty_supports_face_attributes_p (struct frame *f, if (!UNSPECIFIEDP (val)) { if (STRINGP (val)) - return false; /* ttys can't use colored underlines */ - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) - return false; /* ttys can't use wave underlines */ + test_caps |= TTY_CAP_UNDERLINE_STYLED; + else if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble_line) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdots) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashes))) + return false; /* Face uses an unsupported underline style. */ + + test_caps |= TTY_CAP_UNDERLINE_STYLED; + } else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) - return false; /* same as default */ + return false; /* same as default */ else test_caps |= TTY_CAP_UNDERLINE; } @@ -6321,7 +6343,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] if (EQ (underline, Qt)) { /* Use default color (same as foreground color). */ - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; face->underline_defaulted_p = true; face->underline_color = 0; face->underline_at_descent_line_p = false; @@ -6330,7 +6352,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] else if (STRINGP (underline)) { /* Use specified color. */ - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; face->underline_defaulted_p = false; face->underline_color = load_color (f, face, underline, @@ -6350,7 +6372,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] { /* `(:color COLOR :style STYLE)'. STYLE being one of `line' or `wave'. */ - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; face->underline_color = 0; face->underline_defaulted_p = true; face->underline_at_descent_line_p = false; @@ -6387,9 +6409,11 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] else if (EQ (keyword, QCstyle)) { if (EQ (value, Qline)) - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; else if (EQ (value, Qwave)) - face->underline = FACE_UNDER_WAVE; + face->underline = FACE_UNDERLINE_WAVE; + else + face->underline = FACE_UNDERLINE_SINGLE; } else if (EQ (keyword, QCposition)) { @@ -6440,17 +6464,18 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] } -/* Map a specified color of face FACE on frame F to a tty color index. - IDX is either LFACE_FOREGROUND_INDEX or LFACE_BACKGROUND_INDEX, and - specifies which color to map. Set *DEFAULTED to true if mapping to the +/* Map the specified color COLOR of face FACE on frame F to a tty + color index. IDX is one of LFACE_FOREGROUND_INDEX, + LFACE_BACKGROUND_INDEX or LFACE_UNDERLINE_INDEX, and specifies + which color to map. Set *DEFAULTED to true if mapping to the default foreground/background colors. */ static void -map_tty_color (struct frame *f, struct face *face, - enum lface_attribute_index idx, bool *defaulted) +map_tty_color (struct frame *f, struct face *face, Lisp_Object color, + enum lface_attribute_index idx, bool *defaulted) { - Lisp_Object frame, color, def; - bool foreground_p = idx == LFACE_FOREGROUND_INDEX; + Lisp_Object frame, def; + bool foreground_p = idx != LFACE_BACKGROUND_INDEX; unsigned long default_pixel = foreground_p ? FACE_TTY_DEFAULT_FG_COLOR : FACE_TTY_DEFAULT_BG_COLOR; unsigned long pixel = default_pixel; @@ -6459,10 +6484,11 @@ map_tty_color (struct frame *f, struct face *face, foreground_p ? FACE_TTY_DEFAULT_BG_COLOR : FACE_TTY_DEFAULT_FG_COLOR; #endif - eassert (idx == LFACE_FOREGROUND_INDEX || idx == LFACE_BACKGROUND_INDEX); + eassert (idx == LFACE_FOREGROUND_INDEX + || idx == LFACE_BACKGROUND_INDEX + || idx == LFACE_UNDERLINE_INDEX); XSETFRAME (frame, f); - color = face->lface[idx]; if (STRINGP (color) && SCHARS (color) @@ -6507,13 +6533,21 @@ map_tty_color (struct frame *f, struct face *face, #endif /* MSDOS */ } - if (foreground_p) - face->foreground = pixel; - else - face->background = pixel; + switch (idx) + { + case LFACE_FOREGROUND_INDEX: + face->foreground = pixel; + break; + case LFACE_UNDERLINE_INDEX: + face->underline_color = pixel; + break; + case LFACE_BACKGROUND_INDEX: + default: + face->background = pixel; + break; + } } - /* Realize the fully-specified face with attributes ATTRS in face cache CACHE for ASCII characters. Do it for TTY frame CACHE->f. Value is a pointer to the newly created realized face. */ @@ -6524,6 +6558,7 @@ realize_tty_face (struct face_cache *cache, { struct face *face; int weight, slant; + Lisp_Object underline; bool face_colors_defaulted = false; struct frame *f = cache->f; @@ -6543,16 +6578,83 @@ realize_tty_face (struct face_cache *cache, face->tty_bold_p = true; if (slant != 100) face->tty_italic_p = true; - if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) - face->tty_underline_p = true; if (!NILP (attrs[LFACE_INVERSE_INDEX])) face->tty_reverse_p = true; if (!NILP (attrs[LFACE_STRIKE_THROUGH_INDEX])) face->tty_strike_through_p = true; + /* Text underline. */ + underline = attrs[LFACE_UNDERLINE_INDEX]; + if (NILP (underline)) + { + face->underline = FACE_NO_UNDERLINE; + face->underline_color = 0; + } + else if (EQ (underline, Qt)) + { + face->underline = FACE_UNDERLINE_SINGLE; + face->underline_color = 0; + } + else if (STRINGP (underline)) + { + face->underline = FACE_UNDERLINE_SINGLE; + bool underline_color_defaulted; + map_tty_color (f, face, underline, LFACE_UNDERLINE_INDEX, + &underline_color_defaulted); + } + else if (CONSP (underline)) + { + /* `(:color COLOR :style STYLE)'. + STYLE being one of `line', `double-line', `wave', `dots' or `dashes'. */ + face->underline = FACE_UNDERLINE_SINGLE; + face->underline_color = 0; + + while (CONSP (underline)) + { + Lisp_Object keyword, value; + + keyword = XCAR (underline); + underline = XCDR (underline); + + if (!CONSP (underline)) + break; + value = XCAR (underline); + underline = XCDR (underline); + + if (EQ (keyword, QCcolor)) + { + if (EQ (value, Qforeground_color)) + face->underline_color = 0; + else if (STRINGP (value)) + { + bool underline_color_defaulted; + map_tty_color (f, face, value, LFACE_UNDERLINE_INDEX, + &underline_color_defaulted); + } + } + else if (EQ (keyword, QCstyle)) + { + if (EQ (value, Qline)) + face->underline = FACE_UNDERLINE_SINGLE; + else if (EQ (value, Qdouble_line)) + face->underline = FACE_UNDERLINE_DOUBLE_LINE; + else if (EQ (value, Qwave)) + face->underline = FACE_UNDERLINE_WAVE; + else if (EQ (value, Qdots)) + face->underline = FACE_UNDERLINE_DOTS; + else if (EQ (value, Qdashes)) + face->underline = FACE_UNDERLINE_DASHES; + else + face->underline = FACE_UNDERLINE_SINGLE; + } + } + } + /* Map color names to color indices. */ - map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); - map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); + map_tty_color (f, face, face->lface[LFACE_FOREGROUND_INDEX], + LFACE_FOREGROUND_INDEX, &face_colors_defaulted); + map_tty_color (f, face, face->lface[LFACE_BACKGROUND_INDEX], + LFACE_BACKGROUND_INDEX, &face_colors_defaulted); /* Swap colors if face is inverse-video. If the colors are taken from the frame colors, they are already inverted, since the @@ -7238,6 +7340,9 @@ syms_of_xfaces (void) DEFSYM (QCposition, ":position"); DEFSYM (Qline, "line"); DEFSYM (Qwave, "wave"); + DEFSYM (Qdouble_line, "double-line"); + DEFSYM (Qdots, "dots"); + DEFSYM (Qdashes, "dashes"); DEFSYM (Qreleased_button, "released-button"); DEFSYM (Qpressed_button, "pressed-button"); DEFSYM (Qflat_button, "flat-button"); diff --git a/src/xterm.c b/src/xterm.c index e08ffd15b18..360541ac0b9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10957,7 +10957,7 @@ x_draw_glyph_string (struct glyph_string *s) /* Draw underline. */ if (s->face->underline) { - if (s->face->underline == FACE_UNDER_WAVE) + if (s->face->underline == FACE_UNDERLINE_WAVE) { if (s->face->underline_defaulted_p) x_draw_underwave (s, decoration_width); @@ -10971,13 +10971,13 @@ x_draw_glyph_string (struct glyph_string *s) XSetForeground (display, s->gc, xgcv.foreground); } } - else if (s->face->underline == FACE_UNDER_LINE) + else if (s->face->underline == FACE_UNDERLINE_SINGLE) { unsigned long thickness, position; int y; if (s->prev - && s->prev->face->underline == FACE_UNDER_LINE + && s->prev->face->underline == FACE_UNDERLINE_SINGLE && (s->prev->face->underline_at_descent_line_p == s->face->underline_at_descent_line_p) && (s->prev->face->underline_pixels_above_descent_line -- 2.44.0 From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v6] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Apr 2024 14:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171310400210511 (code B ref 62994); Sun, 14 Apr 2024 14:14:02 +0000 Received: (at 62994) by debbugs.gnu.org; 14 Apr 2024 14:13:22 +0000 Received: from localhost ([127.0.0.1]:35927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rw0bi-0002jT-GB for submit@debbugs.gnu.org; Sun, 14 Apr 2024 10:13:22 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:32810 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rw0bg-0002jG-8a for 62994@debbugs.gnu.org; Sun, 14 Apr 2024 10:13:20 -0400 Received: from mk-desktop (bcde7b88.skybroadband.com [188.222.123.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 96192A2796 for <62994@debbugs.gnu.org>; Sun, 14 Apr 2024 16:13:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1713103987; bh=B4RJ7HS25duYlVK6bocPi4v4MzUwfcGG9OyTGiCbrwk=; h=From:To:Subject:In-Reply-To:References:Date:From; b=e710xS/xl8ZN3FcEQkwJKCkreIJtiwpGnLhYDOKogXGaWJ0L2bJ7s0wPkVWUcJ7+h 3tM4Xyq7+L5rHKGoxS4CLEoREx4GmiVZP7L9GHYBB0lv+rrSBKqqTzlBNvhsYrekkQ e/vbhRr+JwCSHxLGzgRjPVOCEQgCcidTo96iJuTVhMUn5Uu/RBBMR2gK6PMh3TGS+C vkLhlV3cMQAC/F+Kq6d5LQM83JAuG3AFBl5Qzn43V+TSbsf/kC/KMNidYFDfDb9X4v 3UD9uVpnJU9oZK/sFb+vP44b7L7G2JcIjFkVEboYpc0DMzEiq+tkTcNVEgP2CKHoq1 EL15sSmjIZOyA== From: Mohsin Kaleem In-Reply-To: <20240414135632.432193-1-mohkale@kisara.moe> References: <20240414135632.432193-1-mohkale@kisara.moe> Date: Sun, 14 Apr 2024 15:13:07 +0100 Message-ID: <87v84k8230.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) mohkale@kisara.moe writes: Next patch attempt. I think I've acted on all the comments from last time. Also renamed some of the existing enum face_underline_type entries to make them consistent with the names of the new underline styles. -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v6] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Apr 2024 08:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mohkale@kisara.moe Cc: mohkale@kisara.moe, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17136010367268 (code B ref 62994); Sat, 20 Apr 2024 08:18:02 +0000 Received: (at 62994) by debbugs.gnu.org; 20 Apr 2024 08:17:16 +0000 Received: from localhost ([127.0.0.1]:35011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ry5uL-0001sy-Pi for submit@debbugs.gnu.org; Sat, 20 Apr 2024 04:17:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ry5uG-0001sC-KK for 62994@debbugs.gnu.org; Sat, 20 Apr 2024 04:17:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ry5tw-00071e-CP; Sat, 20 Apr 2024 04:16:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TjgYnEbQLA9LdsQgoP1zWBnI96LqOBgVryPWtGbC0o4=; b=qfZVvXjxPZF0 LLRntItqVh+FIqVJArh0yLpst4jAWw5V4jxc8apNavhdMS7VqovigApjhjRehCI8n1vlokzKtWqRG 7VL1r18ertOuy2NvtI5f4jjOEpK1/fhRm+6OyNrIL3hirvy7+G5qoGiRQWVCkx4wqWj2LkfonU50q mKitQRt4NIBQzy419NodiMLRmRxzYXHTylbkbw763qRKq9DY5kF/0BqSUa0TElZtQOmBR9sHE+ObI bMw8B9L632kDsAdIgLPrST7ExFxmuGWT/sxZbjLNWu8qL7Pfu960AVoz8OrUXUuhbaia3z4gZiUtI KPsZHlEwzPRsLqW9NLMSEg==; Date: Sat, 20 Apr 2024 11:16:44 +0300 Message-Id: <868r18a1oz.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <20240414135632.432193-1-mohkale@kisara.moe> References: <20240414135632.432193-1-mohkale@kisara.moe> X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) > Cc: Mohsin Kaleem > From: mohkale@kisara.moe > Date: Sun, 14 Apr 2024 14:56:32 +0100 The Subject line is longer than 78 characters, so our commit hooks didn't allow me to apply this. Please make the Subject line shorter, possibly by dropping the bug number (mention the bug number somewhere in the rest of the log message). > * 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. > * src/xterm.c (x_draw_glyph_string): Updated to use renamed > FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type > enumerations. These lines are also too long, and don't follow our conventions. I suggest to use change-log-mode to format and fill those correctly. > + if (!tty->TF_set_underline_style && tgetflag ("Su")) > + /* Default to the kitty escape sequence. See > + https://sw.kovidgoyal.net/kitty/underlines/ */ Period missing at the end of the comment. Also, please leave two spaces between the end of the comment and the closing "*/", per our conventions. > + /* Check supported underline styles. */ > + val = attrs[LFACE_UNDERLINE_INDEX]; > + if (!UNSPECIFIEDP (val)) > + if (EQ (CAR_SAFE (val), QCstyle)) > + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) > + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) > + return false; /* Unsupported underline style. */ Can this be written in a cleaner way, as a single 'if' with all the conditions combined together, instead of nesting them? > - return false; /* same as default */ > + return false; /* same as default */ Why this whitespace change? Thanks. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v6] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Apr 2024 14:52:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171371110224502 (code B ref 62994); Sun, 21 Apr 2024 14:52:03 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2024 14:51:42 +0000 Received: from localhost ([127.0.0.1]:43326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryYXd-0006N8-K1 for submit@debbugs.gnu.org; Sun, 21 Apr 2024 10:51:42 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:56580 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryYXZ-0006MG-1U for 62994@debbugs.gnu.org; Sun, 21 Apr 2024 10:51:39 -0400 Received: from mk-desktop (bcde7b88.skybroadband.com [188.222.123.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 99FB2A2796; Sun, 21 Apr 2024 16:51:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1713711079; bh=cGE8dndG7SE7/wA+c3nIzNlSzPcpPQno4tG5dVODODo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MagYnxHnvJxbzThzt1lfljlrCZxvTvSox5pp6gveM+yNxuhV7YoUSx/rWDCuYiTIP xsw5CCS2NdLo7E2oNssuJE6bcnFyxkDrh+XwjrKeadWW3Y4ZkuboyJQoRUZkPqd7f+ mIXseVM8YP6XFNuzaWfOCcHrhA/b1fFoXTA3ZDnKnqg5OUNy6b9YnZ8KMlR+i+iR1J 5ebM/dX7TOXBGLR7MopyvJY0gE5Vi1Au6sczHSOApMOETJSFPpcCbi/sCYZr/1UQh1 x6ynB2XtUNPW9P/vXzSQQocwrXSaojuBJBLxFVl540pYmBFdDz806mgG2DZ8PDr37E lcpyUGza9T0Rg== From: Mohsin Kaleem In-Reply-To: <868r18a1oz.fsf@gnu.org> References: <20240414135632.432193-1-mohkale@kisara.moe> <868r18a1oz.fsf@gnu.org> Date: Sun, 21 Apr 2024 15:51:16 +0100 Message-ID: <87y196ixaz.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Eli Zaretskii writes: > The Subject line is longer than 78 characters, so our commit hooks > didn't allow me to apply this. Please make the Subject line shorter, > possibly by dropping the bug number (mention the bug number somewhere > in the rest of the log message). Sorry, I'm not quite sure what you mean. Are you referring to the subject line of the email message? That's 85 characters, but removing re and the [PATCH X] part condenses it to 70 characters. The original commit I'm making in git is only 58 characters. For reference I've gone ahead and added a reference to the bug number in the commit message body but I'm not sure that's enough to fix this. Would you like me to re-submit with a custom --subject string matching the commit message in git-send-email. I presume that would exclude the re, patch and bug sections? >> * src/xterm.c (x_draw_glyph_string): Updated to use renamed >> FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type >> enumerations. > > These lines are also too long, and don't follow our conventions. I > suggest to use change-log-mode to format and fill those correctly. To confirm this is what I did, I'm not sure if it's exactly what you were recommending: 1. emacs -Q .git/COMMIT_EDITMSG 2. M-x change-log-mode 3. C-SPC to end of buffer message 4. C-M-\ 5. Manually remove the leading indentation Emacs seems to have inserted (other commit messages didn't seem to have this). The end result doesn't seem to have changed the line length of anything, although it did highlight one point where the entry was malformed. > Period missing at the end of the comment. Also, please leave two > spaces between the end of the comment and the closing "*/", per our > conventions. Added. > >> + /* Check supported underline styles. */ >> + val = attrs[LFACE_UNDERLINE_INDEX]; >> + if (!UNSPECIFIEDP (val)) >> + if (EQ (CAR_SAFE (val), QCstyle)) >> + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) >> + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) >> + return false; /* Unsupported underline style. */ > > Can this be written in a cleaner way, as a single 'if' with all the > conditions combined together, instead of nesting them? > I think so, yes. This was added from the corresponding tty code which had more nesting because it also supported more checks against the face attribute. Updated. >> - return false; /* same as default */ >> + return false; /* same as default */ > > Why this whitespace change? I suspect this was a byproduct of me re-indenting comments in an earlier patch. Removed now. -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v6] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Apr 2024 15:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171371510521972 (code B ref 62994); Sun, 21 Apr 2024 15:59:01 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2024 15:58:25 +0000 Received: from localhost ([127.0.0.1]:43574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryZaA-0005hu-82 for submit@debbugs.gnu.org; Sun, 21 Apr 2024 11:58:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryZa5-0005gb-6g for 62994@debbugs.gnu.org; Sun, 21 Apr 2024 11:58:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryZZj-00027n-VE; Sun, 21 Apr 2024 11:57:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6eA9KORFyVI1HTnW1NcJuVuEt0oDcCdulHxs0dW/SqY=; b=SBJHM7RMitmU o4y+66RNY86pLI3D74ZPGThA0ykCh2vc4CQlK4iIe8RkHQAnsPG8s17RgX7R+kYR61mUKb9v5QwKs BSxio0Rk1Nk0talk5/eoAmzG7e3MRpUA/20citCVB+M8jcRL3OQ56BQVHGS/AyDPVX2YIsWmwnhvZ K7g3M/f0HSE4BFqMkKP3BQ75uvuOLBlZkbRMGbYuorP6JVDeBaRYQyahMukzS8Ud1TDWypHHPPbw7 nh6eOsd7YGKCWGFYDgCpdF96Yyb6hcEF8fy/3j56XjUGoadp9WzeRLhGW0PB87b/DmzNKB2HC5TXv B0kwVlSvCLZKoQfM1NBRqw==; Date: Sun, 21 Apr 2024 18:57:53 +0300 Message-Id: <86o7a27loe.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87y196ixaz.fsf@kisara.moe> (message from Mohsin Kaleem on Sun, 21 Apr 2024 15:51:16 +0100) References: <20240414135632.432193-1-mohkale@kisara.moe> <868r18a1oz.fsf@gnu.org> <87y196ixaz.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Cc: 62994@debbugs.gnu.org > Date: Sun, 21 Apr 2024 15:51:16 +0100 > > Eli Zaretskii writes: > > > The Subject line is longer than 78 characters, so our commit hooks > > didn't allow me to apply this. Please make the Subject line shorter, > > possibly by dropping the bug number (mention the bug number somewhere > > in the rest of the log message). > > Sorry, I'm not quite sure what you mean. Are you referring to the > subject line of the email message? That's 85 characters, but removing re > and the [PATCH X] part condenses it to 70 characters. I don't know what exactly does "git am" do with Subject, but the fact is the pre-commit hook aborted the commit. How about if you produce a patch with "git format-patch", and then attach the result to the mail (as an attachment)? It could be that the problem here is with some problematic format of the Subject line, but there's no reason to have the patch heading be the Subject of the email. > To confirm this is what I did, I'm not sure if it's exactly what you > were recommending: > > 1. emacs -Q .git/COMMIT_EDITMSG > 2. M-x change-log-mode > 3. C-SPC to end of buffer message > 4. C-M-\ > 5. Manually remove the leading indentation Emacs seems to have inserted > (other commit messages didn't seem to have this). > > The end result doesn't seem to have changed the line length of anything, > although it did highlight one point where the entry was malformed. That's not what I meant. In order to have the proper line length, you need first to add a TAB before each line, then turn on change-log-mode, then fill the lines with M-q, then remove the leading TABs. The reason for this is that the Git logs are used to produce ChangeLog files when we prepare a release, and ChangeLog files have a TAB before each line of the log entries. > Updated. > > >> - return false; /* same as default */ > >> + return false; /* same as default */ > > > > Why this whitespace change? > > I suspect this was a byproduct of me re-indenting comments in an earlier patch. > > Removed now. Did you forget to attach the updated patch? From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v6] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Apr 2024 16:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171371576427110 (code B ref 62994); Sun, 21 Apr 2024 16:10:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2024 16:09:24 +0000 Received: from localhost ([127.0.0.1]:43633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryZkp-000730-6i for submit@debbugs.gnu.org; Sun, 21 Apr 2024 12:09:23 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:34964 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryZkl-00072K-8z for 62994@debbugs.gnu.org; Sun, 21 Apr 2024 12:09:21 -0400 Received: from mk-desktop (bcde7b88.skybroadband.com [188.222.123.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 19875A2796; Sun, 21 Apr 2024 18:09:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1713715742; bh=ezF7dDuUcSVHSWErYAFcIKwdBxdOpoEwIR1fkVbfsUY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=tbARDhMP2nvGkq7/vqf4PQNjMPDdgTMwJqPwZpfyTVFgfikBWyMckqNUKsuIr4GR1 00Qap8fKANrMDaQTolPoymjrycjv9uIfwVP5sScl9s1rHkvNwGD28pPT4WDV0oddoZ 8hPTeJbZVXKzwaww1xW8LoHaLd0h5OC3nvApGo1YefzQK7u94XsEuFM24FmiCKOwLl dlD0XjmbBYv6P5lGkJQCDrxQqiu/9TMCSAmSZngqPq3aBlUPpXOiyQytJZ8peJcqr7 Co42gI/Y4tiUbqEjrGYewTgAYVAMQFTDxnZjSPW8zxWKaR3XEtfzD3tRJp2JQmXefk RDA/FdghOgGHw== From: Mohsin Kaleem In-Reply-To: <86o7a27loe.fsf@gnu.org> References: <20240414135632.432193-1-mohkale@kisara.moe> <868r18a1oz.fsf@gnu.org> <87y196ixaz.fsf@kisara.moe> <86o7a27loe.fsf@gnu.org> Date: Sun, 21 Apr 2024 17:09:01 +0100 Message-ID: <87v84aitpe.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Eli Zaretskii writes: > How about if you produce a patch with "git format-patch", and then > attach the result to the mail (as an attachment)? It could be that > the problem here is with some problematic format of the Subject line, > but there's no reason to have the patch heading be the Subject of the > email. I'll give that a go. > That's not what I meant. In order to have the proper line length, you > need first to add a TAB before each line, then turn on > change-log-mode, then fill the lines with M-q, then remove the leading > TABs. > > The reason for this is that the Git logs are used to produce ChangeLog > files when we prepare a release, and ChangeLog files have a TAB before > each line of the log entries. I see, gave that a go and it seems to have reorganised things somewhat so hopefully should meet conventions now. Apologies for the back and forth on this, I'm accustomed to lints and convention adherence like this being automated. > Did you forget to attach the updated patch? Was waiting on a reply to this message just to make sure I acted on all the comments from the last time round. Sending now... -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v7] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Apr 2024 16:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171371594228391 (code B ref 62994); Sun, 21 Apr 2024 16:13:02 +0000 Received: (at 62994) by debbugs.gnu.org; 21 Apr 2024 16:12:22 +0000 Received: from localhost ([127.0.0.1]:43654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryZnd-0007N9-N5 for submit@debbugs.gnu.org; Sun, 21 Apr 2024 12:12:22 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:43654 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryZnZ-0007MN-69 for 62994@debbugs.gnu.org; Sun, 21 Apr 2024 12:12:16 -0400 Received: from mk-desktop (bcde7b88.skybroadband.com [188.222.123.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 18518A2796 for <62994@debbugs.gnu.org>; Sun, 21 Apr 2024 18:11:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1713715917; bh=7N8gAdAvDUFTEUMfL6OrhFlLMSz6o1Ol6AGNaEDJv3w=; h=From:To:Subject:In-Reply-To:References:Date:From; b=BDRYHM6ZYbVQUxt15zv4EYh3fJLKSAJzI5TS6BNY3p74PIIaVdN4Nt7/oVsGSVll4 taV+HjjD0Oc1qsdi7S3bQwFTJqR+xJYyXiebVMVwML3gYXWroR4Ety3jjbbuppI/hN aK0NC38uOaqGfI8GLn9WgukPSwNfg2eNl/15pIGpMb55JAAbVJ8Npb5Apb0k+2R2i2 krKb8SuhEV2iypCgG3lrjfa3USncTBTYBaQ7hsJM999LQjphGIXve1VSBLJx164PMB 1AR1dHIU3OMiuFskDiV5UXyxMTs1q6q1paZjaMI2yYP5e1mWMgPphBiN+uUhmA9P0W 8WoOV4Xsmp65g== From: Mohsin Kaleem In-Reply-To: References: <87pm7x5mxc.fsf@kisara.moe> Date: Sun, 21 Apr 2024 17:11:56 +0100 Message-ID: <87sezeitkj.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Manually attaching git exported patch. From e9cc3a5aa39dd9aebd38432fa77f4463ef565855 Mon Sep 17 00:00:00 2001 From: Mohsin Kaleem Date: Thu, 20 Apr 2023 22:30:12 +0100 Subject: Add support for colored and styled underl [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL blocklist [URIs: sw.kovidgoyal.net] 0.6 URIBL_SBL Contains an URL's NS IP listed in the Spamhaus SBL blocklist [URIs: sw.kovidgoyal.net] 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.1 (/) --=-=-= Content-Type: text/plain Manually attaching git exported patch. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v7-0001-Add-support-for-colored-and-styled-underlines-on-.patch >From e9cc3a5aa39dd9aebd38432fa77f4463ef565855 Mon Sep 17 00:00:00 2001 From: Mohsin Kaleem Date: Thu, 20 Apr 2023 22:30:12 +0100 Subject: Add support for colored and styled underlines on tty frames CLOSES bug#62994 * 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. * src/xterm.c (x_draw_glyph_string): Updated to use renamed FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type enumerations. --- doc/lispref/display.texi | 15 ++-- etc/NEWS | 16 ++++ lisp/cus-face.el | 5 +- src/dispextern.h | 12 ++- src/term.c | 50 +++++++++++- src/termchar.h | 7 ++ src/xfaces.c | 159 ++++++++++++++++++++++++++++++++------- src/xterm.c | 6 +- 8 files changed, 225 insertions(+), 45 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index fba15578f4f..8425aa23422 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2685,12 +2685,15 @@ Face Attributes @var{color} is either a string, or the symbol @code{foreground-color}, meaning the foreground color of the face. Omitting the attribute @code{:color} means to use the foreground color of the face. -@var{style} should be a symbol @code{line} or @code{wave}, meaning to -use a straight or wavy line. Omitting the attribute @code{:style} -means to use a straight line. @var{position}, if non-@code{nil}, means to -display the underline at the descent of the text, instead of at the -baseline level. If it is a number, then it specifies the amount of -pixels above the descent to display the underline. +@var{style} is a symbol which sets the line-style to of the underline. +It should be one of @code{line}, @code{double-line}, @code{wave}, +@code{dots}, or @code{dashes}. GUI frames only support @code{line} and +@code{wave}. Terminal frames can support all aforementioned underline +styles. Omitting the attribute @code{:style} means to use a straight +line. @var{position}, if non-@code{nil}, means to display the underline +at the descent of the text, instead of at the baseline level. If it is +a number, then it specifies the amount of pixels above the descent to +display the underline. @end table @cindex overlined text diff --git a/etc/NEWS b/etc/NEWS index bc8be557711..7926f34f85a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -424,6 +424,22 @@ Use 'TAB' in the minibuffer to show or hide the password. Likewise, there is an icon on the mode-line, which toggles the visibility of the password when clicking with 'mouse-1'. +** Terminal Emacs + +--- +*** 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 or a color other than the foreground-color. +The available underline styles for TTY frames are 'single', +'double-line', 'wave', 'dots, and 'dashes'. These are currently +supported by Kitty, libvte, and st (through the undercurl patch) among +other terminals. + * Editing Changes in Emacs 30.1 diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 47afa841f5e..d0a1a66e29f 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -141,7 +141,10 @@ custom-face-attributes (const :format "" :value :style) (choice :tag "Style" (const :tag "Line" line) - (const :tag "Wave" wave)) + (const :tag "Double line" double-line) + (const :tag "Wave" wave) + (const :tag "Dots" dots) + (const :tag "Dashes" dashes)) (const :format "" :value :position) (choice :tag "Position" (const :tag "At Default Position" nil) diff --git a/src/dispextern.h b/src/dispextern.h index f29377f3596..fc5e53bb055 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1690,9 +1690,13 @@ #define FONT_TOO_HIGH(ft) \ enum face_underline_type { + /* Note: Order matches the order of the Smulx terminfo extension. */ FACE_NO_UNDERLINE = 0, - FACE_UNDER_LINE, - FACE_UNDER_WAVE + FACE_UNDERLINE_SINGLE, + FACE_UNDERLINE_DOUBLE_LINE, + FACE_UNDERLINE_WAVE, + FACE_UNDERLINE_DOTS, + FACE_UNDERLINE_DASHES, }; /* Structure describing a realized face. @@ -1776,7 +1780,7 @@ #define FONT_TOO_HIGH(ft) \ ENUM_BF (face_box_type) box : 2; /* Style of underlining. */ - ENUM_BF (face_underline_type) underline : 2; + ENUM_BF (face_underline_type) underline : 3; /* If `box' above specifies a 3D type, true means use box_color for drawing shadows. */ @@ -1808,7 +1812,6 @@ #define FONT_TOO_HIGH(ft) \ string meaning the default color of the TTY. */ bool_bf tty_bold_p : 1; bool_bf tty_italic_p : 1; - bool_bf tty_underline_p : 1; bool_bf tty_reverse_p : 1; bool_bf tty_strike_through_p : 1; @@ -3426,6 +3429,7 @@ #define TTY_CAP_BOLD 0x04 #define TTY_CAP_DIM 0x08 #define TTY_CAP_ITALIC 0x10 #define TTY_CAP_STRIKE_THROUGH 0x20 +#define TTY_CAP_UNDERLINE_STYLED (0x32 & TTY_CAP_UNDERLINE) /*********************************************************************** diff --git a/src/term.c b/src/term.c index 3fa244be824..a0baf544897 100644 --- a/src/term.c +++ b/src/term.c @@ -2014,8 +2014,19 @@ turn_on_face (struct frame *f, int face_id) OUTPUT1 (tty, tty->TS_enter_dim_mode); } - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + if (face->underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) + { + if (face->underline == FACE_UNDERLINE_SINGLE + || !tty->TF_set_underline_style) + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + else if (tty->TF_set_underline_style) + { + char *p; + p = tparam (tty->TF_set_underline_style, NULL, 0, face->underline, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } + } if (face->tty_strike_through_p && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) @@ -2041,6 +2052,14 @@ turn_on_face (struct frame *f, int face_id) OUTPUT (tty, p); xfree (p); } + + ts = tty->TF_set_underline_color; + if (ts && face->underline_color) + { + p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } } } @@ -2061,7 +2080,7 @@ turn_off_face (struct frame *f, int face_id) if (face->tty_bold_p || face->tty_italic_p || face->tty_reverse_p - || face->tty_underline_p + || face->underline || face->tty_strike_through_p) { OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); @@ -2073,7 +2092,7 @@ turn_off_face (struct frame *f, int face_id) { /* If we don't have "me" we can only have those appearances that have exit sequences defined. */ - if (face->tty_underline_p) + if (face->underline) OUTPUT_IF (tty, tty->TS_exit_underline_mode); } @@ -2104,6 +2123,9 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_UNDERLINE_STYLED, tty->TF_set_underline_style, + NC_UNDERLINE); TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); TTY_CAPABLE_P_TRY (tty, @@ -4360,6 +4382,26 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TF_underscore = tgetflag ("ul"); tty->TF_teleray = tgetflag ("xt"); + /* Styled underlines. Support for this is provided either by the + escape sequence in Smulx or the Su flag. The latter results in a + common default escape sequence and is not recommended. */ +#ifdef TERMINFO + tty->TF_set_underline_style = tigetstr ("Smulx"); + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) + tty->TF_set_underline_style = NULL; +#else + tty->TF_set_underline_style = tgetstr ("Smulx", address); +#endif + if (!tty->TF_set_underline_style && tgetflag ("Su")) + /* Default to the kitty escape sequence. See + https://sw.kovidgoyal.net/kitty/underlines/. */ + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + + if (tty->TF_set_underline_style) + /* Standard escape sequence to set the underline color. + Requires a single parameter, the color index. */ + tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 2d845107e11..a1df5a19518 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -171,6 +171,13 @@ #define EMACS_TERMCHAR_H non-blank position. Must clear before writing _. */ int TF_teleray; /* termcap xt flag: many weird consequences. For t1061. */ + const char *TF_set_underline_style; /* termcap Smulx entry: Switches the underline + style based on the parameter. Param should + be one of: 0 (none), 1 (straight), 2 (double-line), + 3 (wave), 4 (dots), or 5 (dashes). */ + const char *TF_set_underline_color; /* Enabled when TF_set_underline_style is set: + Sets the color of the underline. Accepts a + single parameter, the color index. */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index d4583e1a78f..649c65bef8f 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3311,7 +3311,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, } else if (EQ (key, QCstyle) - && !(EQ (val, Qline) || EQ (val, Qwave))) + && !(EQ (val, Qline) + || EQ (val, Qdouble_line) + || EQ (val, Qwave) + || EQ (val, Qdots) + || EQ (val, Qdashes))) { valid_p = false; break; @@ -5275,6 +5279,7 @@ gui_supports_face_attributes_p (struct frame *f, Lisp_Object attrs[LFACE_VECTOR_SIZE], struct face *def_face) { + Lisp_Object val; Lisp_Object *def_attrs = def_face->lface; Lisp_Object lattrs[LFACE_VECTOR_SIZE]; @@ -5369,6 +5374,14 @@ gui_supports_face_attributes_p (struct frame *f, return false; } + /* Check supported underline styles. */ + val = attrs[LFACE_UNDERLINE_INDEX]; + if (!UNSPECIFIEDP (val) + && EQ (CAR_SAFE (val), QCstyle) + && !(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) + return false; /* Unsupported underline style. */ + /* Everything checks out, this face is supported. */ return true; } @@ -5462,9 +5475,18 @@ tty_supports_face_attributes_p (struct frame *f, if (!UNSPECIFIEDP (val)) { if (STRINGP (val)) - return false; /* ttys can't use colored underlines */ - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) - return false; /* ttys can't use wave underlines */ + test_caps |= TTY_CAP_UNDERLINE_STYLED; + else if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble_line) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdots) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashes))) + return false; /* Face uses an unsupported underline style. */ + + test_caps |= TTY_CAP_UNDERLINE_STYLED; + } else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) return false; /* same as default */ else @@ -6321,7 +6343,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] if (EQ (underline, Qt)) { /* Use default color (same as foreground color). */ - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; face->underline_defaulted_p = true; face->underline_color = 0; face->underline_at_descent_line_p = false; @@ -6330,7 +6352,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] else if (STRINGP (underline)) { /* Use specified color. */ - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; face->underline_defaulted_p = false; face->underline_color = load_color (f, face, underline, @@ -6350,7 +6372,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] { /* `(:color COLOR :style STYLE)'. STYLE being one of `line' or `wave'. */ - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; face->underline_color = 0; face->underline_defaulted_p = true; face->underline_at_descent_line_p = false; @@ -6387,9 +6409,11 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] else if (EQ (keyword, QCstyle)) { if (EQ (value, Qline)) - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; else if (EQ (value, Qwave)) - face->underline = FACE_UNDER_WAVE; + face->underline = FACE_UNDERLINE_WAVE; + else + face->underline = FACE_UNDERLINE_SINGLE; } else if (EQ (keyword, QCposition)) { @@ -6440,17 +6464,18 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] } -/* Map a specified color of face FACE on frame F to a tty color index. - IDX is either LFACE_FOREGROUND_INDEX or LFACE_BACKGROUND_INDEX, and - specifies which color to map. Set *DEFAULTED to true if mapping to the +/* Map the specified color COLOR of face FACE on frame F to a tty + color index. IDX is one of LFACE_FOREGROUND_INDEX, + LFACE_BACKGROUND_INDEX or LFACE_UNDERLINE_INDEX, and specifies + which color to map. Set *DEFAULTED to true if mapping to the default foreground/background colors. */ static void -map_tty_color (struct frame *f, struct face *face, - enum lface_attribute_index idx, bool *defaulted) +map_tty_color (struct frame *f, struct face *face, Lisp_Object color, + enum lface_attribute_index idx, bool *defaulted) { - Lisp_Object frame, color, def; - bool foreground_p = idx == LFACE_FOREGROUND_INDEX; + Lisp_Object frame, def; + bool foreground_p = idx != LFACE_BACKGROUND_INDEX; unsigned long default_pixel = foreground_p ? FACE_TTY_DEFAULT_FG_COLOR : FACE_TTY_DEFAULT_BG_COLOR; unsigned long pixel = default_pixel; @@ -6459,10 +6484,11 @@ map_tty_color (struct frame *f, struct face *face, foreground_p ? FACE_TTY_DEFAULT_BG_COLOR : FACE_TTY_DEFAULT_FG_COLOR; #endif - eassert (idx == LFACE_FOREGROUND_INDEX || idx == LFACE_BACKGROUND_INDEX); + eassert (idx == LFACE_FOREGROUND_INDEX + || idx == LFACE_BACKGROUND_INDEX + || idx == LFACE_UNDERLINE_INDEX); XSETFRAME (frame, f); - color = face->lface[idx]; if (STRINGP (color) && SCHARS (color) @@ -6507,13 +6533,21 @@ map_tty_color (struct frame *f, struct face *face, #endif /* MSDOS */ } - if (foreground_p) - face->foreground = pixel; - else - face->background = pixel; + switch (idx) + { + case LFACE_FOREGROUND_INDEX: + face->foreground = pixel; + break; + case LFACE_UNDERLINE_INDEX: + face->underline_color = pixel; + break; + case LFACE_BACKGROUND_INDEX: + default: + face->background = pixel; + break; + } } - /* Realize the fully-specified face with attributes ATTRS in face cache CACHE for ASCII characters. Do it for TTY frame CACHE->f. Value is a pointer to the newly created realized face. */ @@ -6524,6 +6558,7 @@ realize_tty_face (struct face_cache *cache, { struct face *face; int weight, slant; + Lisp_Object underline; bool face_colors_defaulted = false; struct frame *f = cache->f; @@ -6543,16 +6578,83 @@ realize_tty_face (struct face_cache *cache, face->tty_bold_p = true; if (slant != 100) face->tty_italic_p = true; - if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) - face->tty_underline_p = true; if (!NILP (attrs[LFACE_INVERSE_INDEX])) face->tty_reverse_p = true; if (!NILP (attrs[LFACE_STRIKE_THROUGH_INDEX])) face->tty_strike_through_p = true; + /* Text underline. */ + underline = attrs[LFACE_UNDERLINE_INDEX]; + if (NILP (underline)) + { + face->underline = FACE_NO_UNDERLINE; + face->underline_color = 0; + } + else if (EQ (underline, Qt)) + { + face->underline = FACE_UNDERLINE_SINGLE; + face->underline_color = 0; + } + else if (STRINGP (underline)) + { + face->underline = FACE_UNDERLINE_SINGLE; + bool underline_color_defaulted; + map_tty_color (f, face, underline, LFACE_UNDERLINE_INDEX, + &underline_color_defaulted); + } + else if (CONSP (underline)) + { + /* `(:color COLOR :style STYLE)'. + STYLE being one of `line', `double-line', `wave', `dots' or `dashes'. */ + face->underline = FACE_UNDERLINE_SINGLE; + face->underline_color = 0; + + while (CONSP (underline)) + { + Lisp_Object keyword, value; + + keyword = XCAR (underline); + underline = XCDR (underline); + + if (!CONSP (underline)) + break; + value = XCAR (underline); + underline = XCDR (underline); + + if (EQ (keyword, QCcolor)) + { + if (EQ (value, Qforeground_color)) + face->underline_color = 0; + else if (STRINGP (value)) + { + bool underline_color_defaulted; + map_tty_color (f, face, value, LFACE_UNDERLINE_INDEX, + &underline_color_defaulted); + } + } + else if (EQ (keyword, QCstyle)) + { + if (EQ (value, Qline)) + face->underline = FACE_UNDERLINE_SINGLE; + else if (EQ (value, Qdouble_line)) + face->underline = FACE_UNDERLINE_DOUBLE_LINE; + else if (EQ (value, Qwave)) + face->underline = FACE_UNDERLINE_WAVE; + else if (EQ (value, Qdots)) + face->underline = FACE_UNDERLINE_DOTS; + else if (EQ (value, Qdashes)) + face->underline = FACE_UNDERLINE_DASHES; + else + face->underline = FACE_UNDERLINE_SINGLE; + } + } + } + /* Map color names to color indices. */ - map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); - map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); + map_tty_color (f, face, face->lface[LFACE_FOREGROUND_INDEX], + LFACE_FOREGROUND_INDEX, &face_colors_defaulted); + map_tty_color (f, face, face->lface[LFACE_BACKGROUND_INDEX], + LFACE_BACKGROUND_INDEX, &face_colors_defaulted); /* Swap colors if face is inverse-video. If the colors are taken from the frame colors, they are already inverted, since the @@ -7238,6 +7340,9 @@ syms_of_xfaces (void) DEFSYM (QCposition, ":position"); DEFSYM (Qline, "line"); DEFSYM (Qwave, "wave"); + DEFSYM (Qdouble_line, "double-line"); + DEFSYM (Qdots, "dots"); + DEFSYM (Qdashes, "dashes"); DEFSYM (Qreleased_button, "released-button"); DEFSYM (Qpressed_button, "pressed-button"); DEFSYM (Qflat_button, "flat-button"); diff --git a/src/xterm.c b/src/xterm.c index e08ffd15b18..360541ac0b9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10957,7 +10957,7 @@ x_draw_glyph_string (struct glyph_string *s) /* Draw underline. */ if (s->face->underline) { - if (s->face->underline == FACE_UNDER_WAVE) + if (s->face->underline == FACE_UNDERLINE_WAVE) { if (s->face->underline_defaulted_p) x_draw_underwave (s, decoration_width); @@ -10971,13 +10971,13 @@ x_draw_glyph_string (struct glyph_string *s) XSetForeground (display, s->gc, xgcv.foreground); } } - else if (s->face->underline == FACE_UNDER_LINE) + else if (s->face->underline == FACE_UNDERLINE_SINGLE) { unsigned long thickness, position; int y; if (s->prev - && s->prev->face->underline == FACE_UNDER_LINE + && s->prev->face->underline == FACE_UNDERLINE_SINGLE && (s->prev->face->underline_at_descent_line_p == s->face->underline_at_descent_line_p) && (s->prev->face->underline_pixels_above_descent_line -- 2.44.0 --=-=-= Content-Type: text/plain -- Mohsin Kaleem --=-=-=-- From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v7] Add support for colored and styled underlines on tty frames Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2024 00:46:12 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171374671624513 (code B ref 62994); Mon, 22 Apr 2024 00:46:12 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2024 00:45:16 +0000 Received: from localhost ([127.0.0.1]:45284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryhnx-0006MP-Nc for submit@debbugs.gnu.org; Sun, 21 Apr 2024 20:45:14 -0400 Received: from sonic304-22.consmr.mail.ne1.yahoo.com ([66.163.191.148]:43880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryhne-0006Is-4L for 62994@debbugs.gnu.org; Sun, 21 Apr 2024 20:45:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713746667; bh=y0kL73LYvrTRbY97WUPAGORLS4kksGvhwuRZsYpBSuY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=hVt19zO/PWaUOsipY1zNVe/hQ48+VYSA95UCvT9GYPSn1XW7n2+mzPh3ovFannm8XjAxxEZ0amG1H/uKhTW5lANpHR/4hyNvEwqeukP23NkeTpQFcQePTnRDHIoorrLuIsSlrezQ/mIM3NuueW39I9YIewDxrHzNpf02oMCyJXyg2gohXWTmqRq/wCS7xVgJRt13nBq6bpjZ9d4TFNEMrqXHzUubn/ic4xc9Kx2IvM/5fNVpcrwdXHZ50VvSxGxkpNPwlg2eh2e0QAU8+7C0lupIWq2y+udZ0cOuPm33+zm2L5OFelc/5P1jdgX2bAhqiadZSgi80fdSH89jqJYMGQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713746667; bh=DlJVyZi7tWIe8Iour/4G+0oJK1NdWnMUe9xZLHUevLz=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Il+Xh1ZIN7U/CKJpMxVRzXWBlNB1sDT7YQD70GLfQpl02cOeAQkE9KY3qlMevthNEdRC3j8+g0uFLAT/KNGEychpWbu7/FSXzStwFXAS4e13PXDJuZm/ZMHtVC4ry/nDQDcySGFVhGOYFBNMh72Z0gZny0RyHeaQytYJij/wj5+IlKKpFjbI7iA56XeHexH/GnmWGP4UPd0OgsVYGFjBFKtSXQKenDZjOYKF6KvmSSQnJYtwKpHCmvT2wXztc11ZR/1mmlcNOoi/8DJz3BEALPVa/6tuU6QlNZEZrKLwYz9MRNYBcBa0NCrCYKy7l225DCiAWbaEEjqd5H+XWwG7BQ== X-YMail-OSG: jiucqlYVM1lzHt6SF_Ff.mc5CScoO43eYO6frJgVvNtpqAIFmcwVHkWhQJY7glo MQpNfR0A95qiLbaifFiR9QdixyNWQAsAk6zwPjjyA9ipjYwZ0mpU_yZa5NW1CqTIY90hqQ2J5M1U eY2RSze79MkTbcsSaUbH66W0Ky9_QLmPb5awWByb5WN93SB8QtJ_dk984DwCARMYsklSHbafxrvq j11BGzKPlrIpgt9wcCIR8G.K1RvtqJQaTMtkJXMNxbqG5ZLSzN4AbinMCc9fmnzCv6nit0zd8Fxs QhGIo4AqHPcSjyUmMi5aBTzfjt2SA.pV59zrAl2mzkq.SgfyADzZL_m21MPKDQNGwA9W9UoK.1Z9 vXj749ub0O4u5q7onKBxFZUPnAVYqJKGEodugWbNd41vMcjmgHDBkkxurCSXGeImlxY7ifqyA9NF kBHsPRsbO_K1b0cruKGh7CNas.WYyBG5s0wQ1BJe.VVvrrjP6G3mrMeCOpsawoxV2ahPxqyqsQW_ 2J7PImlHjRKdXjpXpTX.Huxiq5OZw.6h8KzRXk65cCXgEBxFCFROL6zXGyBPRNp47T8vMKp6qAPP 5cB.Xz9xE0R0uy19KYQeblAE7MwLtryA.CUolYh4Lb.jmzA9v8AJxVpf_Lm8v3sXobqUhP3M4FVy HE1_FVGCAqXVOWcNnKsIxoNHSkCBf5rUiXuyror5v9aRjikWiKB91GBesQzNbUh3YSKCHwJLUqzt S64THpqF7CS8aorzYPMFx1uDrFBWiFH9u1viHhHTsMBthZG1W.NNcJG9mo0MWPOJQuLj74fKB3qY DVhdp1FENBxY6UG6104gyAA4O58UgbZF4WO4wmjY2_gmA6JQODBiWASPuuOD9HXLKFQHze.mdFHq nHQzVnGSbvr0G.pVc9kHxwnJVpaUtoqxvnsa5PTVd0FCYzIxWiUtZ4dcywWz0SAUmg6PJ4sLhfW4 FitFPDn_wiAf5pE.m97V3i8RXzgH1LDrpbxRPb9zOITxLd4ZZfne9YYdnRSDBnTDIoSAqd1bNFxQ BtPOUyfyLEuwDrPoomhJ6U8Wz0uTelCmv4GhRrATaXjuLYvYVgzq5nXJK2hnKR9t_i47iA4mnei8 9amm_ZPt7cHEnjU2qA6mkSNbb12QpUxs6CmwNaDBhF8bNijt7MxXWeLG2LaIr2kgVQEOFaJF8CV3 YANvw5L5gD13KHqmPONDj7YpbpDrXYyw0t1_X.WpweCfh4FHsIYOUyI3Y7u8vw5RjdSHEvPo06o1 4U1rkTdwU2qfEtKw2fM7ctWbrhY3..zKTWW2dfg9JKg4qCStrvVbm5eB8xow_eAU_d5x9aWvlb0z mIiml0lZBnK8NZfxfTSan7JDp2SDFt1QTy4YDBj97g551h0rLqddWO8bl2_MAdezCnG6CDbFt.Ap z.i0nTKohTsQ6GZoTCaV8vqfAhPCNOVVVr04HKh0WwoUPERb7jMu1mleLQNnvTkcN9UIfz9Id_Vj OgIMSX5AzTksgg5He7pIskk3P3uTZrAWIieKTo5vRVqyyMITRO9wCBLkLujFrMo0XzrC.fAXRuPJ XXZabTx0M.4DFmhtx7Ke.5XH1izmPlMxEz2lTbDG0HINLXU2_651QNjqPi86t_HEVRZquz1Y2lpK bAmjNvHnv6q67hT79QKXlRLWvMhEBbS5sSkZplGrjeMFZxWu2IEJEezhBjQdVRjyMnslbX_zBD88 CLvt5w51u2S5tjR2Ny8fMDuQ_xmFLKQTuUMoW5WWxiXpPG1_n.iZpYcjg6ZevdD_EuVWVzlUMgEr Tupgjds7hnGR6G8.jA.r2FHihCU0vy3oeWQhqbkOIIGxq.mZRfKwGxZnHkXcnp48auHNz8mEeCoA ahSKFKcF4U971wgg8T6aGhYq61Wcxu2xhRl9gvGusMqN_q0hoBCbtxffbBmKOVzVVBEIaYDeycXn 2APOhi_ffNXYls_HZWRpKPmTBhLb6pACcaqkbeNQJ.wvXnmHYFsJOjJ3xZOcqL.VtDQmgogLZq1c QeLs02KnDW0XbOQpj_98m3AVrfg2i8ia6GoxlJRRZIlWTFchjnZUIQaGwn.B5untqSbxDvfHt2sd _fn0mCImVXuPipKtYaSptG_z_mhIRRP8m5QGWa7d6mhMgRbyUdYe9EUoqDYCdcXex1y.GdgcW73q 15HCrkNIG8v9_XttMvG2IKC4wbqt9WVP5WkbAN9yZ8HN.E9F2nWYogX_iMgC83krQBngJLsl99_U 9A_BQeXcrTQ7ieMJ4ZdhjdxIuPQfyHALe2rfFiyoz5FlDWeTsU61pggDzWnqR X-Sonic-MF: X-Sonic-ID: da05ce82-9f36-4767-8983-831cb996be14 Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Mon, 22 Apr 2024 00:44:27 +0000 Received: by hermes--production-sg3-6f9f87bd85-np5nc (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f5152b0bafc65ccf587b76386b6c7081; Mon, 22 Apr 2024 00:44:21 +0000 (UTC) From: Po Lu In-Reply-To: <87sezeitkj.fsf@kisara.moe> (Mohsin Kaleem's message of "Sun, 21 Apr 2024 17:11:56 +0100") References: <87pm7x5mxc.fsf@kisara.moe> <87sezeitkj.fsf@kisara.moe> Date: Mon, 22 Apr 2024 08:44:15 +0800 Message-ID: <87sezegra8.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.22256 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 689 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mohsin Kaleem writes: > CLOSES bug#62994 This is not the proper manner of specifying bug numbers relating to a change. Place it immediately after the most relevant (in your judgment) item in the log entry, e.g.: * src/foo.c (pertinent_function): Adjust for something. (bug#62994) > * src/xterm.c (x_draw_glyph_string): Updated to use renamed > FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type > enumerations. This change should be accompanied by like updates to *_draw_glyph_string and related functions in the remaining terminal backends. Last but not least, are there terminal emulators besides Kitty that support these underline styles? From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v7] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2024 06:02:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Po Lu , Jim Porter Cc: mohkale@kisara.moe, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171376571532615 (code B ref 62994); Mon, 22 Apr 2024 06:02:04 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2024 06:01:55 +0000 Received: from localhost ([127.0.0.1]:45510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rymkU-0008Ty-Ak for submit@debbugs.gnu.org; Mon, 22 Apr 2024 02:01:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rymkS-0008Sl-0Y for 62994@debbugs.gnu.org; Mon, 22 Apr 2024 02:01:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rymk6-0007UR-DY; Mon, 22 Apr 2024 02:01:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xlJtvYY7vP+fTx65LZOFb4mcKJ7RZBB5B/oiWt4spL8=; b=U9VCkwso8NOw OOdq1M+b5afbW9UbPmh4MvlGUPcNLTUR8KnP6EFMppsdIC4zt7ST1ABU1FrhFQgSNDu1fwNVbeM+3 qIoXvepyuNNNVdPfGLx4j33eQWSV1gatAaCkOZBkhhJZS79qh73P9z2T3XqBWISpcQf2JR9H9kCRe lrE0P4ZgwnOHoKkTjYLckHsv7ldtUC3A13OhISf8tQn5Dk3DiVAwjx/GzvVVl4VZ91J/aUg6pKXiR Gu12JDg1j1DrC9sNfJHoSdBZQ38A/KxRgu5P+aKZPMKsJZo6xHYaiydEnjPTaJhgV6QdErcQrcT08 sg37o2SN7aTVp4nnnndiqQ==; Date: Mon, 22 Apr 2024 09:01:28 +0300 Message-Id: <86bk626imf.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87sezegra8.fsf@yahoo.com> (bug-gnu-emacs@gnu.org) References: <87pm7x5mxc.fsf@kisara.moe> <87sezeitkj.fsf@kisara.moe> <87sezegra8.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 62994@debbugs.gnu.org > Date: Mon, 22 Apr 2024 08:44:15 +0800 > From: Po Lu via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > * src/xterm.c (x_draw_glyph_string): Updated to use renamed > > FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type > > enumerations. > > This change should be accompanied by like updates to *_draw_glyph_string > and related functions in the remaining terminal backends. I believe Jim Porter wanted to work on that. Jim, have you made any progress in this matter? In any case, given that implementing this for GUI displays should not be a problem, I don't see a reason to block this changeset until the GUI parts are done. Hopefully, Jim or someone else will get it ready soon. Thanks. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v7] Add support for colored and styled underlines on tty frames Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2024 17:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , Po Lu Cc: mohkale@kisara.moe, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17138073829554 (code B ref 62994); Mon, 22 Apr 2024 17:37:02 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2024 17:36:22 +0000 Received: from localhost ([127.0.0.1]:46981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryxaY-0002U2-8v for submit@debbugs.gnu.org; Mon, 22 Apr 2024 13:36:22 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:49214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryxaU-0002T1-MI for 62994@debbugs.gnu.org; Mon, 22 Apr 2024 13:36:19 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2a564ca6f67so3893535a91.2 for <62994@debbugs.gnu.org>; Mon, 22 Apr 2024 10:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713807357; x=1714412157; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=w2TUOO4RDRRGwnwMSm0BgdP39KqFNsVlCZ4A/LkKCM4=; b=Qgp120jr7U6IOoGO1buIlmsPDY7rNOqa+tc/SktHkKWbvkNFEVJyM+UxtNGbJQO231 feiwpl+guLgGb85AqKYx/QublCrepqqAzigDDGrGwF6w4zOiozzi8V4/VzlOLym5ePu7 H3tDx5HwN4X8DNe79uqtFuzGJLvQrMZK6/UNMYc2a2Dv5EiGbWGZKcXFdEIzwnXlMB11 il4br2bzCfgD9DngXpoWirh4XqUTt2sh0Cy/rtDGtRcm7poN89jxGWNnCRmXhMzSJc0B rHSNzA7/m+thC2MTNV4dB38GlESWn8wq+lR6OIg/DNBEmhrIzI9DF/Vefwy1ukH85R5i c5hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713807357; x=1714412157; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w2TUOO4RDRRGwnwMSm0BgdP39KqFNsVlCZ4A/LkKCM4=; b=vSDoiiymPwCGV7XQCkyg02QMuYX3bGtXRwO58PFRl6HnulAFH+Fp/pe12Ds+r9WbuL 7c6WVTjm80wNJGbWyWLq/hWQ4cIoDvVh2+dIK1LkYJteTqizZMrjXFezzyJlQ/xgsanG 8kqG9ZcpjE272jEI7RinX6guCfkwqKKbJPvzlTSepLVW+lSNDTxhOHy+neBKw4xvKUR6 fGeXYH5GlSy4sbvP8/ITSMfjwFrPLaWsuNH3SrxZEAVr5G/6yjc/N43uUb90DbU/wymc MGgy2eOXBYQqeLZlN54L0JOuVzWLa29o+PkOwn9hdnLYohR+qIASCPQ0F6Wj47cZ4Fuz oFCA== X-Forwarded-Encrypted: i=1; AJvYcCWkFQxqPbrUlNb0c7aubMZ2iZfR957dXOvNKP7VcZU2E0BrfUPeyF3QoXybf77YRNPNGFqkeEKyd1lMCemxvZv87Og4vgY= X-Gm-Message-State: AOJu0YxlOr2dII3fzOuZBMMZHfuiGna9+3Lw/6RRdceESWAtbLyaQwK5 5SY2Lg3j8M179QzmajqRD6ExFM00S18L/zxbAR3CAkC8pGz6Od8n X-Google-Smtp-Source: AGHT+IG4SC6ytj7thJeUpO7ATO2iAK2bBNmzURW4fhcvSiFxSmp4t3BNppuqBSyyszD9e5FBGloWag== X-Received: by 2002:a17:90a:fb95:b0:2a6:ab52:84a1 with SMTP id cp21-20020a17090afb9500b002a6ab5284a1mr10392563pjb.21.1713807356815; Mon, 22 Apr 2024 10:35:56 -0700 (PDT) Received: from [192.168.1.2] ([76.168.148.233]) by smtp.googlemail.com with ESMTPSA id f9-20020a17090a638900b002a22c8e99afsm8045519pjj.12.2024.04.22.10.35.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Apr 2024 10:35:56 -0700 (PDT) Message-ID: Date: Mon, 22 Apr 2024 10:35:57 -0700 MIME-Version: 1.0 Content-Language: en-US References: <87pm7x5mxc.fsf@kisara.moe> <87sezeitkj.fsf@kisara.moe> <87sezegra8.fsf@yahoo.com> <86bk626imf.fsf@gnu.org> From: Jim Porter In-Reply-To: <86bk626imf.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 4/21/2024 11:01 PM, Eli Zaretskii wrote: >> Cc: 62994@debbugs.gnu.org >> Date: Mon, 22 Apr 2024 08:44:15 +0800 >> From: Po Lu via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> This change should be accompanied by like updates to *_draw_glyph_string >> and related functions in the remaining terminal backends. > > I believe Jim Porter wanted to work on that. Jim, have you made any > progress in this matter? I spent some time looking at it, and I have what I think would be a reasonable path forward. Essentially, make a more-generalized form of 'x_draw_underwave' that can draw a tiled 1-bit image for the underline, and then pass the image data in as an argument. That would keep the code duplication to a minimum. I haven't gotten a working implementation of this idea yet though, since I've been very busy with non-Emacs things. If someone else is itching to work on this, go for it. Otherwise, I should have a lot more free time by May. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v7] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2024 17:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Po Lu Cc: 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171380837216412 (code B ref 62994); Mon, 22 Apr 2024 17:53:02 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2024 17:52:52 +0000 Received: from localhost ([127.0.0.1]:47049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryxqV-0004Ge-TV for submit@debbugs.gnu.org; Mon, 22 Apr 2024 13:52:52 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:33670 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryxqS-0004Fm-MU for 62994@debbugs.gnu.org; Mon, 22 Apr 2024 13:52:50 -0400 Received: from mk-desktop (bcde7b88.skybroadband.com [188.222.123.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 38A3FA2796; Mon, 22 Apr 2024 19:52:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1713808350; bh=CnORsQj7qWRlrlFD/+gxygbY7O61ICwo4uKW764LW58=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FK2Jl0uXn+jQXPMukFdpI3iWcv9LZj7WTsRcIXBP0meXgpDXkdfkITCKjkhWjfXZ0 wIu0A6lovz/JyzAnf0kWU3JNJTkQvo2I0SI/tUaYwXWjG+0k+iVJddtKSMavqSKW+w N+O8Eqo/3UWdpx2ZJVGiJFaeQzd52sKxWkaFR+mC8byNPAZiQPfbY4L6G4IDHkCmsz 1reIAYFFKZUpIh2+NIYkOPUHu/DQ6ameb6yaCWsIzjT8TPoybh9DuvGjLluKp2F0ZM QQUi3fMctt+aq1K6CsT/ZfoyDlInRbtFse/8+/q7McyDjSHaxherSekP7h5v19ibsG rvh6eG8x3erxg== From: Mohsin Kaleem In-Reply-To: <87sezegra8.fsf@yahoo.com> References: <87pm7x5mxc.fsf@kisara.moe> <87sezeitkj.fsf@kisara.moe> <87sezegra8.fsf@yahoo.com> Date: Mon, 22 Apr 2024 18:52:27 +0100 Message-ID: <87pluhi8tg.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Po Lu writes: > This is not the proper manner of specifying bug numbers relating to a > change. Place it immediately after the most relevant (in your judgment) > item in the log entry, e.g.: > > * src/foo.c (pertinent_function): Adjust for something. > (bug#62994) I've moved it to after another section. Will resubmit patch. >> * src/xterm.c (x_draw_glyph_string): Updated to use renamed >> FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type >> enumerations. > > This change should be accompanied by like updates to *_draw_glyph_string > and related functions in the remaining terminal backends. Based on Elis comments I don't think is a hard requirement. I'll defer this to Jim or anyone else who considers it a priority if that's ok :-). > > Last but not least, are there terminal emulators besides Kitty that > support these underline styles? I haven't tested exhaustively, although I listed 2 others in the NEWS file. That being st (through a custom patch) and libvte. Personally I use st so that was my primary motivation in adopting this. -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v8] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2024 17:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 62994@debbugs.gnu.org Cc: Po Lu , Jim Porter , Eli Zaretskii Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171380845617010 (code B ref 62994); Mon, 22 Apr 2024 17:55:01 +0000 Received: (at 62994) by debbugs.gnu.org; 22 Apr 2024 17:54:16 +0000 Received: from localhost ([127.0.0.1]:47058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryxro-0004Pp-BO for submit@debbugs.gnu.org; Mon, 22 Apr 2024 13:54:16 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:56722 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryxrl-0004PD-9a for 62994@debbugs.gnu.org; Mon, 22 Apr 2024 13:54:10 -0400 Received: from mk-desktop (bcde7b88.skybroadband.com [188.222.123.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id A4626A2796; Mon, 22 Apr 2024 19:53:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1713808432; bh=hBGO0VWIBCose7UNMVHg8Y/9AENqAk8PuUT6VkCSnUo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=EZIjrOti2DxRTejEjyDIgt+NsGMkzVDl6o1jn5vDmQ/osR8IIq/C1nvDDZWfdVqob xZ0vcE0wrcFZhX82Y5NwelQVLWoR3JwdReYvWWqH/bqAQ/iszsj2hWg8wHmrKt0yi9 L6YIJKTssY4TchyRQJPisj6aKlsPSc8s/TL8eDwzKUrkLm6rKgXnz4jQHHViNXrGx8 D0W04k2FXq5p29lMPVuiFl9c7kFeddYkkih1fqDutYx+4bbqNEpcqCNrbxOoSCsRvv KZ9wV7e2skPhUK5VuSLA5Ua612UgDouULQNV4u0MjPr9U/Q/lpxAA+nM5yFGS6OWvy LzhI9pG6yJdug== From: Mohsin Kaleem In-Reply-To: References: <87pm7x5mxc.fsf@kisara.moe> Date: Mon, 22 Apr 2024 18:53:52 +0100 Message-ID: <87mspli8r3.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: help-debbugs@gnu.org (GNU bug Tracking System) writes: From b0b6d024fb66dad9027129e4dabe70d765d36b59 Mon Sep 17 00:00:00 2001 From: Mohsin Kaleem Date: Thu, 20 Apr 2023 22:30:12 +0100 Subject: Add support for colored and styled underl [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL blocklist [URIs: sw.kovidgoyal.net] 0.6 URIBL_SBL Contains an URL's NS IP listed in the Spamhaus SBL blocklist [URIs: sw.kovidgoyal.net] 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.1 (/) --=-=-= Content-Type: text/plain help-debbugs@gnu.org (GNU bug Tracking System) writes: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v8-0001-Add-support-for-colored-and-styled-underlines-on-.patch >From b0b6d024fb66dad9027129e4dabe70d765d36b59 Mon Sep 17 00:00:00 2001 From: Mohsin Kaleem Date: Thu, 20 Apr 2023 22:30:12 +0100 Subject: 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. --- doc/lispref/display.texi | 15 ++-- etc/NEWS | 16 ++++ lisp/cus-face.el | 5 +- src/dispextern.h | 12 ++- src/term.c | 50 +++++++++++- src/termchar.h | 7 ++ src/xfaces.c | 159 ++++++++++++++++++++++++++++++++------- src/xterm.c | 6 +- 8 files changed, 225 insertions(+), 45 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index fba15578f4f..8425aa23422 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2685,12 +2685,15 @@ Face Attributes @var{color} is either a string, or the symbol @code{foreground-color}, meaning the foreground color of the face. Omitting the attribute @code{:color} means to use the foreground color of the face. -@var{style} should be a symbol @code{line} or @code{wave}, meaning to -use a straight or wavy line. Omitting the attribute @code{:style} -means to use a straight line. @var{position}, if non-@code{nil}, means to -display the underline at the descent of the text, instead of at the -baseline level. If it is a number, then it specifies the amount of -pixels above the descent to display the underline. +@var{style} is a symbol which sets the line-style to of the underline. +It should be one of @code{line}, @code{double-line}, @code{wave}, +@code{dots}, or @code{dashes}. GUI frames only support @code{line} and +@code{wave}. Terminal frames can support all aforementioned underline +styles. Omitting the attribute @code{:style} means to use a straight +line. @var{position}, if non-@code{nil}, means to display the underline +at the descent of the text, instead of at the baseline level. If it is +a number, then it specifies the amount of pixels above the descent to +display the underline. @end table @cindex overlined text diff --git a/etc/NEWS b/etc/NEWS index bc8be557711..7926f34f85a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -424,6 +424,22 @@ Use 'TAB' in the minibuffer to show or hide the password. Likewise, there is an icon on the mode-line, which toggles the visibility of the password when clicking with 'mouse-1'. +** Terminal Emacs + +--- +*** 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 or a color other than the foreground-color. +The available underline styles for TTY frames are 'single', +'double-line', 'wave', 'dots, and 'dashes'. These are currently +supported by Kitty, libvte, and st (through the undercurl patch) among +other terminals. + * Editing Changes in Emacs 30.1 diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 47afa841f5e..d0a1a66e29f 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -141,7 +141,10 @@ custom-face-attributes (const :format "" :value :style) (choice :tag "Style" (const :tag "Line" line) - (const :tag "Wave" wave)) + (const :tag "Double line" double-line) + (const :tag "Wave" wave) + (const :tag "Dots" dots) + (const :tag "Dashes" dashes)) (const :format "" :value :position) (choice :tag "Position" (const :tag "At Default Position" nil) diff --git a/src/dispextern.h b/src/dispextern.h index f29377f3596..fc5e53bb055 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1690,9 +1690,13 @@ #define FONT_TOO_HIGH(ft) \ enum face_underline_type { + /* Note: Order matches the order of the Smulx terminfo extension. */ FACE_NO_UNDERLINE = 0, - FACE_UNDER_LINE, - FACE_UNDER_WAVE + FACE_UNDERLINE_SINGLE, + FACE_UNDERLINE_DOUBLE_LINE, + FACE_UNDERLINE_WAVE, + FACE_UNDERLINE_DOTS, + FACE_UNDERLINE_DASHES, }; /* Structure describing a realized face. @@ -1776,7 +1780,7 @@ #define FONT_TOO_HIGH(ft) \ ENUM_BF (face_box_type) box : 2; /* Style of underlining. */ - ENUM_BF (face_underline_type) underline : 2; + ENUM_BF (face_underline_type) underline : 3; /* If `box' above specifies a 3D type, true means use box_color for drawing shadows. */ @@ -1808,7 +1812,6 @@ #define FONT_TOO_HIGH(ft) \ string meaning the default color of the TTY. */ bool_bf tty_bold_p : 1; bool_bf tty_italic_p : 1; - bool_bf tty_underline_p : 1; bool_bf tty_reverse_p : 1; bool_bf tty_strike_through_p : 1; @@ -3426,6 +3429,7 @@ #define TTY_CAP_BOLD 0x04 #define TTY_CAP_DIM 0x08 #define TTY_CAP_ITALIC 0x10 #define TTY_CAP_STRIKE_THROUGH 0x20 +#define TTY_CAP_UNDERLINE_STYLED (0x32 & TTY_CAP_UNDERLINE) /*********************************************************************** diff --git a/src/term.c b/src/term.c index 3fa244be824..a0baf544897 100644 --- a/src/term.c +++ b/src/term.c @@ -2014,8 +2014,19 @@ turn_on_face (struct frame *f, int face_id) OUTPUT1 (tty, tty->TS_enter_dim_mode); } - if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) - OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + if (face->underline && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) + { + if (face->underline == FACE_UNDERLINE_SINGLE + || !tty->TF_set_underline_style) + OUTPUT1_IF (tty, tty->TS_enter_underline_mode); + else if (tty->TF_set_underline_style) + { + char *p; + p = tparam (tty->TF_set_underline_style, NULL, 0, face->underline, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } + } if (face->tty_strike_through_p && MAY_USE_WITH_COLORS_P (tty, NC_STRIKE_THROUGH)) @@ -2041,6 +2052,14 @@ turn_on_face (struct frame *f, int face_id) OUTPUT (tty, p); xfree (p); } + + ts = tty->TF_set_underline_color; + if (ts && face->underline_color) + { + p = tparam (ts, NULL, 0, face->underline_color, 0, 0, 0); + OUTPUT (tty, p); + xfree (p); + } } } @@ -2061,7 +2080,7 @@ turn_off_face (struct frame *f, int face_id) if (face->tty_bold_p || face->tty_italic_p || face->tty_reverse_p - || face->tty_underline_p + || face->underline || face->tty_strike_through_p) { OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); @@ -2073,7 +2092,7 @@ turn_off_face (struct frame *f, int face_id) { /* If we don't have "me" we can only have those appearances that have exit sequences defined. */ - if (face->tty_underline_p) + if (face->underline) OUTPUT_IF (tty, tty->TS_exit_underline_mode); } @@ -2104,6 +2123,9 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); + TTY_CAPABLE_P_TRY (tty, + TTY_CAP_UNDERLINE_STYLED, tty->TF_set_underline_style, + NC_UNDERLINE); TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); TTY_CAPABLE_P_TRY (tty, @@ -4360,6 +4382,26 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TF_underscore = tgetflag ("ul"); tty->TF_teleray = tgetflag ("xt"); + /* Styled underlines. Support for this is provided either by the + escape sequence in Smulx or the Su flag. The latter results in a + common default escape sequence and is not recommended. */ +#ifdef TERMINFO + tty->TF_set_underline_style = tigetstr ("Smulx"); + if (tty->TF_set_underline_style == (char *) (intptr_t) -1) + tty->TF_set_underline_style = NULL; +#else + tty->TF_set_underline_style = tgetstr ("Smulx", address); +#endif + if (!tty->TF_set_underline_style && tgetflag ("Su")) + /* Default to the kitty escape sequence. See + https://sw.kovidgoyal.net/kitty/underlines/. */ + tty->TF_set_underline_style = "\x1b[4:%p1%dm"; + + if (tty->TF_set_underline_style) + /* Standard escape sequence to set the underline color. + Requires a single parameter, the color index. */ + tty->TF_set_underline_color = "\x1b[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm"; + #else /* DOS_NT */ #ifdef WINDOWSNT { diff --git a/src/termchar.h b/src/termchar.h index 2d845107e11..a1df5a19518 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -171,6 +171,13 @@ #define EMACS_TERMCHAR_H non-blank position. Must clear before writing _. */ int TF_teleray; /* termcap xt flag: many weird consequences. For t1061. */ + const char *TF_set_underline_style; /* termcap Smulx entry: Switches the underline + style based on the parameter. Param should + be one of: 0 (none), 1 (straight), 2 (double-line), + 3 (wave), 4 (dots), or 5 (dashes). */ + const char *TF_set_underline_color; /* Enabled when TF_set_underline_style is set: + Sets the color of the underline. Accepts a + single parameter, the color index. */ int RPov; /* # chars to start a TS_repeat */ diff --git a/src/xfaces.c b/src/xfaces.c index d4583e1a78f..649c65bef8f 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3311,7 +3311,11 @@ DEFUN ("internal-set-lisp-face-attribute", Finternal_set_lisp_face_attribute, } else if (EQ (key, QCstyle) - && !(EQ (val, Qline) || EQ (val, Qwave))) + && !(EQ (val, Qline) + || EQ (val, Qdouble_line) + || EQ (val, Qwave) + || EQ (val, Qdots) + || EQ (val, Qdashes))) { valid_p = false; break; @@ -5275,6 +5279,7 @@ gui_supports_face_attributes_p (struct frame *f, Lisp_Object attrs[LFACE_VECTOR_SIZE], struct face *def_face) { + Lisp_Object val; Lisp_Object *def_attrs = def_face->lface; Lisp_Object lattrs[LFACE_VECTOR_SIZE]; @@ -5369,6 +5374,14 @@ gui_supports_face_attributes_p (struct frame *f, return false; } + /* Check supported underline styles. */ + val = attrs[LFACE_UNDERLINE_INDEX]; + if (!UNSPECIFIEDP (val) + && EQ (CAR_SAFE (val), QCstyle) + && !(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))) + return false; /* Unsupported underline style. */ + /* Everything checks out, this face is supported. */ return true; } @@ -5462,9 +5475,18 @@ tty_supports_face_attributes_p (struct frame *f, if (!UNSPECIFIEDP (val)) { if (STRINGP (val)) - return false; /* ttys can't use colored underlines */ - else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) - return false; /* ttys can't use wave underlines */ + test_caps |= TTY_CAP_UNDERLINE_STYLED; + else if (EQ (CAR_SAFE (val), QCstyle)) + { + if (!(EQ (CAR_SAFE (CDR_SAFE (val)), Qline) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdouble_line) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qwave) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdots) + || EQ (CAR_SAFE (CDR_SAFE (val)), Qdashes))) + return false; /* Face uses an unsupported underline style. */ + + test_caps |= TTY_CAP_UNDERLINE_STYLED; + } else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) return false; /* same as default */ else @@ -6321,7 +6343,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] if (EQ (underline, Qt)) { /* Use default color (same as foreground color). */ - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; face->underline_defaulted_p = true; face->underline_color = 0; face->underline_at_descent_line_p = false; @@ -6330,7 +6352,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] else if (STRINGP (underline)) { /* Use specified color. */ - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; face->underline_defaulted_p = false; face->underline_color = load_color (f, face, underline, @@ -6350,7 +6372,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] { /* `(:color COLOR :style STYLE)'. STYLE being one of `line' or `wave'. */ - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; face->underline_color = 0; face->underline_defaulted_p = true; face->underline_at_descent_line_p = false; @@ -6387,9 +6409,11 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] else if (EQ (keyword, QCstyle)) { if (EQ (value, Qline)) - face->underline = FACE_UNDER_LINE; + face->underline = FACE_UNDERLINE_SINGLE; else if (EQ (value, Qwave)) - face->underline = FACE_UNDER_WAVE; + face->underline = FACE_UNDERLINE_WAVE; + else + face->underline = FACE_UNDERLINE_SINGLE; } else if (EQ (keyword, QCposition)) { @@ -6440,17 +6464,18 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] } -/* Map a specified color of face FACE on frame F to a tty color index. - IDX is either LFACE_FOREGROUND_INDEX or LFACE_BACKGROUND_INDEX, and - specifies which color to map. Set *DEFAULTED to true if mapping to the +/* Map the specified color COLOR of face FACE on frame F to a tty + color index. IDX is one of LFACE_FOREGROUND_INDEX, + LFACE_BACKGROUND_INDEX or LFACE_UNDERLINE_INDEX, and specifies + which color to map. Set *DEFAULTED to true if mapping to the default foreground/background colors. */ static void -map_tty_color (struct frame *f, struct face *face, - enum lface_attribute_index idx, bool *defaulted) +map_tty_color (struct frame *f, struct face *face, Lisp_Object color, + enum lface_attribute_index idx, bool *defaulted) { - Lisp_Object frame, color, def; - bool foreground_p = idx == LFACE_FOREGROUND_INDEX; + Lisp_Object frame, def; + bool foreground_p = idx != LFACE_BACKGROUND_INDEX; unsigned long default_pixel = foreground_p ? FACE_TTY_DEFAULT_FG_COLOR : FACE_TTY_DEFAULT_BG_COLOR; unsigned long pixel = default_pixel; @@ -6459,10 +6484,11 @@ map_tty_color (struct frame *f, struct face *face, foreground_p ? FACE_TTY_DEFAULT_BG_COLOR : FACE_TTY_DEFAULT_FG_COLOR; #endif - eassert (idx == LFACE_FOREGROUND_INDEX || idx == LFACE_BACKGROUND_INDEX); + eassert (idx == LFACE_FOREGROUND_INDEX + || idx == LFACE_BACKGROUND_INDEX + || idx == LFACE_UNDERLINE_INDEX); XSETFRAME (frame, f); - color = face->lface[idx]; if (STRINGP (color) && SCHARS (color) @@ -6507,13 +6533,21 @@ map_tty_color (struct frame *f, struct face *face, #endif /* MSDOS */ } - if (foreground_p) - face->foreground = pixel; - else - face->background = pixel; + switch (idx) + { + case LFACE_FOREGROUND_INDEX: + face->foreground = pixel; + break; + case LFACE_UNDERLINE_INDEX: + face->underline_color = pixel; + break; + case LFACE_BACKGROUND_INDEX: + default: + face->background = pixel; + break; + } } - /* Realize the fully-specified face with attributes ATTRS in face cache CACHE for ASCII characters. Do it for TTY frame CACHE->f. Value is a pointer to the newly created realized face. */ @@ -6524,6 +6558,7 @@ realize_tty_face (struct face_cache *cache, { struct face *face; int weight, slant; + Lisp_Object underline; bool face_colors_defaulted = false; struct frame *f = cache->f; @@ -6543,16 +6578,83 @@ realize_tty_face (struct face_cache *cache, face->tty_bold_p = true; if (slant != 100) face->tty_italic_p = true; - if (!NILP (attrs[LFACE_UNDERLINE_INDEX])) - face->tty_underline_p = true; if (!NILP (attrs[LFACE_INVERSE_INDEX])) face->tty_reverse_p = true; if (!NILP (attrs[LFACE_STRIKE_THROUGH_INDEX])) face->tty_strike_through_p = true; + /* Text underline. */ + underline = attrs[LFACE_UNDERLINE_INDEX]; + if (NILP (underline)) + { + face->underline = FACE_NO_UNDERLINE; + face->underline_color = 0; + } + else if (EQ (underline, Qt)) + { + face->underline = FACE_UNDERLINE_SINGLE; + face->underline_color = 0; + } + else if (STRINGP (underline)) + { + face->underline = FACE_UNDERLINE_SINGLE; + bool underline_color_defaulted; + map_tty_color (f, face, underline, LFACE_UNDERLINE_INDEX, + &underline_color_defaulted); + } + else if (CONSP (underline)) + { + /* `(:color COLOR :style STYLE)'. + STYLE being one of `line', `double-line', `wave', `dots' or `dashes'. */ + face->underline = FACE_UNDERLINE_SINGLE; + face->underline_color = 0; + + while (CONSP (underline)) + { + Lisp_Object keyword, value; + + keyword = XCAR (underline); + underline = XCDR (underline); + + if (!CONSP (underline)) + break; + value = XCAR (underline); + underline = XCDR (underline); + + if (EQ (keyword, QCcolor)) + { + if (EQ (value, Qforeground_color)) + face->underline_color = 0; + else if (STRINGP (value)) + { + bool underline_color_defaulted; + map_tty_color (f, face, value, LFACE_UNDERLINE_INDEX, + &underline_color_defaulted); + } + } + else if (EQ (keyword, QCstyle)) + { + if (EQ (value, Qline)) + face->underline = FACE_UNDERLINE_SINGLE; + else if (EQ (value, Qdouble_line)) + face->underline = FACE_UNDERLINE_DOUBLE_LINE; + else if (EQ (value, Qwave)) + face->underline = FACE_UNDERLINE_WAVE; + else if (EQ (value, Qdots)) + face->underline = FACE_UNDERLINE_DOTS; + else if (EQ (value, Qdashes)) + face->underline = FACE_UNDERLINE_DASHES; + else + face->underline = FACE_UNDERLINE_SINGLE; + } + } + } + /* Map color names to color indices. */ - map_tty_color (f, face, LFACE_FOREGROUND_INDEX, &face_colors_defaulted); - map_tty_color (f, face, LFACE_BACKGROUND_INDEX, &face_colors_defaulted); + map_tty_color (f, face, face->lface[LFACE_FOREGROUND_INDEX], + LFACE_FOREGROUND_INDEX, &face_colors_defaulted); + map_tty_color (f, face, face->lface[LFACE_BACKGROUND_INDEX], + LFACE_BACKGROUND_INDEX, &face_colors_defaulted); /* Swap colors if face is inverse-video. If the colors are taken from the frame colors, they are already inverted, since the @@ -7238,6 +7340,9 @@ syms_of_xfaces (void) DEFSYM (QCposition, ":position"); DEFSYM (Qline, "line"); DEFSYM (Qwave, "wave"); + DEFSYM (Qdouble_line, "double-line"); + DEFSYM (Qdots, "dots"); + DEFSYM (Qdashes, "dashes"); DEFSYM (Qreleased_button, "released-button"); DEFSYM (Qpressed_button, "pressed-button"); DEFSYM (Qflat_button, "flat-button"); diff --git a/src/xterm.c b/src/xterm.c index e08ffd15b18..360541ac0b9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10957,7 +10957,7 @@ x_draw_glyph_string (struct glyph_string *s) /* Draw underline. */ if (s->face->underline) { - if (s->face->underline == FACE_UNDER_WAVE) + if (s->face->underline == FACE_UNDERLINE_WAVE) { if (s->face->underline_defaulted_p) x_draw_underwave (s, decoration_width); @@ -10971,13 +10971,13 @@ x_draw_glyph_string (struct glyph_string *s) XSetForeground (display, s->gc, xgcv.foreground); } } - else if (s->face->underline == FACE_UNDER_LINE) + else if (s->face->underline == FACE_UNDERLINE_SINGLE) { unsigned long thickness, position; int y; if (s->prev - && s->prev->face->underline == FACE_UNDER_LINE + && s->prev->face->underline == FACE_UNDERLINE_SINGLE && (s->prev->face->underline_at_descent_line_p == s->face->underline_at_descent_line_p) && (s->prev->face->underline_pixels_above_descent_line -- 2.44.0 --=-=-= Content-Type: text/plain -- Mohsin Kaleem --=-=-=-- From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v7] Add support for colored and styled underlines on tty frames Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Apr 2024 00:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Jim Porter , 62994@debbugs.gnu.org, mohkale@kisara.moe Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171383362310181 (code B ref 62994); Tue, 23 Apr 2024 00:54:02 +0000 Received: (at 62994) by debbugs.gnu.org; 23 Apr 2024 00:53:43 +0000 Received: from localhost ([127.0.0.1]:48811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rz4Pm-0002e9-Nu for submit@debbugs.gnu.org; Mon, 22 Apr 2024 20:53:43 -0400 Received: from sonic302-22.consmr.mail.ne1.yahoo.com ([66.163.186.148]:44183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rz4Pk-0002d0-0t for 62994@debbugs.gnu.org; Mon, 22 Apr 2024 20:53:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713833598; bh=TAX02gVkueZnrY6ZZdW7IlUKai+uaMXKPz5tDOw2lok=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=gSwLJn/dQstfqwPL7gWCTh3YLzQyRmydZPqhVr0OXfXbdlcYGWSHTHMxYY/z1y/sD1w1LXKti4veS0A7HR/pK7QsnF9t07IZtTxxkizSuOdlPijmT1vBRM4JFJezTrjFR2oGS2w1H5zny9bJB5C0UCl2A0EgRCMx7WOBYIBkYHbrAEDYIXXoB8xZFymCcGGCqNFCT3+UWIGfNrelrneifiol672J5Trc+ZB0osPJyeEF1G59/W+u8EuxRHg8DSBRpANVJnAugAzd78GallIAOWMjpcJ8JqXbw1E7AsCagW9OLLKR/eT6Xj+xOTZ9He49i4kMiBfoL3HEJMhycQQkvA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713833598; bh=T98T8IdQIlg8imgs5knLR9xr6NreCmEFRmDZQeNcVt8=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=ItkqkSjpuB2ljv0/vFBBOd0zFhFx802ygLZxXr2LSyA/PzJG/VQpkM0WVq11K2xUhrlJnKq0WjwqgCh1OrcoIvST+D89P71qJ+CgkOeRIgaIlsPTpn1knHcV2B5+L9YQNRG3qeUDosTNBhvvzHchdFo7nmlm3FCU3TGXg6YE16+EsjRNxnr7YHTLqA9/uDM8fzyQKov+RmDqbPO0194DR7ZGjJiwSu1GOqCKiNIXIO5r8+8/wjexPeZWxG6uadVLKelL/kZDudeBuD0wbmSCy1qYcpOfQA9vChl92PGLUDicm6dpck+4qyzLk3PP3p5UnGN6Bxq4OfBlgSghBWhh5A== X-YMail-OSG: i1hlxCAVM1lcK8PvGzeHe9.B2RLV6jP5wCJ3kCKwPY2V9mfeWda.R45oM0Wa_EM CW66d57R2UWUfkuuqA_iJ7J4Juulx1J2RwferfdP9C3TxobLLch5SNtrmIBueAcWq4ogLv8Wp6Rj 0jr62xdDM0IYRc4aPaU_Z9mKf456WriSOIhm76gbkp0xW.ZlllhsZ8R8nSDMCzyWgFjY8BQxUulI ReaEFaljfg3HuYbWYCY6fa2R0XQFujCzvTS6YuSx9KThdPzt.9kTHUW9ItDzknGlyZakPHNO4mMu HPas2J0xxZ_ltTSv1cwqWaXDUtkwX4wtdTnM3wOkZCe1Cs5tumUy7.FQwaaTI8p2ZcJzABRDucYm kJIncPRdCZWSgmWTn1gKLaOGQab2vVf2hdZcyvCzFeqS5lgxcjDqc0xfupGzA3ldcfYXJ46DDpFB sECCN0458AK7S_Q6cjCrPKrzbxeNBooivMFvE7kAFeWlmf4iW5ZPblbNqMotrSzBD1c8CdIhEv4Q 8auamQ.rQ1iirWB9uExYS3Kt2IbzAh950ddSUajjO0rtDYBZNYd6Ym18O5bzMU2xDpBQSfV_q9Ah sw201G3lJtX9rLb6cKPFz13D_8FS1LDBAWaKsMoNzDx4ZfpK2imi6ZJ3gPHt61WEC0Mg0OjoJLym GHejLd3RuHv329hmcYKl4_dPDgC6BZo.kDn5QtiesMIxjiY7u.rU1MGpQGusBRabVwtBp_wzpWbi LPSnH_NMLk4zEIemZDafykwvHIvnZI0OPPudN8wj9ViTHAO607HRN7yF2j75kCcyWFgfXkAaqDLH nOGVSkDG8nSMU1vezWGtQmJ2ZXdJjdiBvBLpiupFwtXb_doEROLoLlDKUZbp4X3D1Q4OfPr4Oto2 .FgPp5ip3B2PXWwV.2_CqrxIrdhNLw8yneHU_K5dtulkzHfJQcZlyfB29ILFdfmIJWr4AUXj4Q8E WHInYcIh0yU3.0I3K20sZqsN10k4nyqRG6K1ZWICKIvK8tHgGJTwqAZp.5fastdfxhaljCWUM0YH fDBqOnXE4zjTjyGDJ6StliaAter1W1kU10jJgiwBBiVe2XobmafKpao4R.ty9TB0ft.thnEyelXR x9AGK7d2VzovZT.hBIqwvPOcIhgT.ogETj4lSYOA5kow._kRslxdVfGLcMDbT8svKLsNsPkVytdX Y3gXvSTn9e5SWtT.7RVvtfgC9lnZRAy2lnwtgkktxmpkEYrs0xaKptKDXJK..8OScE3.14aA5Ls6 fl_YQ0y1pN2ofKj64Nc3jtpnd42LknBMCpVWtjVSECHBPCLOXROe0.1mytG.ownsuQXrnRrDtA5T 17DBmyCytR0xM8TpLSvcemqAmdaV.flv_X4z1IfuTyfVXxTc9ROYB9GnMnZdtPITe4A_cCaDadmf f.wPHHBDaer0i3QKgO71DJ3TutXXbOo3F9_ltEPuegsQNyO8zDrlq3dSSZHvOvI6ZEZlapBjM5e9 vlnv.9RntkG2vN5MWLUAGauM9C00MqWFXvfm88jhoZs5DH.wfqh.DPE40Sq04QPcBVM1aYj3y0_o FfQ2oDzjybve_l7lMO2YufQvC2Tew9ePdmyOMfoS5T0XyxkFPOHa1Y8GN0O5jokthshhHfYnxbmC Sy2.apIm9QnlSG9FKBDXuHu.f4fC2aFfRM2.qLMMuzlJSWJ5pPt04qRNqIc6jdcLunJN5r8EYyIH qr0g93GZ21kEiMPHHCnpz9mp5HG.0Wj3HO.k8gn20Xe5YyEmq4jAFMWpTEeVSKPmghixVx54diBL FC7VspPFg1Bib_jCdCnW32KYJcWS4lPb6OwEIaxJsevNAAb_8R6YQ9LKtKAGP9aaADuQj7vnfxsL RtKB3qneRR2oFkFhMAuvxvdGAEe2l8trhXLcCYQrLZ5Jn5_WVwSzYqxlhfuAe_EZtzP5rGhlYO_U NLxwxNU.w.wk0Y5LsC9XXr5nQkMLzqbej7hG2pozsRdXWnWFi1E1T4kSs72TJj.Rw3C.r7Vvm_IJ .xmTfBzcIuFTQnCx9kzz6.Mq06cHiP5YTo.WGG_JsdCEvj5sBL5tiPBJM0sDKF6wRX1awQA5uTru ED7usn5bGWYyEdXea3nIKbW.IfhXDL1J7NNZaE9wuKB0nU7Et7cpLzquAwHLF66EjcndT.sRRldB y_dP0hvYGu3N63zWK_go9uZz_WLaHGDMkDBv5znF96ha5X9f2iP4_ABr_R2VblIdVIEJBlkNyzCJ yC97zlNEJ6ZZFLHov1te9GtzsMCzC8Q-- X-Sonic-MF: X-Sonic-ID: d9d998bb-20a9-4ca6-9395-f07f4d537b17 Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Tue, 23 Apr 2024 00:53:18 +0000 Received: by hermes--production-sg3-6f9f87bd85-qljs5 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b00f3bc68f88858e33dc0daf2a8bfece; Tue, 23 Apr 2024 00:53:15 +0000 (UTC) From: Po Lu In-Reply-To: <86bk626imf.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 22 Apr 2024 09:01:28 +0300") References: <87pm7x5mxc.fsf@kisara.moe> <87sezeitkj.fsf@kisara.moe> <87sezegra8.fsf@yahoo.com> <86bk626imf.fsf@gnu.org> Date: Tue, 23 Apr 2024 08:53:20 +0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.22256 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 1108 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Cc: 62994@debbugs.gnu.org >> Date: Mon, 22 Apr 2024 08:44:15 +0800 >> From: Po Lu via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> > * src/xterm.c (x_draw_glyph_string): Updated to use renamed >> > FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type >> > enumerations. >> >> This change should be accompanied by like updates to >> *_draw_glyph_string >> and related functions in the remaining terminal backends. > > I believe Jim Porter wanted to work on that. Jim, have you made any > progress in this matter? > > In any case, given that implementing this for GUI displays should not > be a problem, I don't see a reason to block this changeset until the > GUI parts are done. Hopefully, Jim or someone else will get it ready > soon. I wasn't asking that the new underline styles be ported to other backends, but that the change to account for renamed enumerator values be ported to the remainder of the *term.[cm] files. Without which they will fail to compile, which goes without saying. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v7] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Apr 2024 06:03:11 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Po Lu , mohkale@kisara.moe Cc: jporterbugs@gmail.com, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171385217011918 (code B ref 62994); Tue, 23 Apr 2024 06:03:11 +0000 Received: (at 62994) by debbugs.gnu.org; 23 Apr 2024 06:02:50 +0000 Received: from localhost ([127.0.0.1]:50120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rz9Et-00035m-49 for submit@debbugs.gnu.org; Tue, 23 Apr 2024 02:02:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rz9En-00034K-HJ for 62994@debbugs.gnu.org; Tue, 23 Apr 2024 02:02:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rz9ER-0006Pp-EL; Tue, 23 Apr 2024 02:02:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=EFtRmp/+R+b4eycYlxZL1a61Ohrx8PeB1LLi3xPuCC4=; b=KeFrzZm11VwU 3nkQWgUvrOUdDJmWeYvEnc1UXnEcC16FEpZISv4p2JIuuP5AkQf2VQDduyVvXzP+w9k5KP8CnI2g2 3wVfdV9vpY+xFsojjcxdmWzKsGMcw3a88mzVdBtPxwPabReNijjLhvA+KyPFmgAxYUM1ABIr3rf5V pFTQp7CqLrwLXM4NcKL0L7tYo1SCsAXL2GmK6rRgBFRNQt4oGkYjRC9bzlqcVzN/ffnnL1eaJCs4w 6S4uhoHmnRMP/vKm3N8j3yKqZWN7tLxbVlFLzazfcdo356Q8cvgYzrvRefZTIooVPgM0PUkoJFfoE n5n0NtyVQ7Xz/f3whLyV/w==; Date: Tue, 23 Apr 2024 09:02:18 +0300 Message-Id: <86sezc4nx1.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Po Lu on Tue, 23 Apr 2024 08:53:20 +0800) References: <87pm7x5mxc.fsf@kisara.moe> <87sezeitkj.fsf@kisara.moe> <87sezegra8.fsf@yahoo.com> <86bk626imf.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: Jim Porter , mohkale@kisara.moe, > 62994@debbugs.gnu.org > Date: Tue, 23 Apr 2024 08:53:20 +0800 > > Eli Zaretskii writes: > > >> Cc: 62994@debbugs.gnu.org > >> Date: Mon, 22 Apr 2024 08:44:15 +0800 > >> From: Po Lu via "Bug reports for GNU Emacs, > >> the Swiss army knife of text editors" > >> > >> > * src/xterm.c (x_draw_glyph_string): Updated to use renamed > >> > FACE_UNDERLINE_SINGLE and FACE_UNDERLINE_WAVE face_underline_type > >> > enumerations. > >> > >> This change should be accompanied by like updates to > >> *_draw_glyph_string > >> and related functions in the remaining terminal backends. > > > > I believe Jim Porter wanted to work on that. Jim, have you made any > > progress in this matter? > > > > In any case, given that implementing this for GUI displays should not > > be a problem, I don't see a reason to block this changeset until the > > GUI parts are done. Hopefully, Jim or someone else will get it ready > > soon. > > I wasn't asking that the new underline styles be ported to other > backends, but that the change to account for renamed enumerator values > be ported to the remainder of the *term.[cm] files. Without which they > will fail to compile, which goes without saying. I will not install a changeset that breaks the build, rest assured. I always build Emacs after applying patches from others, so I'd know if the build is broken. I presume Mohsin builds Emacs with his changes, so unless he only builds Emacs --without-x, I presume the changes do build? Or what am I missing? From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v7] Add support for colored and styled underlines on tty frames Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Apr 2024 07:34:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: mohkale@kisara.moe, 62994@debbugs.gnu.org, jporterbugs@gmail.com Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171385760419083 (code B ref 62994); Tue, 23 Apr 2024 07:34:03 +0000 Received: (at 62994) by debbugs.gnu.org; 23 Apr 2024 07:33:24 +0000 Received: from localhost ([127.0.0.1]:50503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzAeZ-0004xj-Ra for submit@debbugs.gnu.org; Tue, 23 Apr 2024 03:33:24 -0400 Received: from sonic308-56.consmr.mail.ne1.yahoo.com ([66.163.187.31]:39548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzAeU-0004wk-CC for 62994@debbugs.gnu.org; Tue, 23 Apr 2024 03:33:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713857576; bh=PnLF2rOZLS0/BZLDYBi+qlzrlIi4j4M3LNQcKJe1vQE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=Pq7htGz7qQ9ZCflvbi9jUYnkPt9W2ggpj8Ze99pjXEDav2boIfuha0prZGDAIO/23kn+vIIWgm4+UJb7dalJhfCumKa8L5l7WGVQSfJkS9Qq0WFFqcn/5IhPCK+QmDe036X7vS+ZbO94E5je6C2gqWr0ZXy4jObD7jG6KOjXzmU3gRxrtNc2a/KmIStQox5wXS1/Cs4zzxNp75FebBf8Dic/lN9EgH9a4THiKxwqm2tNZD6uPkUsXT/aIfOiiI39+4n2LyB6wqrqo3MCDJxdIoVjJqVtGPCCzgcMcg/llESBdCHkeP/qD82oRr3V0MQJvAI1JivRzI9p9KGBIBzHXg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713857576; bh=BIW5a7h7bwlwiWf0DrqZeaScgfeIammrnnZEAYarzvm=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=OmPYmgnhngwWc9/GL6X0M/fISwxQ/b3eMMTO5+6rgsa9R0viR0A/NZCv5kbkTDWDMwyEJfCNfWbm3i+1H/HdQ98WYu0VpCz24GhxUPgWnas+e3ck7ekuyPHth8i3EqXZBpbf+nctQJkS6lcpdUU28ESDA4BRytpVGcL7LWL8UNNkHGcDiKw9GIiZjKhphVn5zSmuPcJAyKQS3TB7PaO07F0tqoYjPdK6TbPAtmUqcxNDP79FIyAQ5Z1ntCbXpkX4BLHbu/vqy3QLNTTEJ27UEPZR0FxLW1crvU2t8gE9mS2vkdimXqBkup+XSSJcT2HjIA+g0eD9PDcsu0yPzYlO2Q== X-YMail-OSG: qJnz60sVM1n3kLMuVG0PN.L3vXbrTmYLEiUh2mhDivkkqPf.GKXIT8zFD2ty97W 05dw0DWu9rVAz3id0sp35Eh5VkVcDH2t4lTTsNmXz9uI7le7XDSWF9emAl9Jgp3_57wgeWvKQ3xR pWPNqxvvPHR90P2hEzVkawY8rlIrXwp.rQBs_AmVOGaJmpuof6dlcu.2s85WhMEbf8Kx6o.MNbk_ Ao7r88isKzZT2UUOi6Hnuh11_mw5GCKfsRJeoGef9yZSWjD0fEpI92yr_nPEPLdIvUfcT7JwIPf8 NfAvGBKOXHLKqLuPNi5weKl1NeeVbCtLbHXKdAEBJZggKZ7x5lDSaJhk35XlNaLMLDKedXdGbOlI g.Gn3yid8IMQPLOZEeN4.k9bz6zOJm20imB1gYm5XLGIu0T.wEwvXPb3bPpPS9Io0a8._j8wQ0WH SW1mDXnK9NjKTawji1PXTIDPU.mJoSotO9ktwGupK9Ee0vfEo77_1TXz1PHcCXcdyOMvIKuzK9eB p94j.GGudxXyMhxm9yCa3l1xj1pFc7fn5vxQUY5B_KJaGbnEYM58v3JcZZSFsrIXYmdg.4uxecCD DEM8AMyMH5Mas6pD4Bv4gqk7Sd7Af42MPDsGUcmXTBK.KN59dWtx7v7ngR4kqb6g5j2C_R8mXZFB Hb47cKBTH753MkA.17b1V94OikaP2CeX4sz5oSRn7TuNnAHqiTXLlfUJ9jZD61OSOAEM.rx9_RDA F37pEPJSDNkdrSTfMOVE_Wwt.lBh2.IufJ22s2U_jtkmn9.FFVDW3jLWY1Y9TMKkKw_nC6dl6FRt UQR1xUgfJhNuuoqUeV8nPOqCkXxm9BxqlEHEKk4Fu717pdJtgpZGJt0gK3P6nT_WvU7F36eJTK6V Ljr0zxsKo04zsVbr4kObM.Stp4dJPFk7Du3Suejt8zaVWch3n.kyESaFZgEDwofxEYCOG6sK88_R jARhpuSUbc7QYQoH5JjfBDZJxEhXwRB3WVX_CgfcN8tQ1.yhw_CGm_Vj43h.M3eb9OrogB2ZgCEV l7NftJN_QLNLrBopelGja23EqWykxdlMdUGPjZvJPeH046qI9APaVtanhX8erSVGPR5gL9DPM1FD sMOmKZmR3rMQkxSl4FM.W8a4YZbSHXYyfOHAzS2RVSbsetQONXtsYeXP7wz8Ls.M4bG3Fef17.Q8 GVcxLfQu_ikiA0TX6tjE.yAe6Nidj7uo0KLDewlZallNr3VUt2_wW5peHyRUYm5U5ulW9WI2IwK7 T6ZxYC3H.VEKRWZfdsNVwexEGmy9FQnHSk_EGUr6Y9aETD1ZttMOEYUai011TbSB7pG55fqyhkLf vzc9RMarlA7gG9R3peEqOGyLjSa31MRxScWghe_kV3UiedBmjJEtz6kM5RaDpNrnbUoYHR2siULS gVLbEA6RMuPRZGY1UOl.xa3PI5Or6IJFuegVVHE7QyVssR7xgR1cOwfe5GIWgBB6UHJv08_CERJM yd7LYpyQFg5vef1Km2iS2k8n.88lD.XOxlTzOIk2SF2CMwF9Hd_nmNmyn151LRYkZFzO_BOUZC2P _DcbaJ1YJalWBjDXXcwZw_vJhHDbxbtLlCC.jijD4P8.5iWydgeqx8fTvF80YDLHTrLjp5jlfuVz 9eQaBnvO.qkQmbrqLcOx6I9kiQ8BubYsDb6s6soCPK1dAbNQBlA1A2VXKBLws2ZRQKmFB2guEOmx EkGYF8JEzh5DzwXezEzVWAi5bmW.0R_4656TSLAozA_mkTl.haYGCrxBwS_vMdgEFZhcj8Tv2j3F eqPztPrYFFhEOpYpyH7GSJjcf4XyPJlwWSuOzzSSKBYNTD6yjgAMw1jN1ELAxU0EoWJWFjufXZO8 cdO6aQ2zWNDkIPxHoo2Wt1_VQneTMnVRj05PPieK2dlafiHVrzCGbrTCwn06Q2bIhwV6kraN8PBm X_k1TPZ_s3A.z.ncbaTa_kzBO1Kk9M_wCUh4yr0LvzI_RKHNT.otoyefk3d8RJWKWDuI.ttRprGN 8U6uTbnRAR6C6yLHyE5YDQ2p09Ech4HDF_eZmy5LvqP54NZFcgYgoLoBGXJLLAtf2SatoTBn7D1C aeKImRsvij1P_20GomEUlLoajIwzQm.R8qjfY6X_ZCo67BsdxTK9GeniQSlLTcnDpPecY78bwkvG LooPuCaOUrDGuxtp7WdtPx40Hi7piZ3Rl36K.MBMwoxBzUPaTfQSmCW4pTBMjq6X2QB1Byo0YrjB 51NuihMb1_LYPZCVc6i7RxmXPKXxfcM8STZ7JqLIaYyZKwunjy9ax0JnXAfZ1eler X-Sonic-MF: X-Sonic-ID: 27a0dbcc-c42b-4ed2-af3f-e9c1ec90b94b Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Tue, 23 Apr 2024 07:32:56 +0000 Received: by hermes--production-sg3-6f9f87bd85-d9mmq (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 8468cf73cad71f931b0c484fe07f8c79; Tue, 23 Apr 2024 07:32:49 +0000 (UTC) From: Po Lu In-Reply-To: <86sezc4nx1.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 23 Apr 2024 09:02:18 +0300") References: <87pm7x5mxc.fsf@kisara.moe> <87sezeitkj.fsf@kisara.moe> <87sezegra8.fsf@yahoo.com> <86bk626imf.fsf@gnu.org> <86sezc4nx1.fsf@gnu.org> Date: Tue, 23 Apr 2024 15:32:40 +0800 Message-ID: <878r14h6uf.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.22256 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 522 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > I will not install a changeset that breaks the build, rest assured. I > always build Emacs after applying patches from others, so I'd know if > the build is broken. I presume Mohsin builds Emacs with his changes, > so unless he only builds Emacs --without-x, I presume the changes do > build? Or what am I missing? It will build on X, but on no other GUI configuration, since he did not update corresponding references to the renamed enumerators in the remaining *term.c files. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v8] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Apr 2024 09:13:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: luangruo@yahoo.com, jporterbugs@gmail.com, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171420914322492 (code B ref 62994); Sat, 27 Apr 2024 09:13:06 +0000 Received: (at 62994) by debbugs.gnu.org; 27 Apr 2024 09:12:23 +0000 Received: from localhost ([127.0.0.1]:38910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0e6U-0005pz-3O for submit@debbugs.gnu.org; Sat, 27 Apr 2024 05:12:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0e6J-0005nQ-S6 for 62994@debbugs.gnu.org; Sat, 27 Apr 2024 05:12:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0e5v-0001FA-15; Sat, 27 Apr 2024 05:11:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=nTWvflh0y6FlRxLNlzDu4iRweavxQD8oNr2si/MZlSE=; b=sGt2o+tXQo+k dWp0GkkVQiTd4kiZX6cCnZzIcyf187CJQ91oFRe19ERnvGEaBUGRljwws84ty5LedyQ4vogBPK+eu b6ykYrUh4HmRKRLRF2x/ax63Ut3eZ7TBU+UWOZJJ63c7SE367jFHvPTbwaDEKzp8MCEKSvRcJh/f2 +QMlk4D+ODaIPOQIYBbS4J+ubfgQGhLabzLYkn8zHhl09QZh/F/zIgv45QV/VhXJqkCIEYuMQxzqZ 9Px97GpeP43iyK37QuBUzyISQ55g3dCnzZir9yvtUNEAcy6pCbgnSP5+/bDgk3X3LuJYCvqJTewVy RgCX2jdEI/yn9fZYF2JKrg==; Date: Sat, 27 Apr 2024 12:11:39 +0300 Message-Id: <86h6fnw4ok.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87mspli8r3.fsf@kisara.moe> (message from Mohsin Kaleem on Mon, 22 Apr 2024 18:53:52 +0100) References: <87pm7x5mxc.fsf@kisara.moe> <87mspli8r3.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Cc: Po Lu , Jim Porter , Eli > Zaretskii > Date: Mon, 22 Apr 2024 18:53:52 +0100 > > >From b0b6d024fb66dad9027129e4dabe70d765d36b59 Mon Sep 17 00:00:00 2001 > From: Mohsin Kaleem > Date: Thu, 20 Apr 2023 22:30:12 +0100 > Subject: Add support for colored and styled underlines on tty frames Thanks, installed on the master branch. Jim, are you working on the GUI support for this? From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v8] Add support for colored and styled underlines on tty frames Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2024 01:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , Mohsin Kaleem Cc: luangruo@yahoo.com, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171435268029758 (code B ref 62994); Mon, 29 Apr 2024 01:05:02 +0000 Received: (at 62994) by debbugs.gnu.org; 29 Apr 2024 01:04:40 +0000 Received: from localhost ([127.0.0.1]:53891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1FRf-0007ju-Rv for submit@debbugs.gnu.org; Sun, 28 Apr 2024 21:04:40 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:57796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1FRe-0007jj-3s for 62994@debbugs.gnu.org; Sun, 28 Apr 2024 21:04:38 -0400 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5d42e7ab8a9so2041876a12.3 for <62994@debbugs.gnu.org>; Sun, 28 Apr 2024 18:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714352652; x=1714957452; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=LvTSNY47f/xCPY+F1xqzPPtoFll47QL/NbwJclHFKv4=; b=GiP5BGbn3j4Y3dYbqyySPm72sQvat1TCvykgkse0jFpmEMQUi6XSr/RvkgawMN776j Fi4/jnGy6WqCyWbyO5fRWyCQhJczAwwn7SkNPGuHzUbW1/t8R2ZAW4z5+1sXFf7hOvD/ TZR3QlnWHTtlojo9K/8PQNQoR1mkkYLN4kpEk4eYk01vjcOhDwfa38tdWvKF7h64byva lFunzHLB42XyVq2ie6+H3hSTQPijpVMJYBbQJ6pBX75sVLhO/M0A8oYJhw2rWVtuBBkf Jm3vPcHr8+4yMSQzBVanSwZyW3v/Sv33K3lZGM7kB0E2plbTdLjTf7BMIlw4CTvTvYHf Wz1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714352652; x=1714957452; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LvTSNY47f/xCPY+F1xqzPPtoFll47QL/NbwJclHFKv4=; b=mklGiEp1dcs41+4RLLotncuxhpWsAMBTpmX0hTlnorIFb5TzhQiiGo0jU9+mArtsRc 9Od7+Bmx6CIokOdyeSEzX/unzMRMLC4xAn9UDyV4HBr5oDYgno9c+9iHbxD/JV86qu0O +GSbp8tzMFmmShOZsViWG79jp/PorNnmR1jtMCCiwowxdWNsGCsKi6ttIac5tYK369jh d3upFo5os3nzVDlKZYdrbjIfv+QCob1i//W3Mx6OOqVW6J63NJj5IZIoLr9l2PZL8SnI AdPDqOmd5RTpJECgalEi7eF1qrC2PqT9juNtQ5alveBKvgVLtX6SsAh76denWNT+Amis ysuw== X-Forwarded-Encrypted: i=1; AJvYcCUxy8EdzAp0H3krvCetywBh+B2QaDOHBqrPgsnvBV/CVskDxE46G9Qk5L5nzEkB0j2rIfkX3M2B6Si4iRVyEZ5WMwbFMI8= X-Gm-Message-State: AOJu0YxUZQXF6EoDrKZjGSFGS7j2pb7pw+1azKQIL1tU9ls/tx5Rm/Bf 5aXE/P7vZfuL25hzgSd4kF8+D271qpWy3xwDSHfcVxCKizyRWVqz X-Google-Smtp-Source: AGHT+IEJBYZHrcy/6E+6uwqbRvu+lo2xxUWu3vnuwdh1RsF/WnauAlyoWnkz/DkR2dZAHiU1IQddRg== X-Received: by 2002:a05:6a21:99a6:b0:1a7:75ee:6742 with SMTP id ve38-20020a056a2199a600b001a775ee6742mr10924813pzb.2.1714352652566; Sun, 28 Apr 2024 18:04:12 -0700 (PDT) Received: from [192.168.1.2] ([23.240.98.37]) by smtp.googlemail.com with ESMTPSA id x26-20020a056a000bda00b006e6c16179dbsm18158371pfu.24.2024.04.28.18.04.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 28 Apr 2024 18:04:12 -0700 (PDT) Message-ID: <21014d25-b3cf-2d3c-2a0d-c6d47b1631be@gmail.com> Date: Sun, 28 Apr 2024 18:04:11 -0700 MIME-Version: 1.0 References: <87pm7x5mxc.fsf@kisara.moe> <87mspli8r3.fsf@kisara.moe> <86h6fnw4ok.fsf@gnu.org> Content-Language: en-US From: Jim Porter In-Reply-To: <86h6fnw4ok.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 4/27/2024 2:11 AM, Eli Zaretskii wrote: > Thanks, installed on the master branch. > > Jim, are you working on the GUI support for this? I'm back and available to work on Emacs as of today, but in the meantime, Po Lu has implemented the GUI side of this (see e844b81c56d74aa2b2efa0ce98ed3de71647e656 among others). I could take a look at an MS-Windows port, but I don't have Emacs set up to build on MS-Windows at the moment. Having support for this on X and PGTK (not to mention Android and Haiku) is probably enough though; MS-Windows and Nextstep are just "nice to have" in my opinion. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v8] Add support for colored and styled underlines on tty frames Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2024 04:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter Cc: Mohsin Kaleem , Eli Zaretskii , 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17143664256759 (code B ref 62994); Mon, 29 Apr 2024 04:54:02 +0000 Received: (at 62994) by debbugs.gnu.org; 29 Apr 2024 04:53:45 +0000 Received: from localhost ([127.0.0.1]:54858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1J1M-0001kx-Lb for submit@debbugs.gnu.org; Mon, 29 Apr 2024 00:53:44 -0400 Received: from sonic302-20.consmr.mail.ne1.yahoo.com ([66.163.186.146]:36688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1J1K-0001kr-Pj for 62994@debbugs.gnu.org; Mon, 29 Apr 2024 00:53:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1714366397; bh=u4bDb7c+WydpNUovQEGtSd6chD+pdASVYLzB9PYRhBc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=ugqe43I64Kr4Cm8Ob92kKamw4DxqM2oOKlZzU6bHqKrktiblmjXcmB1vRB6GLxeggMBRm+DofraRWgcULOcOjVqe8CpFtK0shkGHEjlrG7X2kDOR2ot6JAo3wlwZ8LoD3bWvoOTLXGpLFe+SNmzCbA2Q/ZuUG39xDJrycJqAdouVCIOy3PAKPk9Kj49Q9Mik9kaCNoQVjtaYPkkzr/gvaSlIx6/tJiYfMJBhBVoxFM2s886SGVq2LxDZGSCxVtPH79/pPRkQqQhvvZlHw2Z6SdwamgTZPK4KEfwWvREs6mwxLoHxh2ZAhXOO4tqEK7t/xEAn3FCLrNsMWR7U4KJpkQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1714366397; bh=FmkkSMjk6bFzFG6x0YvPB29ziQDypGZz8cB9B+tC+fU=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Fvl0+YBsvUvAnr7YIs7vWney2KLvUglr00YbuaSMOaimGjfJzyqQczKOCPIp+NnuToAo89boPx4vPZ0+TiRYCap01kcWqvBs7aZ/aA7nnbw8Uu17Wuq7YITc3LKK1TTxBiKMameqUtT5JHraYiVA/39LZq6ifaBRjRy+AqbQ6Etsy4oTU2zp6fMsQEW5ST04Cf6l+OwNH8k12fWkHBx26axsJSxkRf/b0jam7LsBZyYAqgiqTKq1Sbtd4+udGW/aISWik8f3BQ/AHLOku/HYnctZUMSWZr3bvefTcKiYLoE77b3F976NUowvZVVDoAzNLJMKL5kOL1CFgI7lFYVZAQ== X-YMail-OSG: HNFxtOwVM1ntlhsG5_Z8H2Xb0Wt_p6_uo4wK3Zhtdm0pB6dBQFecGwzFWUL24bF zm.3UjhX3DDdHqeBaYbhYYv782rXfsD7VAdv0iz00Rcp9bXl_TlrejoKTzSJYtZt0skeNEgPkK0i 9WloCb.AfXc.JOSXG0VCRAXTCNsR8SReaTUtCa2ZmRTiFKKAi3.rDPKBBCflWJmzaTDHxeHM09rY etL620oM2Jt7eC3hO9Ioli_uOo43zfBgF3wpkJuQrZnnfJYz760WmEAjxSybZjqUAqBBpE5Vf7x5 ddqIZ7jmReyLtaBxnFwfM12phoymyaIkYKgeFfOwJD4.ZFzpWrW3mXVFgReQ1yyY7J0kKVEs3TV. ox4NylqCNC3OaExnHKvDY0zaLj0lPeMcjgtsanO63zvOlCXV6RjQy2123Dc43p_2T1NCthqmw77U 1mWAI3wfFrhmUpez0ZNT7jPj3udAutOOx08ZfqefD2L6g2EYnPuy4Qh_5gWLzv9MaprVWtSRT7ww 4VU0cxdvV9eOBBKhQV_jPDOU4ZvlEdbfTyErXsoFtAX2Xprx50kE4WyZN8JMUHScEm9iqAPMqO2b V9wjSkyB1Fxp7fk5ssNATERH39r8THY_c11ndT4PKkrnn6ncpPXQOeRpeU9JTiBXLoI7HSUiOMtW UyyTv9h6HVdVQgE3VmftJ7b_zo0EnAF.KjS6PQzJPC3ShbgFgOr23LN9dmBmg4HSi6m0BSY9041E LN.bndTUvs6j.5koGZgbshvFpxglSjYVe6SxfMqnIr0U9C3QIxTDlFc9KLyxa0kdd3YaEQrraN6h nObRl4Xc0tiArNGbvirXggazn4a8ld9kSpVzLkat7Ay53F7MLklsB_icxknL5Kr5NxWoCnMde7qp K5y82S9d0oxoPtT1l6P46h3IX3EZOI45xsvPiG4hYKarmPQTz2BQJpAzbgrlHPXlRl3_KO98SnO5 _wihtXCo4iILssIzP7Ofz_IaDONjJqA9hqm06OY9efuuV3YqzovrBaihJBsN1bpM4nOeYQeziVlz bLZ5IavzqGNcNWUpKgZ6ZxmqL.qTQdmMPdhBuYK4v727AC.S1qwdI.X7MFuZQVhBaXDQpPNe.Ra_ v9uDEVQrUpBCwU8GpfIL8uQKkRWCw62aEZEQ3teLbCeGgwCOJMNVsF7th2iXsSHyJdajiOxGfNnA _xNis3VU8I0pK349NOLJUWhFE1kQ_6S63y9BweTAnBxz8mlfTIeEDc_YaGs8q7WB.3PHoHgAJZqA SsW1qRDkSl_iGkC0weA57W_tYtbbeXThiH_ScSY5z2Rl70.9rzGcCFcE87YyNNQ7NyurIs51okXK jWkUndEGnubvw2iqd6ugz.upD03XjGdZpafpy6mE6OJEXusPSuNn8S1ch3bfm.TmHjy19B37.E7U 08xsUH0LeyC4ZvfECc50oIwiGokyldGjgISv1s68toRRdqCwWZiF4EkuKrDzk6KPWkT9FTgCD.OD IKGcjYu2M6aDdnemarxzs9_DLfGvIhwYZDCjCxxoFYBjvoMu5DygxUz.zHT0mujg6XE9QtGdhKXH Q86JHLXJH61gZ5gPevjYEyBr2ILfje7uprFqtiENungSAEHjwzsvXxO97BaIYZ0ydlBmqCCYunAq NF2nmgKH8xEH0P.UoR.eb5eGZw1wEMKeHfWhQG_1HtPYJ.dneE2By9_usOXl8_drVo._3akkx0hj xAl6ZUiB6Fa2wxjOGf0gehkLZEt90MNSnrHSbDRu0GuQ0ivGLNaleDNZOFLA0miE1kAfG.LyCEf5 T3hIU1133_c3oaPT0vVbiTtIEMsQvzuZSYXhW9fntpRVMas.GpkElBDULBoaR4pg.Ul1er6BxRkr Qg_DySFXcs6wfWvFQs2L17uFK0thVj87kxHgB1dZrlXoY_v8MHt4oTpuz6BNzZYdS8S5I9o8nfiC 7nKIkNgB0cWtZeWjo6bMoX4xCBC41h6E.sWRSwz_LjfYNDCP57WwUchm62LzP1CPNmwTpO9l9.MO 1osBxjH_3fRMII9TMWzcZ8hwcUwnqCi4S4AdLdzAGKU5xM3h3jYWK7Ek99UsOjCy6ad2ttVV6Wnh F8UpFaIv_enwgQCQ6KriOngtbDXpEHKssGLUiWLOOsfpqiKjLah.3rqqKWQWqT65PeI0CNNhvl42 UISn27f0hCciYU3dkwPAMCkz8RqHcm1VRHX0eJOTvy_2i4GYEjDjtFXVjXQRZvZJMjvhR6flvWZu aOjwnxtvLTshzNXElwDsOj7rT5wWJxeIF6YyIvw19l6OrwEsxvJ2aAJ_8xTC8ZbY- X-Sonic-MF: X-Sonic-ID: 93c75310-bbfc-44ff-afdb-551b555bfb47 Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Mon, 29 Apr 2024 04:53:17 +0000 Received: by hermes--production-sg3-6f9f87bd85-d24j9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 3ef40f1fb0a72bba36beffc1deb0fd2b; Mon, 29 Apr 2024 04:53:12 +0000 (UTC) From: Po Lu In-Reply-To: <21014d25-b3cf-2d3c-2a0d-c6d47b1631be@gmail.com> (Jim Porter's message of "Sun, 28 Apr 2024 18:04:11 -0700") References: <87pm7x5mxc.fsf@kisara.moe> <87mspli8r3.fsf@kisara.moe> <86h6fnw4ok.fsf@gnu.org> <21014d25-b3cf-2d3c-2a0d-c6d47b1631be@gmail.com> Date: Mon, 29 Apr 2024 12:52:52 +0800 Message-ID: <875xw0epnf.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.22256 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 628 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jim Porter writes: > Having support for this on X and PGTK (not to mention Android and > Haiku) is probably enough though; MS-Windows and Nextstep are just > "nice to have" in my opinion. I get the impression that inconsistent feature support between the various GUI backends is a significant contributor to the bad publicity we receive in some quarters as to our attitude towards the, if you will, neglected, operating system ports. Strictly speaking, all systems besides X are organized on a "nice to have" basis, but for publicity's sake they ought to receive these basic display features as well. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v8] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2024 07:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter Cc: luangruo@yahoo.com, mohkale@kisara.moe, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171437468015059 (code B ref 62994); Mon, 29 Apr 2024 07:12:01 +0000 Received: (at 62994) by debbugs.gnu.org; 29 Apr 2024 07:11:20 +0000 Received: from localhost ([127.0.0.1]:55514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1LAV-0003up-Qo for submit@debbugs.gnu.org; Mon, 29 Apr 2024 03:11:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1LAT-0003uj-6R for 62994@debbugs.gnu.org; Mon, 29 Apr 2024 03:11:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1LA3-0002ti-AC; Mon, 29 Apr 2024 03:10:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=uUzqNfjSjAfYm+jE446BXwo/RkG/MQpUYPuU6871Hc8=; b=Vqoq+NnoahNM zrnfbxPkntuMhkOVMpXywB1qP5KGHlx/Iq23FjURv9MtHMMYJ+2FeyaL83g6y4nGNg+irG+kuFa/4 RWA2oJhHkXxWHb0KaIn6eeppn/uBQ5UUr38P/amU741zmYBewiL4onrdSUqThszXtuwnA2ImmhuWH EVHD0Vy1f9pE/1gl1O8Dk+sO2Pkfp62jcK/O8HFtXHNpIbD7Cxxyxl7LSSiR7GVtNRagzSn2GTYYA J+KQ+SZyigIRte06RuNkLqV8vpoHmxWtc9RJGbXbpKMjSoYTTGW+NIzvhDPlJOVYx3wXB9KRfth4b VkgIeSo9egCESrFR0uqvLQ==; Date: Mon, 29 Apr 2024 10:10:15 +0300 Message-Id: <86sez4skyw.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <21014d25-b3cf-2d3c-2a0d-c6d47b1631be@gmail.com> (message from Jim Porter on Sun, 28 Apr 2024 18:04:11 -0700) References: <87pm7x5mxc.fsf@kisara.moe> <87mspli8r3.fsf@kisara.moe> <86h6fnw4ok.fsf@gnu.org> <21014d25-b3cf-2d3c-2a0d-c6d47b1631be@gmail.com> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 28 Apr 2024 18:04:11 -0700 > Cc: luangruo@yahoo.com, 62994@debbugs.gnu.org > From: Jim Porter > > On 4/27/2024 2:11 AM, Eli Zaretskii wrote: > > Thanks, installed on the master branch. > > > > Jim, are you working on the GUI support for this? > > I'm back and available to work on Emacs as of today, but in the > meantime, Po Lu has implemented the GUI side of this (see > e844b81c56d74aa2b2efa0ce98ed3de71647e656 among others). I could take a > look at an MS-Windows port, but I don't have Emacs set up to build on > MS-Windows at the moment. > > Having support for this on X and PGTK (not to mention Android and Haiku) > is probably enough though; MS-Windows and Nextstep are just "nice to > have" in my opinion. I don't mind leaving this stuff as it is now, until someone volunteers to make the changes for the w32 build. Thanks. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v8] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2024 07:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Po Lu Cc: jporterbugs@gmail.com, 62994@debbugs.gnu.org, mohkale@kisara.moe Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171437557615567 (code B ref 62994); Mon, 29 Apr 2024 07:27:01 +0000 Received: (at 62994) by debbugs.gnu.org; 29 Apr 2024 07:26:16 +0000 Received: from localhost ([127.0.0.1]:55573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1LOy-000431-CR for submit@debbugs.gnu.org; Mon, 29 Apr 2024 03:26:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1LOw-00042v-Aj for 62994@debbugs.gnu.org; Mon, 29 Apr 2024 03:26:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1LOV-00061u-4W; Mon, 29 Apr 2024 03:25:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=a4RDwfLqvhTZhXdnH0PLzPUu9VrIov3UQNNSQLCgczE=; b=Zl+AqPNKdjmG l8tyN7Q/WejoScTKSwi+H4Klb3cYs/v8uIM+AtPhkyxI3aOXarJ5dIQ6366rbN567+2OoPAc5hcXU 7LujS9eJrkCBfvXBJUcSd5mpAAJge/C7pVg3m6BKPgkYdPYqEdhW6WKALXYdwTAB+/VMn3sdSOoeB cSThxfb86pxI9N8j8ErR61IQ6a8DIAQvoNig2FmxebyPZ8OIRuWjlRwdGUJ5V4yYzkS2Y8GqxJo2k 3O9PtWAQPzE07CHWZBF6dZe5I0Tf3on1z3t6RB+QUHsYE2BXvfIXdH3dMQZOd4vGKfDSM8Ov5mHdI rMSZeRhLmOnYRK9DnG1nmQ==; Date: Mon, 29 Apr 2024 10:25:41 +0300 Message-Id: <86o79ssk96.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <875xw0epnf.fsf@yahoo.com> (message from Po Lu on Mon, 29 Apr 2024 12:52:52 +0800) References: <87pm7x5mxc.fsf@kisara.moe> <87mspli8r3.fsf@kisara.moe> <86h6fnw4ok.fsf@gnu.org> <21014d25-b3cf-2d3c-2a0d-c6d47b1631be@gmail.com> <875xw0epnf.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: Eli Zaretskii , Mohsin Kaleem , > 62994@debbugs.gnu.org > Date: Mon, 29 Apr 2024 12:52:52 +0800 > > Jim Porter writes: > > > Having support for this on X and PGTK (not to mention Android and > > Haiku) is probably enough though; MS-Windows and Nextstep are just > > "nice to have" in my opinion. > > I get the impression that inconsistent feature support between the > various GUI backends is a significant contributor to the bad publicity > we receive in some quarters as to our attitude towards the, if you will, > neglected, operating system ports. Strictly speaking, all systems > besides X are organized on a "nice to have" basis, but for publicity's > sake they ought to receive these basic display features as well. One counter-example is the non-support for stipple in the w32 port. Patches to add that are welcome, of course. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v8] Add support for colored and styled underlines on tty frames Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2024 11:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: jporterbugs@gmail.com, 62994@debbugs.gnu.org, mohkale@kisara.moe Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.17143906585036 (code B ref 62994); Mon, 29 Apr 2024 11:38:02 +0000 Received: (at 62994) by debbugs.gnu.org; 29 Apr 2024 11:37:38 +0000 Received: from localhost ([127.0.0.1]:56736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1PKD-0001JA-KV for submit@debbugs.gnu.org; Mon, 29 Apr 2024 07:37:37 -0400 Received: from sonic305-20.consmr.mail.ne1.yahoo.com ([66.163.185.146]:43034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1PKB-0001J2-JL for 62994@debbugs.gnu.org; Mon, 29 Apr 2024 07:37:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1714390629; bh=FswMSDmNjmSJv7g0VZ9MyMODsGCxBIVk+WxNNsMRxQ0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=DBFsQN09NgBlpZSMSTvlfBs3mILAmLkS2AvcPxe4R2WizM1+/YwAR4AnwguW18+fLGpS2OPHI97B/j15DKea1gLOJX5OFOS7QNgoWs/XRUR7vEUPVs/mbeIE2+J3QqBplTei4GafCvz0YkKbDuJEsRuWX29SASevmcVBVDEFstHOqvqThkn9ZLwmcGYq4waB4MNfINJgc4Z4lMUDxAy18vqGO+PUnq18Wd+FlzUYXGt08y4vfHQ/aEaZvxmdBWzUzOOLjqkyrQFjlOiul5a8NAf8YsCMB86RTIqht0srgX3DBWmunbuG4u/QfTtfxjxYfc8pAc/g3K2VeCrvn55XGQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1714390629; bh=TzDfdTY0gSmMV8/oYPKz4AON+6UIoimKwYKIY4iROXx=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=TGryUbX5DSIpzQzA2YWi7wiVV3JUL5MZ+qggi+TGzbDX9+xdrHPWJTsN7u/1dH+lQivG7gs6gCTUH4NNANt35JE/xxZbfbX55iUcTCvoK+ryTuf4LSaMMX59fOLAUUWC16kjBw+CAb1eFkZh+z4dEOCuyfc9/i8eXJB9OlV0EdHhN33n7LWQAuKGKyLzuGlZaQaBJvwCTPTGDTu+glLS4VLL494UmoJPb5NEYUEQpSQ/ITg6pvOpFHhlWYCk2TjsNzkBongUPKzsfQLrcYHM/B6rVB2hAili2vQlv5QijnTVTR7wje815yL4uck494Kwuzo2Rab6DdsE0Zl9d4SEmw== X-YMail-OSG: 8U9sRMkVM1mpLTZsP2qkjbL8Kex9g3XIN2_wP_c_SZU3x7tzt4qQzAqslfgavi5 dOkfdBNK6juN6j_P9FkcCgHc9arWNhSefyvELr4e.B8t4vlUoWJQtbTrUsA1lR93JAztg0QiPBDU 3RxE4mmHJRi2YWeg4qNpKU.D0KYIDvKXUJeTDqXTDjyhihgF7jBN.9FBI1LbahSIzwfhdTyI9Lzn 36J1LLhF_NQShL2ev0VFFn6l6ZmKR19yq.d7..fvQ_z9BFH3jIOmMeTKI1nNOmzShHDfK655kpI2 N0huI1JJzpgJo4_ccM.1ar6BsRx98IujshqbecSCBcue6FOZ7EKyc2c4KvIatuB05ieBykrU69DA rjHiZBtRNmfG4aVJETTHikMbFnphcnhPl7RVycxS9Lo7SdLwKNYugkkNcSzpu3iQZsWsz5nSfQLq DqFrko6OoTUcEXoeUIU1F7BVfN28dYpVoUGLKUr.yfpl8p5nlwvFxRvNFFv_qW8j3g4q8meQHvDx oZJSPEIAzQ6UoLn8mWQkELfJuG7QI7T4InJWHmXRRQkqGiyOaIgrIQwEoUyEWKoK0y0ZGLLMNizj oN5lkrMjDHXLVZDEamUO2boCPvN3wKHi52l5CQ.OGZhMS.r6x_Wvh4mwIUbXbSa4ExEOvXTPiBuA yDtLE.2LpWNlZ8wx9mEnlDaAYWoxjWDxL8ePT40AT6QeujR.0QsDsUcr7niR67nrh22ikNoq7i98 de8Qvx8GwQWqwmeb3.4yi5BF6kqV9GxKvCBFuuKYzVcoSnmww4JMcgI.hPNythMSOuEuoaEhNd4z 35rYXJCjd8Rgi.2tfJM889DU6IlzmqFrDU3MsrEBDgGjBxkW2YyXhKknOUdiWRn_v3UTYSifuU30 360gN23r5ZLrJ2GnJA5hmidCVeWvbxZHHoPXbzAGD3W4zbvxxqhdbxdc6odGdDHqih7NV585MqoX OutX4Bk80rIQsASbHxObm4QrgiaS40zJXhqKRE5xFdpXgWSJd08m9ngG.CZ59wTlayHaV7trf568 p5oGoN5CQ.0lDE8P2G6pg.LDCKCiAvrK718HWPwcE60rfkASd1qmQ3Z3l53rh3p2vO31ffnPsx3_ ekTCU9TejqaLxsA2VDlbj66gyBgTKdLRsafU0LbMK_zyi8FaqvlJe1HBxudRD7hmRfGWmnWiWoRv j0V7tfHXLpH2t1CuqcGAHC25z3eC8klbhzlpCRPVyLEwJKXonjOpYpL4pNfRvtIcY4jOBAbyZr7o v28tPlO6MIBPl6UVXaLfOtbmZPF.PRh4272o7xWKYZ8g7MMGhVVbR7XlpuH4zTyG.bgkPl_z8VUH QnHsUSAVKgtxSu.92a.ajDF_E2v0zZfk9VLo2fGBnmOmXsj0J2jxwgY8ZQyYMf_m6j9K6VinWLbd kkDJbbncxA7659UN6W8jaOhrIY770eNbI6g45VK8bmlIpxim.VIMlRH3bMVCrZXhoDpJElUI24CE vTa.7ByKTqsY9DTwUFpRKO4KwImSkCSk.h2P.bjjuo8g5o46so_.ykeFUaSsL3xxvzzVbhJPY2RB bTDsOKCwYQ.C1fn.lAHNliztdrBhOJQzSUadQ5gSauAuPPJzI7HizmA4V627OpHlLs71Qff1VPbp RZ6Msc9VjwiB.ezmwKG.FndVD0tCxVhYk2mNof10bAadhC2I9iTKWIxTG31Y3MqEM2ENO5fFy53b i0vsQJEcJOUgl7FOQ8dLHRRDlKz6L1yl_jGaUjTbPtVuGTBL4aSRrmh1xEucJh7QSwvu2WxSuUyE tvtrJrIQSbJylOrpW1CXlkHPhjTpd2V8rXUvUxqqhvbwJEXS5aEcBT_BXeVQG7qPPuCgtE42cv5R 6QgtgKkdj1yXr5WVZDmQQUoFFXH2eQOgApq5grLvUZ8_g0C8KlzeufQF6IjgE7LRoe2PiQnRD97S zjGLMVTCJji5Z05kqQhfqLZ0EWymsGXIvAVA7l_jNUf10kHN_tb4LWn2m4.EA5pmPlycBAfIqOmd 9WEtM08MhVonlPg3zsechasQmVSPWR6IhFonUDodV0.2dW.u69U5D.hoT.zuR5ECALMQuHFeJWgY UOsVq2Be8zcWlUF_pUvGJ2iZ.cJfFOUaO6Hl8QTiMR35UCdLTIr_x995wjBHYueRbwQxnroEcvqp F8L7fLbXLVb6HGeGKzxBqVWnHEnKyDR6Q9QGubRsnRcXzPrp4_9hGygRt7.baJsP5HZAJJhJK3J_ Zv4RtsnyQZ.0qFuyvlqg3nVNGtoU8VHwt1Na9zE21kUcGMpWnO6xlUa3S7bXNP9j7 X-Sonic-MF: X-Sonic-ID: d079cc6d-f0d5-4410-944a-ce8902697df9 Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Mon, 29 Apr 2024 11:37:09 +0000 Received: by hermes--production-sg3-6f9f87bd85-kf2q6 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID c92f89f5213a286c501a202bfdc20a9b; Mon, 29 Apr 2024 11:37:04 +0000 (UTC) From: Po Lu In-Reply-To: <86o79ssk96.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 29 Apr 2024 10:25:41 +0300") References: <87pm7x5mxc.fsf@kisara.moe> <87mspli8r3.fsf@kisara.moe> <86h6fnw4ok.fsf@gnu.org> <21014d25-b3cf-2d3c-2a0d-c6d47b1631be@gmail.com> <875xw0epnf.fsf@yahoo.com> <86o79ssk96.fsf@gnu.org> Date: Mon, 29 Apr 2024 19:36:57 +0800 Message-ID: <871q6oe6xy.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.22256 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 586 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > One counter-example is the non-support for stipple in the w32 port. That's also a source of dissatisfaction with the said port. There is this package that decorates buffers with extravagant stipples to indicate indentation levels, which has grown popular with users, and of which no discussion is complete without a passing remark bemoaning this deficiency. > Patches to add that are welcome, of course. Styled underlines don't take priority over this, naturally. As always, the prerogative belongs to whoever writes the first line of code. From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v8] Add support for colored and styled underlines on tty frames Resent-From: Mohsin Kaleem Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Apr 2024 17:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: luangruo@yahoo.com, jporterbugs@gmail.com, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171449962625885 (code B ref 62994); Tue, 30 Apr 2024 17:54:01 +0000 Received: (at 62994) by debbugs.gnu.org; 30 Apr 2024 17:53:46 +0000 Received: from localhost ([127.0.0.1]:60637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1rfm-0006jR-8A for submit@debbugs.gnu.org; Tue, 30 Apr 2024 13:53:46 -0400 Received: from 119.ip-51-38-65.eu ([51.38.65.119]:54988 helo=mail.kisara.moe) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1rfh-0006jJ-Cz for 62994@debbugs.gnu.org; Tue, 30 Apr 2024 13:53:45 -0400 Received: from mk-desktop (bcde7b88.skybroadband.com [188.222.123.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.kisara.moe (Postfix) with ESMTPSA id 92236A2796; Tue, 30 Apr 2024 19:53:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe; s=default; t=1714499599; bh=lVYslUkGhHcXjhb9Cy9Ll6TB6iUMpUGFTd+Opwesfbg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=GJQcBWi4qUVSOlyilBMDWIPaMmT7cCWDuY+oh2zhdKqqUo35xBI/rVCIh0svtW0X3 Htf5m59MsGHThSJ4YiQ2xLeCoNLO8rrQG43FcGKw5f1AWY6CgBARu4WTWFLdU1gGXm gYsfnxseIspkWg04VyIMtMYQZVrxoZZGXImqs+3LYY7i27K6RQafH6hvC0+gS1fEcF RM9nLTe+eIx8BNyoNp6NBH+5YOebqzZlHm2hQf45LtQIMkPr9sj44ITVShYjs/3yvP R03kgCb4QW9OudLVjVOgElnN6lbpyUCL4ZfO9lYVb4Pey0kPk2nNmley7OVc4pzMdG 4UMnYyJr6b7bQ== From: Mohsin Kaleem In-Reply-To: <86h6fnw4ok.fsf@gnu.org> References: <87pm7x5mxc.fsf@kisara.moe> <87mspli8r3.fsf@kisara.moe> <86h6fnw4ok.fsf@gnu.org> Date: Tue, 30 Apr 2024 18:53:17 +0100 Message-ID: <87bk5q91pu.fsf@kisara.moe> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Eli Zaretskii writes: > Thanks, installed on the master branch. > > Jim, are you working on the GUI support for this? Ah, thanks Eli. And also for correcting those references in the related UI files. I was just about to update them and send a new patch before noticing you'd already corrected it. Thanks :-). -- Mohsin Kaleem From unknown Sun Jun 22 08:09:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62994: [PATCH v8] Add support for colored and styled underlines on tty frames Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Apr 2024 18:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mohsin Kaleem Cc: luangruo@yahoo.com, jporterbugs@gmail.com, 62994@debbugs.gnu.org Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.171450127226817 (code B ref 62994); Tue, 30 Apr 2024 18:22:01 +0000 Received: (at 62994) by debbugs.gnu.org; 30 Apr 2024 18:21:12 +0000 Received: from localhost ([127.0.0.1]:60764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1s6K-0006yT-AI for submit@debbugs.gnu.org; Tue, 30 Apr 2024 14:21:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1s6H-0006yL-Dd for 62994@debbugs.gnu.org; Tue, 30 Apr 2024 14:21:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1s5p-0000sJ-7i; Tue, 30 Apr 2024 14:20:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=D32U1b/FhScm/Nponj4tV4byoypCeCHkJ+o161/ASLI=; b=HJaYwoSojg9B ESmCDsOcoXZt6yeTRyZ1XNcm5K7E3VZcefmX+nOMNOG/zpXG4Hbb/qWjVAFB8DDuN2TBNBH1/1oAT 8dxPW5g0t5BAie1BxBsJdExlsLv36SWTYTbLb0M3ewJ/Gm3HRfSIDs/OadJnguJUN787ld5FQM9/S j9ZlsizumWhvcqlTRwY2RfMC2d6qaG/C1g9yXfm3OsyOppguOwgXXnpk5rpNVO+/teEMBJKmfMW+8 oCYbvqn790mlADDJIyvOjTcijjjI4z7TomEn+b9FuyS9UB6bvjhjspexqrNrGHAbl3pce2c0Jox+f mvZQY3O0DHV3zLO57icHsA==; Date: Tue, 30 Apr 2024 21:20:37 +0300 Message-Id: <86ikzypv9m.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87bk5q91pu.fsf@kisara.moe> (message from Mohsin Kaleem on Tue, 30 Apr 2024 18:53:17 +0100) References: <87pm7x5mxc.fsf@kisara.moe> <87mspli8r3.fsf@kisara.moe> <86h6fnw4ok.fsf@gnu.org> <87bk5q91pu.fsf@kisara.moe> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mohsin Kaleem > Cc: 62994@debbugs.gnu.org, luangruo@yahoo.com, jporterbugs@gmail.com > Date: Tue, 30 Apr 2024 18:53:17 +0100 > > Eli Zaretskii writes: > > > Thanks, installed on the master branch. > > > > Jim, are you working on the GUI support for this? > > Ah, thanks Eli. And also for correcting those references in the related > UI files. I was just about to update them and send a new patch before > noticing you'd already corrected it. Thanks :-). I had to do it, because otherwise I couldn't build Emacs, and I always build after applying a patch to make sure the build is not broken. Thanks for coming up with this feature. Emacs 30 will be better now than it could have been otherwise.