From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62994: [PATCH 3/3] Add support for colored underlines on tty frames Date: Fri, 21 Apr 2023 19:12:54 +0300 Message-ID: <83wn252ozd.fsf@gnu.org> References: <20230421143448.339022-1-mohkale@kisara.moe> <20230421143448.339022-4-mohkale@kisara.moe> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14651"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62994@debbugs.gnu.org To: mohkale@kisara.moe Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 21 18:13:24 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pptO0-0003b7-0k for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Apr 2023 18:13:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pptNn-0001Gg-IC; Fri, 21 Apr 2023 12:13:11 -0400 Original-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 1pptNe-0001GB-0h for bug-gnu-emacs@gnu.org; Fri, 21 Apr 2023 12:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pptNd-0007ME-PQ for bug-gnu-emacs@gnu.org; Fri, 21 Apr 2023 12:13:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pptNd-00057T-Li for bug-gnu-emacs@gnu.org; Fri, 21 Apr 2023 12:13:01 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 62994-submit@debbugs.gnu.org id=B62994.168209356719657 (code B ref 62994); Fri, 21 Apr 2023 16:13:01 +0000 Original-Received: (at 62994) by debbugs.gnu.org; 21 Apr 2023 16:12:47 +0000 Original-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 Original-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 Original-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==; Original-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 In-Reply-To: <20230421143448.339022-4-mohkale@kisara.moe> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260403 Archived-At: > 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.