GNU bug report logs - #75024
Fix check for underlining capability on ttys

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Gerd Möllmann <gerd.moellmann@HIDDEN>; Done: Gerd Möllmann <gerd.moellmann@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 8 Mar 2025 08:21:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 08 03:21:55 2025
Received: from localhost ([127.0.0.1]:52668 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tqpRS-0002yi-N2
	for submit <at> debbugs.gnu.org; Sat, 08 Mar 2025 03:21:54 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:49198)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tqpRQ-0002yG-EW
 for 75024 <at> debbugs.gnu.org; Sat, 08 Mar 2025 03:21:52 -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 <eliz@HIDDEN>)
 id 1tqpRL-00072Q-0U; Sat, 08 Mar 2025 03:21:47 -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=CiNGtcb8WetPItatwwLhm0IzJsIm9MFi5aiMbg/3GOc=; b=GaGx9OtHVxen
 8swQ3qTTs3xBzxW5Jrpdmn8PjRNeWiQNPSxGlrjZGuRMPt4tL0ONdPW1faOCOPh4bG0ZF91DeesHU
 FocgZpnCwSjh2AgNQTXpzhpCpstb5K6doUPsOErU3uuP6xSwyFZZgnO/5bN2MWZkoqza9z0GUDN/a
 08pwTVY+JeUxZoMyEClruc6p754lPCmkbI82AO4JQmXIqZ87cnvcpjGaHdaLm1LF5q0De5ghgKirr
 TiiobI4D7aIR2rbOfrB702VhSNm93y3jCLPrR5cDSluw54Ge0hMEZknE6k1FmJ7QKyQg+Wi9ljzuR
 q33AlUNd2u0egIoOZert2w==;
Date: Sat, 08 Mar 2025 10:21:44 +0200
Message-Id: <86v7skj5k7.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <CADwFkmm5P52sKin6wj2UCKF5HxT7iotE5bLZ5nu7HXom3FQ3VA@HIDDEN>
 (message from Stefan Kangas on Fri, 7 Mar 2025 11:30:49 -0800)
Subject: Re: bug#75024: Fix check for underlining capability on ttys
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
 <874j2dh4q5.fsf@HIDDEN>
 <m2bjwlv5uh.fsf@HIDDEN> <871pxhh3yz.fsf@HIDDEN>
 <CADwFkmkkQbT+_cV_P=KKuvBMdtM9nBHA4WJMNjaJe7mYvgV6CQ@HIDDEN>
 <m2jz91nsbz.fsf_-_@HIDDEN>
 <CADwFkmmvXh-MEaFWELhNsH-dA2-fmsVxmdF=TaG7UO6wiz6iSw@HIDDEN>
 <m28qpgiqu6.fsf@HIDDEN>
 <CADwFkmm5P52sKin6wj2UCKF5HxT7iotE5bLZ5nu7HXom3FQ3VA@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 75024
Cc: gerd.moellmann@HIDDEN, mohkale@HIDDEN, 75024 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Mohsin Kaleem <mohkale@HIDDEN>, 75024 <at> debbugs.gnu.org
> From: Stefan Kangas <stefankangas@HIDDEN>
> Date: Fri, 7 Mar 2025 11:30:49 -0800
> 
> > Making it an enum is for the sake of LLDB which can't handle macros.
> 
> They make things nicer with GDB too, IME.

I've made a habit of compiling with "-gdwarf-4 -g3", which makes GDB
aware of all the macros.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.
bug marked as fixed in version 31.1, send any further explanations to 75024 <at> debbugs.gnu.org and Gerd Möllmann <gerd.moellmann@HIDDEN> Request was from Gerd Möllmann <gerd.moellmann@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 7 Mar 2025 20:33:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 07 15:33:13 2025
Received: from localhost ([127.0.0.1]:50752 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tqeNc-0004Mi-UI
	for submit <at> debbugs.gnu.org; Fri, 07 Mar 2025 15:33:13 -0500
Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:52455)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1tqeNb-0004MR-3M
 for 75024 <at> debbugs.gnu.org; Fri, 07 Mar 2025 15:33:11 -0500
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5e539ea490dso2854481a12.0
 for <75024 <at> debbugs.gnu.org>; Fri, 07 Mar 2025 12:33:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741379585; x=1741984385; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=4hbsMKUOP51VrAjRAl3d5Vz4G427gIEZz4WiWdZmH9I=;
 b=GQNf8ikW65awl4pc9Ji9B0mTcPcXuSNU5812u/1YEi/2+KzKgVkpUhq7tLC4kH9EwR
 SLupNAA4y8LkOFHvFlHO4lCV3FDG7JDNr89f1cyAFjvQpDWf4N1cogWzrV3tWtT/uNsk
 bsvCEABASf9Y8ivs1axfLS29l/oBA/+IimpWc3HvtuODv0XMXAX0XjTVhaFR26yXxPxb
 B7jB4gS2UVDQzFK1JduKEh4+c2ZDynknan1Z+zUUjMiEgQFOgRGaD11PLi2v5yTk0G0b
 rGZ9xuq5lfG2eo9EPLE7QWvlxvNwrrl0bku7+mu4Wu0JLG5wEbNq2p6vpm9CjPNGQK2F
 kBlg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741379585; x=1741984385;
 h=content-transfer-encoding:mime-version:user-agent: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=4hbsMKUOP51VrAjRAl3d5Vz4G427gIEZz4WiWdZmH9I=;
 b=aA8tfWMemTP9PkwRqhNuNmRd4yqj90Wrf45ZIcgR59pU/EpOrDARg4UEei7ot8MZhb
 XN7Tj4KzgBVdpWfTcuKYTGP1u5dB8UsdQjiivZi7sYEXznOQ453NU8U/9BmwvRLMrFku
 oN4t6iY+hQ7yp5hJeaKR41N1mrnVUrTGxKCUGppRYSZWI1D9+ORtvnjk+wFB1sZmJmkC
 MI/4Ucc+SNAHYfNHBXbXteOx6DgtWcejkvkOyJZflY5/tEUJEIq3iGogT5A1RnaIxxGl
 8e6f4uP8GYM6wQxV0CvH4gMhEfjd8zW7AWKw0AVhDvtY9rSwqgpMf8j6ADw1P7/hGvxn
 4sGA==
X-Forwarded-Encrypted: i=1;
 AJvYcCXX5ZIWVmO9c9JiDZZf5cvR/X33ouQ7WH451uYk3fLd7UIkH0PFz2yaW3Ggp6PnUMBk4yeyKQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yy7Ss6w92C3KTqWoiEiCVGRlvgYwVoqMdg9WpK6R2LPNhXEIGzF
 aJToRE/VopZtngFHJQzVoNZAhcDlGPIr7Lo5UOoxoGKmRnC0SuaVA8WboA==
X-Gm-Gg: ASbGncuTKsmXJBRjraceqrwYEl935bgZbRnMPNFueW42ZOGP9sQiWsNSPgxtG4Fpct4
 a0khTinW1lbxBXO1tvSjP5eYn1oJz68dU4AV+4CwXJHRlTFQlaNDwN3JCBW2mCvwLOF+ptKNDdp
 63fPaOnXyBcTXSNTScbJs9J+wGLovVPwh8Y2arWctdENXeBO+bz16X1Gx9LGGiP5XcJd6wHhqF+
 fX2aMebuf4bH+G1WkrtDcBTRFQX6TchmiqbnOxmPfhbtiZXFQdXDk/WZ9hV0h/L00Q6biCPcabV
 ZuyCFSUcD7263wufF/q3NuYQL64DldQYgfTCfO4KvreFexteQbHJo0NyDcu2C8gNXbnFtfyCOkX
 soWK9vgDtLxydv4Ig/w3Tb04IWab4PRgeGb09aBEYS7aa43V2QZ0kRQ==
X-Google-Smtp-Source: AGHT+IF8zy+JqoixdzrT97dO97q8R83NIhrEepeTSogDOgTeiWiEE0tq1KstAnTW1Ulgp/0AZ1g/dg==
X-Received: by 2002:a05:6402:34c5:b0:5e5:dedf:9ddc with SMTP id
 4fb4d7f45d1cf-5e5e24bbeb3mr10414490a12.29.1741379584454; 
 Fri, 07 Mar 2025 12:33:04 -0800 (PST)
Received: from pro2 (p200300e0b739bc00b0c3c7ebdcf0a197.dip0.t-ipconnect.de.
 [2003:e0:b739:bc00:b0c3:c7eb:dcf0:a197])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5e5c733fcd2sm2975657a12.2.2025.03.07.12.33.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 07 Mar 2025 12:33:04 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#75024: Fix check for underlining capability on ttys
In-Reply-To: <CADwFkmm5P52sKin6wj2UCKF5HxT7iotE5bLZ5nu7HXom3FQ3VA@HIDDEN>
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
 <874j2dh4q5.fsf@HIDDEN> <m2bjwlv5uh.fsf@HIDDEN>
 <871pxhh3yz.fsf@HIDDEN>
 <CADwFkmkkQbT+_cV_P=KKuvBMdtM9nBHA4WJMNjaJe7mYvgV6CQ@HIDDEN>
 <m2jz91nsbz.fsf_-_@HIDDEN>
 <CADwFkmmvXh-MEaFWELhNsH-dA2-fmsVxmdF=TaG7UO6wiz6iSw@HIDDEN>
 <m28qpgiqu6.fsf@HIDDEN>
 <CADwFkmm5P52sKin6wj2UCKF5HxT7iotE5bLZ5nu7HXom3FQ3VA@HIDDEN>
Date: Fri, 07 Mar 2025 21:33:03 +0100
Message-ID: <m24j04insw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
Cc: Mohsin Kaleem <mohkale@HIDDEN>, 75024 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Stefan Kangas <stefankangas@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
>> Stefan Kangas <stefankangas@HIDDEN> writes:
>>
>>>> -#define TTY_CAP_UNDERLINE_STYLED	(0x32 & TTY_CAP_UNDERLINE)
>>>> +enum
>>>> +{
>>>> +  TTY_CAP_INVERSE =3D 1 << 1,
>>>> +  TTY_CAP_UNDERLINE =3D 1 << 2,
>>>> +  TTY_CAP_BOLD =3D 1 << 3,
>>>> +  TTY_CAP_DIM =3D 1 << 4,
>>>> +  TTY_CAP_ITALIC =3D 1 << 5,
>>>> +  TTY_CAP_STRIKE_THROUGH =3D 1 << 6,
>>>> +  TTY_CAP_UNDERLINE_STYLED =3D 1 << 7
>>>> +};
>>>
>>> So the values where just wrong before?  IOW, TTY_CAP_INVERSE should be 2
>>> instead of 1, and so on?  Perhaps this should be mentioned in the commit
>>> message.
>>>
>>> I guess I'm a little bit surprised since most of these values have been
>>> there, AFAICT, since 2002.
>>
>> The error was in the definition of TTY_CAP_UNDERLINE_STYLED, the rest are
>> just bit positions in a bit mask and their values don't matter as long
>> as they are different.
>>
>> By defining TTY_CAP_UNDERLINE_STYLED the way it was, it was =3D=3D to
>> TM_CAP_UNDERLINE and things went wrong. Took me some time to find back
>> then because I couldn't imagine an error there.
>
> Ah, so these are values that we define ourselves.  That explains it.
>
> Then I have nothing relevant to add.  If you think it's good then please
> install.

Thanks, pushed to master, and closing




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 7 Mar 2025 19:31:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 07 14:31:00 2025
Received: from localhost ([127.0.0.1]:50611 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tqdPP-0006LM-NI
	for submit <at> debbugs.gnu.org; Fri, 07 Mar 2025 14:31:00 -0500
Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:47576)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1tqdPN-000644-Bs
 for 75024 <at> debbugs.gnu.org; Fri, 07 Mar 2025 14:30:58 -0500
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5e5b56fc863so3114766a12.3
 for <75024 <at> debbugs.gnu.org>; Fri, 07 Mar 2025 11:30:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741375851; x=1741980651; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=n4SuZgOM+xS9P0RfhorDG4G0y0ysiXqi5IAiYJRxEmQ=;
 b=DUTT5KeR/wR94Oa6S1cS5wDNCQcXSkocYKVjQoqXOewxqLANCD4DaFmS60Pf11N5oJ
 97/4vELqbX5fNnEHFexoSocHNurCo0hYSavy+HMVLMjy/q1BkI+ffKaHTpoThgHWkVxq
 gFLYFlPoq/RY8ZoYUKQ786sl4T1tsr11XapYeP4sOXuKZWHMq3f8mBoieBs8HLskoAUx
 pZHJOZcJfB4RwyguiXddeMAV++o1dd8Qr3GDwV6AiCq9EnuohOwP21qn4gj5LJwnNeES
 oWnVREw1dDD2cGoYOKlqchVSFX2szhmm6awODap3v3ra+EiE85vLWD8JDo+qm2gmHLG/
 2lRQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741375851; x=1741980651;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=n4SuZgOM+xS9P0RfhorDG4G0y0ysiXqi5IAiYJRxEmQ=;
 b=sMNONWnsvNnNjbXCHkikP84SGWI4Py1iX+xGDUxY1SftXk0Ekb6r7DcigEVkrdtBNZ
 4HcZ9jezKjRnnK02fKPcrhJfUUE5sn4/QCv98acfT0vVCoqlUtNHJYEViQ//939gHFs4
 /qAMQkc2y7lrKLhoY62hgGViPgwaUUQjZ9397Vhdnv/mmFa124cIVip6cYbOAAywr6Lt
 YCbfBV7wadUEoeZM7B7iQiC6iXPdfijzjzqxAjsJAfV/s5Pkh2IHWKZo07MDZcpPSQDz
 dNptKCr/hvxgEJOHLNyvlhWiBfsFa0SFeWDcn072uTQPAA05nggu3R+DeSGApuMup7Ly
 R1Mw==
X-Forwarded-Encrypted: i=1;
 AJvYcCXu4YvBSwawg/qicuCITDRuJO8E6GHJUtfC6XCK5RCavZrEs0feJ14dVBjkotL9TumrY8tOIw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yx8Nj0Sv2a9gz14AB60RTGUxZCchtopOtazOXIRRpmX+GB+mNkE
 9Rrt6zqnv+979qnAFZvLzWZoFqqNAEHdnvi1GkSnb16gwuXVZ9RK0kF9tTHMmd2+9Xb/Nnknpow
 hIqrNUwRlE54QidiOyctfHdtPrFnqZt4W
X-Gm-Gg: ASbGnct3S0nDGCZqXglUeNxEDhggXdJHKeJqJBEc6y6tPbw/LgQiHqILTi6M/8QwpcW
 yd2ThqBrFSk0TZXa9rrpBJ6iAJ7vzVEbxlNKuhAnHB5oudt8hsDvrt6aRcCzzQptkmw3QTRAenq
 GyTXIoiNeWtVp0AEoGH3iM3UdYTg==
X-Google-Smtp-Source: AGHT+IFW1WQkQbw7IfdYtsPMWhAU2S5ZIlBnCjdy2w8MHM29Ccuv8VHeAHPNPDdfV2hZif4YwMwk/t6FyBpF72z3rTE=
X-Received: by 2002:a05:6402:274c:b0:5e4:d75a:573e with SMTP id
 4fb4d7f45d1cf-5e5e24fb5d0mr5128671a12.32.1741375850709; Fri, 07 Mar 2025
 11:30:50 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Fri, 7 Mar 2025 11:30:49 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <m28qpgiqu6.fsf@HIDDEN>
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
 <874j2dh4q5.fsf@HIDDEN>
 <m2bjwlv5uh.fsf@HIDDEN> <871pxhh3yz.fsf@HIDDEN>
 <CADwFkmkkQbT+_cV_P=KKuvBMdtM9nBHA4WJMNjaJe7mYvgV6CQ@HIDDEN>
 <m2jz91nsbz.fsf_-_@HIDDEN>
 <CADwFkmmvXh-MEaFWELhNsH-dA2-fmsVxmdF=TaG7UO6wiz6iSw@HIDDEN>
 <m28qpgiqu6.fsf@HIDDEN>
MIME-Version: 1.0
Date: Fri, 7 Mar 2025 11:30:49 -0800
X-Gm-Features: AQ5f1JqraUEr70dNU_FBKXAr0qGlBJ42G6zWVlp-eYG-inFRqDZgl80r3loevj0
Message-ID: <CADwFkmm5P52sKin6wj2UCKF5HxT7iotE5bLZ5nu7HXom3FQ3VA@HIDDEN>
Subject: Re: bug#75024: Fix check for underlining capability on ttys
To: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
Cc: Mohsin Kaleem <mohkale@HIDDEN>, 75024 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Stefan Kangas <stefankangas@HIDDEN> writes:
>
>>> -#define TTY_CAP_UNDERLINE_STYLED	(0x32 & TTY_CAP_UNDERLINE)
>>> +enum
>>> +{
>>> +  TTY_CAP_INVERSE =3D 1 << 1,
>>> +  TTY_CAP_UNDERLINE =3D 1 << 2,
>>> +  TTY_CAP_BOLD =3D 1 << 3,
>>> +  TTY_CAP_DIM =3D 1 << 4,
>>> +  TTY_CAP_ITALIC =3D 1 << 5,
>>> +  TTY_CAP_STRIKE_THROUGH =3D 1 << 6,
>>> +  TTY_CAP_UNDERLINE_STYLED =3D 1 << 7
>>> +};
>>
>> So the values where just wrong before?  IOW, TTY_CAP_INVERSE should be 2
>> instead of 1, and so on?  Perhaps this should be mentioned in the commit
>> message.
>>
>> I guess I'm a little bit surprised since most of these values have been
>> there, AFAICT, since 2002.
>
> The error was in the definition of TTY_CAP_UNDERLINE_STYLED, the rest are
> just bit positions in a bit mask and their values don't matter as long
> as they are different.
>
> By defining TTY_CAP_UNDERLINE_STYLED the way it was, it was =3D=3D to
> TM_CAP_UNDERLINE and things went wrong. Took me some time to find back
> then because I couldn't imagine an error there.

Ah, so these are values that we define ourselves.  That explains it.

Then I have nothing relevant to add.  If you think it's good then please
install.

> Making it an enum is for the sake of LLDB which can't handle macros.

They make things nicer with GDB too, IME.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 7 Mar 2025 19:27:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 07 14:27:40 2025
Received: from localhost ([127.0.0.1]:50598 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tqdMC-0003j4-6H
	for submit <at> debbugs.gnu.org; Fri, 07 Mar 2025 14:27:40 -0500
Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:50350)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1tqdM9-0003ir-SJ
 for 75024 <at> debbugs.gnu.org; Fri, 07 Mar 2025 14:27:38 -0500
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5e04064af07so4154635a12.0
 for <75024 <at> debbugs.gnu.org>; Fri, 07 Mar 2025 11:27:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741375651; x=1741980451; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=9xiGSDUGHcyCSP5Mn/W+7lUNpWWxsUMqjwFo+E/dEa8=;
 b=YRieVthy1LrKP43My8NiFE4lytcSJM64Jn4Ujgwq988mA7hoGguzUU2dZ5g5QK1uUA
 DEeyto3nblTsH43R1mO4seTLtk5IhIbegTFmqO4I80zg3sqLoixbet6I26zi1TJpXFoF
 Ex+KY5SZbTBwPWvW0KfgQf26h0bitZWm1q+iafWP+xXk5F1IZ9E2+Yb06H0e9hHFNUU4
 +1639vU+Gpr0d8gnLGMLoYS1cdjx7rwlhV7w+NyHLTo1avHraMH1CueYStASY3ilWmS+
 Z0MHD6gNGaK7j72DM2l0iw2kDZrL4PcM0hNBJhY9igQZspmIrfLYhzVvjgtR0jVIhq8Q
 5Uzg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741375651; x=1741980451;
 h=mime-version:user-agent: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=9xiGSDUGHcyCSP5Mn/W+7lUNpWWxsUMqjwFo+E/dEa8=;
 b=iSz8Wy7yzmweMWoQtNF0U4rilMvYwKf3bW3W0Vb2zjYH3PerYG6U+h0E4Dvm+ghTWA
 zH3/yOqqVsJVG+shxDv8tMZbTCEFbw2HJDKGN+KkzganXbLW0dKrxQj0OE+zUvFQthbn
 mgL1RcCaSzN900CTp2X7lIXGoszDYh5IkwXGTlV3Suj9AXr1S3lpELbQUg0EwuCAjUCY
 aAcWFCRaiG/gM8Br3a9MoMJFUnK8YmnHfbIC8E0dU84FfTYevstePvvxHIQK4c/JFyvu
 w1m5ktrVupVpBhgfk/5/KckZLG+LJrKwld/emia+GGqZ7ehC2I6Nho47Sv5qQxkbfua6
 mlTQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCXMeKy1kUuNPWjfhklEmejOSGj8bzoUputAtLesFk4px4Psc0dY3oRElFMIuDg4pqFopZqQJQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwJZx9jMxdMLbOm/gnqc9fXFzsi1Dqx3Vur11AUlLD+7wE6VCAX
 9QUxb6mfN3bCqO1v04OVXt6p/Zz5Nn4q/WendXvE71+p+6CHaWKeIrcgtw==
X-Gm-Gg: ASbGncvrxBVC7qyMsCprTL98Z7ArJmK3+6oSAMZyHENWbJIsp/tEwIMSsjU8qHN1PBK
 4xVM3Xx6bOTeEFLnQDv0yScAh34/BIT2CXKtAvjip0iuEw8wIl6kO6E6IN4W0Mp4wZJVMj8+Wer
 ARATtMZPm+BNLQojlWDnBtZeHf07hDaLcDf6+rot35Z5OOh5svIwLBv40tcDaTJ6FMdsNijLHDv
 5gUDH/ts6oZc+SPhk7Xfa1Hp5hLzZiS8QNBg0i3QkyAIOJ2KH+ylvpVz0Wn8NyRRkCDHL6IxVLB
 sHwfSNXS/gqZutZDG/n5CrZoD9H3W9D0nY3GVoPuPjzUPqmVFm9KTAJ99ECicEBrdJMr1bSi989
 rFvuh0s3uJQvCuu/rDbxHfi6icr6DdgBmtyyux13ClOdhR8wdsy229Q==
X-Google-Smtp-Source: AGHT+IEAJDETloIFeQ1Y5j3LAWL8hA/7nchUMvJYShFKlcDloiv3j2VhbXz3Vdfs5VWoNzViIuG/Tw==
X-Received: by 2002:a05:6402:3483:b0:5de:3478:269b with SMTP id
 4fb4d7f45d1cf-5e5e24d340cmr5554756a12.32.1741375651113; 
 Fri, 07 Mar 2025 11:27:31 -0800 (PST)
Received: from pro2 (p200300e0b739bc00b0c3c7ebdcf0a197.dip0.t-ipconnect.de.
 [2003:e0:b739:bc00:b0c3:c7eb:dcf0:a197])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5e5c74a7176sm2868082a12.35.2025.03.07.11.27.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 07 Mar 2025 11:27:30 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#75024: Fix check for underlining capability on ttys
In-Reply-To: <CADwFkmmvXh-MEaFWELhNsH-dA2-fmsVxmdF=TaG7UO6wiz6iSw@HIDDEN>
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
 <874j2dh4q5.fsf@HIDDEN> <m2bjwlv5uh.fsf@HIDDEN>
 <871pxhh3yz.fsf@HIDDEN>
 <CADwFkmkkQbT+_cV_P=KKuvBMdtM9nBHA4WJMNjaJe7mYvgV6CQ@HIDDEN>
 <m2jz91nsbz.fsf_-_@HIDDEN>
 <CADwFkmmvXh-MEaFWELhNsH-dA2-fmsVxmdF=TaG7UO6wiz6iSw@HIDDEN>
Date: Fri, 07 Mar 2025 20:27:29 +0100
Message-ID: <m28qpgiqu6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
Cc: Mohsin Kaleem <mohkale@HIDDEN>, 75024 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Stefan Kangas <stefankangas@HIDDEN> writes:

>> -#define TTY_CAP_UNDERLINE_STYLED	(0x32 & TTY_CAP_UNDERLINE)
>> +enum
>> +{
>> +  TTY_CAP_INVERSE = 1 << 1,
>> +  TTY_CAP_UNDERLINE = 1 << 2,
>> +  TTY_CAP_BOLD = 1 << 3,
>> +  TTY_CAP_DIM = 1 << 4,
>> +  TTY_CAP_ITALIC = 1 << 5,
>> +  TTY_CAP_STRIKE_THROUGH = 1 << 6,
>> +  TTY_CAP_UNDERLINE_STYLED = 1 << 7
>> +};
>
> So the values where just wrong before?  IOW, TTY_CAP_INVERSE should be 2
> instead of 1, and so on?  Perhaps this should be mentioned in the commit
> message.
>
> I guess I'm a little bit surprised since most of these values have been
> there, AFAICT, since 2002.

The error was in the definition of TTY_CAP_UNDERLINE_STYLED, the rest are
just bit positions in a bit mask and their values don't matter as long
as they are different.

By defining TTY_CAP_UNDERLINE_STYLED the way it was, it was == to
TM_CAP_UNDERLINE and things went wrong. Took me some time to find back
then because I couldn't imagine an error there.

Making it an enum is for the sake of LLDB which can't handle macros.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 7 Mar 2025 19:18:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 07 14:18:20 2025
Received: from localhost ([127.0.0.1]:50564 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tqdDA-0003HW-H4
	for submit <at> debbugs.gnu.org; Fri, 07 Mar 2025 14:18:20 -0500
Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:59763)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1tqdD8-0003HI-Ex
 for 75024 <at> debbugs.gnu.org; Fri, 07 Mar 2025 14:18:19 -0500
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5e5c7d6b96fso3532246a12.3
 for <75024 <at> debbugs.gnu.org>; Fri, 07 Mar 2025 11:18:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741375092; x=1741979892; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=ENdBwXjZETYPPqFwGlQOhV+o6Lsv2+Xhpp0wPZAUppM=;
 b=fQ+Y4+DsguiCsadxWOakq9+b5ggl4M4vuWF/XjU3FHQFblXvHgjuuLsino+M9hctu4
 i1LrGHptkVOVFzdVeQnZrqTndASGe/8m7pXnsiq4xfsTGo8fUv7fB73qXuelrBecl+sU
 gp/mumtZ03vanLRA2De3eA2veDBjzC+O0HwqjfXtzrtWNQpbMO7Qp3NMPga6RhNzQpqX
 TAFZKEME1R0tE+xKdKLS8i4+rl+gpVpdGxMnjFfx9DrB8UBIjUKo1X647PTCxGzVc/3q
 +HyX/WT0+uoNx7LZ31Ev5uU0CSMHeES3FqHZiQ3HSWoqr+hf+HnJLvQ9EUUJLxjYbazJ
 32SQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741375092; x=1741979892;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=ENdBwXjZETYPPqFwGlQOhV+o6Lsv2+Xhpp0wPZAUppM=;
 b=ja5v9gS7VpNSVX6Q3WX41mQOf+oherFxj29/XMsI42yV3UCkYMlz/eOglM8ShPqV+B
 j0hBPwxdfrRseGqqCSjH6lQA5tWDQbsObgf/ExRpRblJj+DOZTXk2WxQFP+gnBgcHGCf
 domz/EkPBL8jurxrH9JR3HJ0QpbsP0EymT/zC6RGPh2sOfXpX+ZHwG7e5U3KrXjT9dy2
 FsIxaKC5u0ByHmg0fjdDLV2EfZMwi34BX62mnQh8k/MAVHFMFHCnDeBBhjmMHUMo2zzt
 5FFjUIZd/AFBjaWOJ+ZrvCF+xy9zVUkqEA3lNIxvsJgIAYX9BvhBU1Da5w3wTvR9B2yx
 XtHw==
X-Forwarded-Encrypted: i=1;
 AJvYcCWimBVR9cpAo4WXXbXC01Ckc2Yx6NH3nv2UXoBlqDF3nsZ6V2lWTUeCRhT38rIwwk3Ww289dg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yxrul1dQs9RBEKXj+VysiNO7opb3xNu4DBvM8gQOSIAZs3kXVk6
 BiUILK1IfI12HrazNSU7BfaNq/Xrx7FOliusCzbMcLCfkAvYlLkikEascKjY8dfil7AsAuFwxtJ
 PxMPVM5ijOR3NPq5APARQ2RLNAP6rdtdA
X-Gm-Gg: ASbGncsk1t08Tat2EH3h1uvRItSNWMu5jMPsEhDkFB6tI3dWtR5yoDwCN5dHeP73zAu
 DthsDDBxK0JRvkdiumF/PSuJBtGxB0DfB2Y7U7sq2MrWBPQq1qbGsBNJWeoWK0zX4LxZDVAJHrj
 VYo5vkl9vsMhbW8AdL0ivN+OTdmA==
X-Google-Smtp-Source: AGHT+IG7JGgazmCiiXw095wkvCNOUJpfT6uXK+6SF/Gn9ccEmee4MfbE64+9zWXWAaWPL02tekhdkN1pQZRUxoQtHYw=
X-Received: by 2002:a05:6402:518a:b0:5e5:ca1b:c425 with SMTP id
 4fb4d7f45d1cf-5e5e24153e1mr6283230a12.17.1741375091587; Fri, 07 Mar 2025
 11:18:11 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Fri, 7 Mar 2025 11:18:11 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <m2jz91nsbz.fsf_-_@HIDDEN>
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
 <874j2dh4q5.fsf@HIDDEN>
 <m2bjwlv5uh.fsf@HIDDEN> <871pxhh3yz.fsf@HIDDEN>
 <CADwFkmkkQbT+_cV_P=KKuvBMdtM9nBHA4WJMNjaJe7mYvgV6CQ@HIDDEN>
 <m2jz91nsbz.fsf_-_@HIDDEN>
MIME-Version: 1.0
Date: Fri, 7 Mar 2025 11:18:11 -0800
X-Gm-Features: AQ5f1Jo1DZXDeTWPYqfssTfhR1EV4uCuqHW3aHg_VHfD4oOEMncZxL4jdnuqos4
Message-ID: <CADwFkmmvXh-MEaFWELhNsH-dA2-fmsVxmdF=TaG7UO6wiz6iSw@HIDDEN>
Subject: Re: bug#75024: Fix check for underlining capability on ttys
To: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
Cc: Mohsin Kaleem <mohkale@HIDDEN>, 75024 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Stefan Kangas <stefankangas@HIDDEN> writes:
>
>> Mohsin Kaleem <mohkale@HIDDEN> writes:
>>
>>> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>>>
>>>> Would you perhaps have the time to prepare a patch that fixes this?
>>>
>>> I'm a bit swamped atm but could try prepping something in the next few
>>> weeks. Hopefully shouldn't be too big of a change :-).
>>
>> Did you make any progress here?
>
> AFAICT, the attached patch fixes this.

Thanks, I don't know this code so just a small question below.

> From cfc43e88a98be7a1923d5fd182059f70314027f5 Mon Sep 17 00:00:00 2001
> From: =3D?UTF-8?q?Gerd=3D20M=3DC3=3DB6llmann?=3D <gerd.moellmann@HIDDEN=
m>
> Date: Fri, 7 Mar 2025 09:35:20 +0100
> Subject: [PATCH] Fix tty underline capability check (bug#75024)
>
> * src/dispextern.h (TTY_CAP_UNDERLINE_STYLED): Fix. Also make this an
> enum.
> ---
>  src/dispextern.h | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/src/dispextern.h b/src/dispextern.h
> index 833106d2570..816ab9def93 100644
> --- a/src/dispextern.h
> +++ b/src/dispextern.h
> @@ -3495,13 +3495,16 @@ #define DEFAULT_TOOL_BAR_IMAGE_HEIGHT 24
>     capabilities being queried for when calling `tty_capable_p' (which
>     returns true if the terminal supports all of them).  */
>
> -#define TTY_CAP_INVERSE		0x01
> -#define TTY_CAP_UNDERLINE	0x02
> -#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)
> +enum
> +{
> +  TTY_CAP_INVERSE =3D 1 << 1,
> +  TTY_CAP_UNDERLINE =3D 1 << 2,
> +  TTY_CAP_BOLD =3D 1 << 3,
> +  TTY_CAP_DIM =3D 1 << 4,
> +  TTY_CAP_ITALIC =3D 1 << 5,
> +  TTY_CAP_STRIKE_THROUGH =3D 1 << 6,
> +  TTY_CAP_UNDERLINE_STYLED =3D 1 << 7
> +};

So the values where just wrong before?  IOW, TTY_CAP_INVERSE should be 2
instead of 1, and so on?  Perhaps this should be mentioned in the commit
message.

I guess I'm a little bit surprised since most of these values have been
there, AFAICT, since 2002.

>
>  =0C
>  /***********************************************************************
> --
> 2.48.1




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 7 Mar 2025 08:44:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 07 03:44:12 2025
Received: from localhost ([127.0.0.1]:46914 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tqTJT-0008Kx-Us
	for submit <at> debbugs.gnu.org; Fri, 07 Mar 2025 03:44:12 -0500
Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:51317)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1tqTJR-0008Ki-VJ
 for 75024 <at> debbugs.gnu.org; Fri, 07 Mar 2025 03:44:10 -0500
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5e4ebc78da5so2947180a12.2
 for <75024 <at> debbugs.gnu.org>; Fri, 07 Mar 2025 00:44:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741337043; x=1741941843; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=rJFwN4z/LlR9/7o6R1k1Dhe1YDymEaJWgfymgK5pUJE=;
 b=QcVFSLENXtLRqkEzrSmyOyAa4VabZVibCkJxzKDP35q1HYvDRTvtssuc1BEFLnXs9r
 JXIKOxTVE14Z0Ge6oaCK9P7p2GBc9+pO9harAw6LSRQin/3XOZ4qroW0lnG8P09VL4Qt
 DL5UdcsdpGbvX9Hvp7Pg+8SJnc8DvoxkGPXo5EXrUXex50LzsPQQRCnnsmR/haO4ZZnU
 wFW92ZXxuBRN117PothypLd5YLTr39B6eXFNkkeAzCXyrR9w1OY9AZESZ0iuwHxsZ51D
 nRwVcrNf3uzud4/iGer8m4UzONfSdfVrqXDjBErVRS7b8n/aph1Ou65ZYS91ZGyKeUqm
 oQQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741337043; x=1741941843;
 h=mime-version:user-agent: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=rJFwN4z/LlR9/7o6R1k1Dhe1YDymEaJWgfymgK5pUJE=;
 b=XHq4GTTHFbQ7sGfWdHl6ZpL1Ks7FAiM+NL3k3sLPBVLuR9ZyjAMyJ+PHWrDyGm5DNA
 vCujBdfWMlmATg3jZr0UwdLR2JbXjOB7ftSfc511eA5i5zmUJ05TbDeKypKOiXnhPGH3
 3P5k5jpabRABqR0QBEkeUfnLgtV5/Ujy9nZHfdvKR8qIsO4x35iqckJzyAaePICIEru/
 //dY6f6CmRvKZnOIzrUtBxHJSdHi5iCnYfdoAs6CF6iGy/A4CnQw5tkbBsfEGYZ9TRJt
 ckDNFIXJX8pCkypuj4VT/XTfbpl7MOAGsbt4hmq8ahW5agIR6WwYi+G0b9jfha0PLJTz
 +CQw==
X-Forwarded-Encrypted: i=1;
 AJvYcCUUvUN0DQPkoDe/7y5oPacCpsGA5cAJwANcaEcbhOZWGLk6VRLiuKungcAzz9l81HDpWgAHWw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yxd6pxYbVVJLb2ZU+Ms9gpaD807pM8MBpGRG/ojbGc9T+eRtA1T
 WvIus+UTlo4nv8R3294BO7eU9+gjCM1sVaWYLgKRGUNELHY7Wzb0kALbUg==
X-Gm-Gg: ASbGncv12U5ReQHdB6h64hWMJs8jfhmbUuXbCl7wHfYImBd3BSUltibbVQ61kPpXglc
 CVuwK+1n3TMXMSvefYhAd/xSyaXNE5QzWFqyU9kZgEV7RnRqzYhYMpJt62dIzA09urw8pDnBc2G
 kEYb+4ZZmtSwqFQB+k0xA1gfFyUqGeW+zVRedAof9PbqQCv001woJXNjxmk1CwVHx5tt6Iyi88h
 qB0+J9AMljNev+UVGj/tg/cPSlDPSX3rE72cB04/02GvAnmTy48X3XvVr7A2SCQmmp+BKW5OneJ
 7zkue6Pq0mk1D/8BzEA6zYAA47WwsP2nIoPvNximfSWedarKIbBa02iAtmdx6D9BqQ0QW1qS8yi
 GhLnG+PnJPrFBpHrr0u0C6AotympLVYhkBLst66XkfE8LLe15R5tCYw==
X-Google-Smtp-Source: AGHT+IFxkq+8SMdjkMBffFKrDqhPiValWrPh+FxjajxEAIgiHNdIQjR6ZQ0iWTWCS/2fO4rx6MIZRQ==
X-Received: by 2002:a05:6402:3483:b0:5de:3478:269b with SMTP id
 4fb4d7f45d1cf-5e5e24d340cmr2785890a12.32.1741337043080; 
 Fri, 07 Mar 2025 00:44:03 -0800 (PST)
Received: from pro2 (p200300e0b739bc00b0c3c7ebdcf0a197.dip0.t-ipconnect.de.
 [2003:e0:b739:bc00:b0c3:c7eb:dcf0:a197])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5e5c733f991sm2199585a12.13.2025.03.07.00.44.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 07 Mar 2025 00:44:02 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#75024: Fix check for underlining capability on ttys
In-Reply-To: <CADwFkmkkQbT+_cV_P=KKuvBMdtM9nBHA4WJMNjaJe7mYvgV6CQ@HIDDEN>
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
 <874j2dh4q5.fsf@HIDDEN> <m2bjwlv5uh.fsf@HIDDEN>
 <871pxhh3yz.fsf@HIDDEN>
 <CADwFkmkkQbT+_cV_P=KKuvBMdtM9nBHA4WJMNjaJe7mYvgV6CQ@HIDDEN>
Date: Fri, 07 Mar 2025 09:44:00 +0100
Message-ID: <m2jz91nsbz.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
Cc: Mohsin Kaleem <mohkale@HIDDEN>, 75024 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Stefan Kangas <stefankangas@HIDDEN> writes:

> Mohsin Kaleem <mohkale@HIDDEN> writes:
>
>> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>>
>>> Would you perhaps have the time to prepare a patch that fixes this?
>>
>> I'm a bit swamped atm but could try prepping something in the next few
>> weeks. Hopefully shouldn't be too big of a change :-).
>
> Did you make any progress here?

AFAICT, the attached patch fixes this.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Fix-tty-underline-capability-check-bug-75024.patch

From cfc43e88a98be7a1923d5fd182059f70314027f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Date: Fri, 7 Mar 2025 09:35:20 +0100
Subject: [PATCH] Fix tty underline capability check (bug#75024)

* src/dispextern.h (TTY_CAP_UNDERLINE_STYLED): Fix. Also make this an
enum.
---
 src/dispextern.h | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/dispextern.h b/src/dispextern.h
index 833106d2570..816ab9def93 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3495,13 +3495,16 @@ #define DEFAULT_TOOL_BAR_IMAGE_HEIGHT 24
    capabilities being queried for when calling `tty_capable_p' (which
    returns true if the terminal supports all of them).  */
 
-#define TTY_CAP_INVERSE		0x01
-#define TTY_CAP_UNDERLINE	0x02
-#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)
+enum
+{
+  TTY_CAP_INVERSE = 1 << 1,
+  TTY_CAP_UNDERLINE = 1 << 2,
+  TTY_CAP_BOLD = 1 << 3,
+  TTY_CAP_DIM = 1 << 4,
+  TTY_CAP_ITALIC = 1 << 5,
+  TTY_CAP_STRIKE_THROUGH = 1 << 6,
+  TTY_CAP_UNDERLINE_STYLED = 1 << 7
+};
 
 
 /***********************************************************************
-- 
2.48.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.
Changed bug title to 'Fix check for underlining capability on ttys' from '[PATCH] Fix check for underlining capability on ttys' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 23 Feb 2025 00:23:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 22 19:23:04 2025
Received: from localhost ([127.0.0.1]:57972 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tlzlw-0004Md-0f
	for submit <at> debbugs.gnu.org; Sat, 22 Feb 2025 19:23:04 -0500
Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:57616)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1tlzlu-0004LX-5D
 for 75024 <at> debbugs.gnu.org; Sat, 22 Feb 2025 19:23:02 -0500
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5e04f87584dso4786804a12.3
 for <75024 <at> debbugs.gnu.org>; Sat, 22 Feb 2025 16:23:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740270176; x=1740874976; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=ydaMhfGxw8fgg6EpvNdE79wrk3x72LGV7OZICyn4AgM=;
 b=XVWZbqP/SQQX7c7KYjlWLKamJzAry56BOWXzEmmF5xQ6/Rw9U1LEpCJ58FVg9VsosX
 h2m4QgQfcWumDX72TU3o8ZFrwCH3uFVYASk+hQi2L26RgbSo2HtUOW5gFMLwuEZqT6we
 8c5zMYcWKuc3MHrN+BebCaLKth5KpKVq7nj3gotxUfQARlq9daFKGU+hZLjK36+vJmTU
 oM3biGFUjD0V/wewVR6AdRhZw0IHttacdgdUvdQOAI5HVXybULlGpsp9S1q6Db1MjoSj
 9k72kRxILAnkbg9i8qOBgd1nYE405P/q3rM6hzHrmtPVTK+71rlpK+eiXmaURmjjmC+q
 JL3w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740270176; x=1740874976;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=ydaMhfGxw8fgg6EpvNdE79wrk3x72LGV7OZICyn4AgM=;
 b=EcxDcCshT0gJHZs9RtYGs6nvhczOztfWyVrk/sjAnT5+3q3wtY4Mbs4cJLW1EH5qC4
 24GYySFDTWsW/9Vd1JaKCvHm0J55W97ANQto/K+0HYvK08G+F2jcHDDJqebB0BFUR77v
 uGGQGICWjCm5ZJLUUET39ETRFxm4hoyeEgqV3/XJvp0NgpJexniLO0mBSGcytAK96gMY
 jPTfxNba/TlHenB6vWXXiYbIAaGNLfRAL0v5iaANASrELQ3fku+928VrnZgw2fRoWwjv
 FLFCBpbZ5f5OH5KKXiiu87OooqMgUr15Otq4OrJqU+R2IebKKvkhwTFP9I4vgLPrdEAF
 G8Uw==
X-Forwarded-Encrypted: i=1;
 AJvYcCUcEPlXp1aciyT8vsebrPZfyKDdRbwl20Ffgsiar0IQknfPx0x5AvxozRxh22l0M1Ku9QknZA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzCyEXDqYRfeFkWTz0Mx7SIyvEcOJ2QffEHmMjzBnhT0rvyndKI
 PllG1lvhTyNmbniuvO+311RRxuQI/GhNRHyjkflvU2IR9nVc8OhSkGQZmCusJ51xZPohVWucHrA
 cWUSrYR0g9OvQl4DG9yVbWhYDkyKmYS/sQhc=
X-Gm-Gg: ASbGncupF4zCBfqjo4++LXGCH2iAIk34gZMgX1deaAGP9FSCt3WKhIOqLRNPKjGt2pZ
 cY3fHO7SpfeNHMDzcj4AObvmCPubDK4EdNbBpsjs141gTmYCzAlIlrGIQse0XFAiShf0am0UpwP
 sv+GGu46n/
X-Google-Smtp-Source: AGHT+IFHSTYzDZRfaf3iO8He1KZ0l19KRd9VzDQYLn7oQhv4otwFmiCLOlxUPBl3+YxYrw+T5tKWfBCozVo494JjNLE=
X-Received: by 2002:a05:6402:3554:b0:5dc:5a34:1296 with SMTP id
 4fb4d7f45d1cf-5e0b70ef77dmr8186438a12.16.1740270175937; Sat, 22 Feb 2025
 16:22:55 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sun, 23 Feb 2025 00:22:55 +0000
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <871pxhh3yz.fsf@HIDDEN>
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
 <874j2dh4q5.fsf@HIDDEN>
 <m2bjwlv5uh.fsf@HIDDEN> <871pxhh3yz.fsf@HIDDEN>
MIME-Version: 1.0
Date: Sun, 23 Feb 2025 00:22:55 +0000
X-Gm-Features: AWEUYZm8qHERjJ1twKhT6N44mi_cOG0QwhXhVjqKTuUyozxPxgjdv1_V0fNA1xg
Message-ID: <CADwFkmkkQbT+_cV_P=KKuvBMdtM9nBHA4WJMNjaJe7mYvgV6CQ@HIDDEN>
Subject: Re: bug#75024: [PATCH] Fix check for underlining capability on ttys
To: Mohsin Kaleem <mohkale@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
Cc: =?UTF-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>,
 75024 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Mohsin Kaleem <mohkale@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
>> Would you perhaps have the time to prepare a patch that fixes this?
>
> I'm a bit swamped atm but could try prepping something in the next few
> weeks. Hopefully shouldn't be too big of a change :-).

Did you make any progress here?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.
Removed tag(s) patch. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 5 Jan 2025 11:55:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 05 06:55:09 2025
Received: from localhost ([127.0.0.1]:60216 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tUPDp-0006MS-06
	for submit <at> debbugs.gnu.org; Sun, 05 Jan 2025 06:55:09 -0500
Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:48611)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1tUPDm-0006Le-N6
 for 75024 <at> debbugs.gnu.org; Sun, 05 Jan 2025 06:55:07 -0500
Received: by mail-wm1-x333.google.com with SMTP id
 5b1f17b1804b1-436ce2ab251so10990695e9.1
 for <75024 <at> debbugs.gnu.org>; Sun, 05 Jan 2025 03:55:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736078100; x=1736682900; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=SRH2FuwS/oAsD3WNEUtJGvXY6gOG2kjadAUu1u3YJ/M=;
 b=jWPd/pxck9o8udJrr6gvlOlQyC/XLmh0GCz37/75qfrv2za+TikvwlqWPjN7X2vg9A
 lvfFChHFqOgKG6NiQzgauFVn0hnccrCQfup/L0XMip4BHVKcnGafV0SX9rqrjcMezxHX
 C7pVnA6/GRHh0g45gT4YZhNA2xmkvPsueG+xROicVyagmMbk5FrUjNZxuuwZBlnhyynx
 jmQN23M6OoA9rQvdT8gXDlO3Chww/HFlOqcVHHzJJvvo8HmE6pYEQ83eejXGMsovs+3J
 oPiVzSzjnDsKLTb6YZJbQHHbEG9p1t3nQl0So7Oesiddfx7kdDDTRefEXTU1Zx40c4PY
 Q+bw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736078100; x=1736682900;
 h=content-transfer-encoding:mime-version:user-agent: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=SRH2FuwS/oAsD3WNEUtJGvXY6gOG2kjadAUu1u3YJ/M=;
 b=jHTV1mTMCPsoxMCXg7SgSB03+dk1poO5E8g+SiWt9EzYPsusgrm4KgS1jUw4awOLEJ
 tfKRtBXt7s5ISt77yKG+qg6eO/X5Wvy/Zdbv2XidE1r2+3lt6rt4KhB1DN6QMeuw/1Se
 nFf2BkU5hLLpuz2ZcaWnKNnBO+InpUIpgrngc6CNPtaumdxl9hfH6npf4q8z/slHdkK5
 ZQ10SG517GWRmehlCagpxe8UNeDjfATMVSmwwYqFMD3bYv7kXcJ8nbNdngOC4z8m+WFS
 0N7QHAqD5nirr3K2TCQFXCQUdQHtgeaStw2x8VE0SZtUlM3LkFlew98D3ZNfUcOKYCKf
 49rw==
X-Gm-Message-State: AOJu0Yze6eFxScJkefPHx8J/EDOwz01qcmsyFBrKJq1ZAJjBmGVJDQ2l
 vGyDgewz/LZ5Grav3KtCfXEJ9NaOGo/HxqV6umP2jQLtD5FLg6SriYx+fg==
X-Gm-Gg: ASbGncuEBtnGjh4HlxlDRRqrhTC+blSp8rRu0rRnYa7b8yOUQj6LrkvI0XS1gkiWCPj
 /GcQtfhoInQe+gIi+ZwXiEX0fDah7afD979vrmxkzsS3smrvH/MTiSPQyPqXPRW/OHDJ2UCAYyc
 CWMX+NbBM5vcFzjdKmAPtjk6cZbh5y3fFUq7thOgttblvonwqKUYaTFno3m+jCZW1BTbtfiU9bO
 P3Dn99tOlphBV9B28iB4LfALYRw7BgBdLsKbH64XOMGlmzUaH5mjz09S6Buxh2nXLeOsN9I5tPz
 +UjTMlS1GAFPhvsaAaUTDzPqR9MuzSlabPnyzyxU4W+gN/+LttFtTPzq1+GvQh0RSA==
X-Google-Smtp-Source: AGHT+IGaT4Md5KpbQfR1EDzg68CmsCXiR+Aj6/ZT+ADRkPaKvIaNpU4XD/FZmgik3lFZc0/hlCKRbA==
X-Received: by 2002:a05:600c:45cd:b0:434:a7b6:10e9 with SMTP id
 5b1f17b1804b1-436686462f9mr505643755e9.17.1736078099584; 
 Sun, 05 Jan 2025 03:54:59 -0800 (PST)
Received: from pro2 (p200300e0b747500078d774d9859911e7.dip0.t-ipconnect.de.
 [2003:e0:b747:5000:78d7:74d9:8599:11e7])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-38a1c847263sm45172922f8f.50.2025.01.05.03.54.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 05 Jan 2025 03:54:58 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Mohsin Kaleem <mohkale@HIDDEN>
Subject: Re: bug#75024: [PATCH] Fix check for underlining capability on ttys
In-Reply-To: <871pxhh3yz.fsf@HIDDEN> (Mohsin Kaleem's message of "Sun, 05
 Jan 2025 11:53:08 +0000")
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
 <874j2dh4q5.fsf@HIDDEN> <m2bjwlv5uh.fsf@HIDDEN>
 <871pxhh3yz.fsf@HIDDEN>
Date: Sun, 05 Jan 2025 12:54:56 +0100
Message-ID: <m27c79v5kf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
Cc: 75024 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Mohsin Kaleem <mohkale@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
>> Would you perhaps have the time to prepare a patch that fixes this?
>
> I'm a bit swamped atm but could try prepping something in the next few
> weeks. Hopefully shouldn't be too big of a change :-).

Thanks!




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 5 Jan 2025 11:53:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 05 06:53:16 2025
Received: from localhost ([127.0.0.1]:60212 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tUPC0-0006Ie-IY
	for submit <at> debbugs.gnu.org; Sun, 05 Jan 2025 06:53:16 -0500
Received: from 119.ip-51-38-65.eu ([51.38.65.119]:56716 helo=kisara.moe)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mohkale@HIDDEN>)
 id 1tUPBz-0006IE-8K
 for 75024 <at> debbugs.gnu.org; Sun, 05 Jan 2025 06:53:16 -0500
Received: from mk-desktop (unknown [143.58.198.125])
 (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 kisara.moe (Postfix) with ESMTPSA id ABAEDA2CF0;
 Sun, 05 Jan 2025 12:53:08 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe;
 s=default; t=1736077988;
 bh=/A5+b1IMGS7uFJxPyhbY9eMCzA6LClNwHzmHWrR2S6I=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=kkpd5TZ7rEUDv+Vcm8bcmP5I3bCNfzYY83qleTMJs5H60iQORKU3Cf7Zco4tUO2qH
 muG5x9fQC/atlR1GJ6CZfyc2i3JUYcNEHqgy8wAcw9lzo+7c75ajqnuAjdi9Sqnblu
 WwUbN2y95mHTWRnS/P3bBsaUa3MExxnaSg+3Azhbm+nC29j381pZalUfh0mMZXDaJ/
 UwivyjNyqinnoh0Fjd3fhToG78S2/DQ8fEErXVTKPYRSypsdHU+46FU/6WIlePvgV0
 i4dBDSeeJBvFqFzP9/SND/kZ/KvJbtJT6REdvOycexGj2IS/fkd3k4ko6owJ8dxIAp
 KyqcNryB/OoWQ==
From: Mohsin Kaleem <mohkale@HIDDEN>
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
Subject: Re: bug#75024: [PATCH] Fix check for underlining capability on ttys
In-Reply-To: <m2bjwlv5uh.fsf@HIDDEN>
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
 <874j2dh4q5.fsf@HIDDEN> <m2bjwlv5uh.fsf@HIDDEN>
Date: Sun, 05 Jan 2025 11:53:08 +0000
Message-ID: <871pxhh3yz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.4 (/)
X-Debbugs-Envelope-To: 75024
Cc: 75024 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.6 (/)

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Would you perhaps have the time to prepare a patch that fixes this?

I'm a bit swamped atm but could try prepping something in the next few
weeks. Hopefully shouldn't be too big of a change :-).

--=20
Mohsin Kaleem




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 5 Jan 2025 11:49:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 05 06:49:05 2025
Received: from localhost ([127.0.0.1]:60199 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tUP7x-00063J-5E
	for submit <at> debbugs.gnu.org; Sun, 05 Jan 2025 06:49:05 -0500
Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:60604)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1tUP7v-00062Q-DR
 for 75024 <at> debbugs.gnu.org; Sun, 05 Jan 2025 06:49:04 -0500
Received: by mail-wm1-x32d.google.com with SMTP id
 5b1f17b1804b1-436202dd7f6so153705775e9.0
 for <75024 <at> debbugs.gnu.org>; Sun, 05 Jan 2025 03:49:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736077737; x=1736682537; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=2ilFNXWOgzZ+2Z9GAZT1rzdfBju8wjXbr3mf19uZt5w=;
 b=AEaHimgTgVI9ZRU4y0VBSV1xuIZz7DthiS38O/KzBhetUDrlKKDxYVuhC6nh/lBJtC
 cpukO4V9SIhMnM5EZcqt5FpLkiqwi/9rTeZz/5of/U056dsWM7AEglGckMIXlP4amuxF
 bim54PrrrIYdPjR8yEqWApDFXPHa7zd8/8rRI4jshaYmpxLSf1i+37Qw5w1tCdXA7Dea
 pEPUbrUJLCSaQ6t7NtZ3MG3WigfMsk8j/3oisHlbSJSrQzTNlKUWKS1yQjvPPO+Leqdv
 0no7BZGqy+jgsE0OBphzKjCd3At5Bfmu1M89V0cnz2qoS6ifZhtNwdNwEToC1GoRwQG4
 1GDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736077737; x=1736682537;
 h=content-transfer-encoding:mime-version:user-agent: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=2ilFNXWOgzZ+2Z9GAZT1rzdfBju8wjXbr3mf19uZt5w=;
 b=j1HtS6d5/XarxEfO9J3ltW4s40CsKoAs9EFPOBtzAZYOALgZ3ZoK6wFonchhr6GtcA
 F2bLU2MT97FNLA6qODJAPsa+g3PQeixbLuCHQJkbtFWHpRzrzSTKiKNVG8emuGYipkfv
 dJ12xzVlZo5TjQT3zpSpA8D4lYFll1KhKfVAWix2LHxOixy8Yig5gNoMrJ5f0KK59iMm
 cfmmxP6RGygHgbUNXk1RVBH6c3XosGLq1IVyJPg0soKvHzOmfAZkfSHRT7aBdOw1IduN
 6rbLs7g7pmC8uTbMHMfYEztG8pMI57UHZ1ZJ/N+7iwHso67GxtjlTroQUIUID0EUnghq
 5EoQ==
X-Gm-Message-State: AOJu0YzLgCNcad+6G1InuhriOKmUgIydqoqufjf+0JXcaqTFEgVjFO9q
 R+E0cVNIQr6nhoo76TpeNmQJjbth6GwNawufEGYY6x15bFYjPMAwmACKNw==
X-Gm-Gg: ASbGncvYiLjhPpGiubda/HFSzMZwLCVT01PXOpPmB5frX6+jQvAqrgokbupOuQzDKfn
 nU1aBsbRGunkkQBBwEQqTWl2j5cW9oz8F6QTG60c8E9zXZWR6tCqJ5dbIwjlTDyUB3VYbVpNSIY
 C6CtlATL0omZLKvo5tLs0z8qa28/oXFp2E3P+k/GqLg1mHANRfJSBpOfBf1VR99cvYF4WjcRnkl
 TJE4yx2vRxe/1dDu+4W/6S5dnw2u7ZtgeTt6czi6BrfTT/WjMgW/Co0gl5M1MJnHiC9mz8M0ijS
 AKodJfBkhwku3pwNJ2zA6AJ9OwyjNNze/p+Nyv+SehAS1qK2jjVfvlpQsFK3CIHUOA==
X-Google-Smtp-Source: AGHT+IFW9dKIY8mXtBUsVT8wYJ0dgXvDIZv+oK5bfu9UhnbqG0en4Y6GszP3vJrNZwYWKhkcHtrBsQ==
X-Received: by 2002:adf:a455:0:b0:385:df4e:366f with SMTP id
 ffacd0b85a97d-38a223f5c78mr33997469f8f.38.1736077736776; 
 Sun, 05 Jan 2025 03:48:56 -0800 (PST)
Received: from pro2 (p200300e0b747500078d774d9859911e7.dip0.t-ipconnect.de.
 [2003:e0:b747:5000:78d7:74d9:8599:11e7])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4366127c639sm531862905e9.31.2025.01.05.03.48.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 05 Jan 2025 03:48:56 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: Mohsin Kaleem <mohkale@HIDDEN>
Subject: Re: bug#75024: [PATCH] Fix check for underlining capability on ttys
In-Reply-To: <874j2dh4q5.fsf@HIDDEN> (Mohsin Kaleem's message of "Sun, 05
 Jan 2025 11:36:50 +0000")
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
 <874j2dh4q5.fsf@HIDDEN>
Date: Sun, 05 Jan 2025 12:48:54 +0100
Message-ID: <m2bjwlv5uh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
Cc: 75024 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Mohsin Kaleem <mohkale@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
> Hi there,
>
> Sorry for the late response.
>
>>> I meanwhile found this, to my great surprise:
>>>
>>> #define TTY_CAP_UNDERLINE_STYLED	(0x32 & TTY_CAP_UNDERLINE)
>>>
>>> That makes TTY_CAP_UNDERLINE_STYLED =3D=3D TTY_CAP_UNDERLINE. And this =
test
>>> in tty_capable_p
>>>
>>>   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,
>>>
>>> fails because it tests TTY_CAP_UNDERLINE twice, and requires both
>>> TS_enter_underline_mode and TF_set_underline_style to be usable for
>>> underline support. In Terminal.app, only TS_enter_underline_mode is
>>> available.
>>>
>>> Maybe this should have been=20
>>>
>>> #define TTY_CAP_UNDERLINE_STYLED	0x40
>>>
>>> ?
>
> Ah, yep. The original intention was or a new bit flag with the existing
> underline bit flag so that styled underlines were only available in
> environments with at least regular underlines. In retrospect that was
> probably excessive and simply checking for styled underline support by
> itself (with a value of 0x40) is sufficient. I'd find it strange to have
> a terminal that supported styled underlines but not regular ones but
> there's no need to enforce this on the Emacs side.
>
>>>
>>> BTW, the 0x32 also also makes no sense to me because of=20
>>>
>>> #define TTY_CAP_ITALIC  	0x10
>>> #define TTY_CAP_STRIKE_THROUGH	0x20
>>>
>>> CC to the original author to check.
>
> Correct here as well, I should've confirmed the binary representation
> :-(.
>
> 0b00000000000000000000000000010000 0o00000000020 0d0000000016 0x00000010
> 0b00000000000000000000000000100000 0o00000000040 0d0000000032 0x00000020
> 0b00000000000000000000000000110010 0o00000000062 0d0000000050 0x00000032
> 0b00000000000000000000000001000000 0o00000000100 0d0000000064 0x00000040
>
> 0x40 is what the next entry in the flag should have been.

Thanks for checking, Mohsin!

Would you perhaps have the time to prepare a patch that fixes this?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 5 Jan 2025 11:37:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 05 06:37:01 2025
Received: from localhost ([127.0.0.1]:60170 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tUOwH-0005Pk-3n
	for submit <at> debbugs.gnu.org; Sun, 05 Jan 2025 06:37:01 -0500
Received: from 119.ip-51-38-65.eu ([51.38.65.119]:54680 helo=kisara.moe)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <mohkale@HIDDEN>)
 id 1tUOwE-0005PP-3x
 for 75024 <at> debbugs.gnu.org; Sun, 05 Jan 2025 06:36:59 -0500
Received: from mk-desktop (unknown [143.58.198.125])
 (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 kisara.moe (Postfix) with ESMTPSA id 375F5A2CF0;
 Sun, 05 Jan 2025 12:36:51 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kisara.moe;
 s=default; t=1736077011;
 bh=OG+5LsE+ymZ6PC9NqRZWkF/xTslPvVoSwEPLJyTYqCU=;
 h=From:To:Subject:In-Reply-To:References:Date:From;
 b=VXcu3BEfRDlGy1U89F1GpI+gtWWl0QJj/J1qzhsRWYHct+JNT2ktSaQMK4vxif5Se
 s/ZTwlwB/R50uBodX2gqXcZTQccxV8NHq7RjQs265W2RHCSt8eiCZ81wvDpy8jDT0+
 T6MFNNZDXEslfihNC5qSv/2dGDXyVO6NgTrZw80xLzKsmY9OqpgtsBipTdkPHrvf6D
 /Ec2KT+2SxM4BE14DTTVGPitKTJexzKECvBWyTknGdAcADyxRbfVjvvtUWO/YYKhNK
 6WMlfktFH7gqNbVmjRNDd3MVbms8ZvMK7jIWDuPUzuoiQuxkTeisAFEqYcDXJvkfhv
 pwuXjtLP6Mi0Q==
From: Mohsin Kaleem <mohkale@HIDDEN>
To: Gerd =?utf-8?Q?M=C3=B6llmann?= <gerd.moellmann@HIDDEN>,
 75024 <at> debbugs.gnu.org
Subject: Re: bug#75024: [PATCH] Fix check for underlining capability on ttys
In-Reply-To: <m25xmtx5qw.fsf@HIDDEN>
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN> <m25xmtx5qw.fsf@HIDDEN>
Date: Sun, 05 Jan 2025 11:36:50 +0000
Message-ID: <874j2dh4q5.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.4 (/)
X-Debbugs-Envelope-To: 75024
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.6 (/)

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

Hi there,

Sorry for the late response.

>> I meanwhile found this, to my great surprise:
>>
>> #define TTY_CAP_UNDERLINE_STYLED	(0x32 & TTY_CAP_UNDERLINE)
>>
>> That makes TTY_CAP_UNDERLINE_STYLED =3D=3D TTY_CAP_UNDERLINE. And this t=
est
>> in tty_capable_p
>>
>>   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,
>>
>> fails because it tests TTY_CAP_UNDERLINE twice, and requires both
>> TS_enter_underline_mode and TF_set_underline_style to be usable for
>> underline support. In Terminal.app, only TS_enter_underline_mode is
>> available.
>>
>> Maybe this should have been=20
>>
>> #define TTY_CAP_UNDERLINE_STYLED	0x40
>>
>> ?

Ah, yep. The original intention was or a new bit flag with the existing
underline bit flag so that styled underlines were only available in
environments with at least regular underlines. In retrospect that was
probably excessive and simply checking for styled underline support by
itself (with a value of 0x40) is sufficient. I'd find it strange to have
a terminal that supported styled underlines but not regular ones but
there's no need to enforce this on the Emacs side.

>>
>> BTW, the 0x32 also also makes no sense to me because of=20
>>
>> #define TTY_CAP_ITALIC  	0x10
>> #define TTY_CAP_STRIKE_THROUGH	0x20
>>
>> CC to the original author to check.

Correct here as well, I should've confirmed the binary representation
:-(.

0b00000000000000000000000000010000 0o00000000020 0d0000000016 0x00000010
0b00000000000000000000000000100000 0o00000000040 0d0000000032 0x00000020
0b00000000000000000000000000110010 0o00000000062 0d0000000050 0x00000032
0b00000000000000000000000001000000 0o00000000100 0d0000000064 0x00000040

0x40 is what the next entry in the flag should have been.

--=20
Mohsin Kaleem




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 5 Jan 2025 04:08:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 04 23:08:16 2025
Received: from localhost ([127.0.0.1]:58266 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tUHvz-0007IT-U6
	for submit <at> debbugs.gnu.org; Sat, 04 Jan 2025 23:08:16 -0500
Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:52424)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1tUHvw-0007II-28
 for 75024 <at> debbugs.gnu.org; Sat, 04 Jan 2025 23:08:14 -0500
Received: by mail-wr1-x42e.google.com with SMTP id
 ffacd0b85a97d-3862ca8e0bbso10194694f8f.0
 for <75024 <at> debbugs.gnu.org>; Sat, 04 Jan 2025 20:08:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736050090; x=1736654890; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=xi1uFWVVzF9L3BUsWwjw342P+Yo/8ds5o6aURYv/sus=;
 b=KH7xug+9XTHK6AVwyAzh6CFPjqVe1z3HfMqN7kmcu7Wwz1Bn0Yhuh/pF368YhksT7w
 Bc32SCXVBXPvde+Y+XfsCwTUnahlN43T0qtGoVgn3XBwPtfZo2MeUgs5cZPFcK8YobUk
 G9wVVuay1tuqr6wOUkX8fk3Ko4mZWuE3SlYZtZPVufYhaKjpOJnIgv0T2fowUfprSxcY
 HItfrwF0HE210oNnsgamPblhWUZZKJjhVLz7yPLoMaqren8wSl+5v5lvu2PlEimfzcS2
 kumiv/xSOl2Ruj1fpuM0MebJzGZFMbBJvGGISEYIkKRxSCF2xcCbyzYjpHGVo57iNt9L
 OHLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736050090; x=1736654890;
 h=content-transfer-encoding:mime-version:user-agent: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=xi1uFWVVzF9L3BUsWwjw342P+Yo/8ds5o6aURYv/sus=;
 b=OziYfTIULaKNjermHXnFayTekAiSFVInvxO+K0iH1bDft+jmhHT9PHlnhZVlk3rwDI
 B7XT0aYLmenVNH3OS3z6lrrFPOXAAZiLlTDQ23uQAgQ+vKRht8KdkHMOIfPkO8Ns4N3y
 C5vW5wHzf9fE0LmLdfOsokmijYgYRRobXMubR+uf1GD6O+Ly3iC94R+PhIVJLtmdvkOg
 At1bg58BQUMd0Q8x6UnXYuJN8uBCP/zIi02/ztRmcpe0aLdFEsj5dXnosSUZPdkgefCG
 PUa6ypbrO4PorO5UE5BSIv2DkBAu0XlYEUOJ8r3et3QK4p+f2ESn2DBmmUHLHZf5MmhN
 w1jA==
X-Gm-Message-State: AOJu0YwH7wDYwxPkkwAz55AY1xmtnhL3/6iSV9L25htaojy3aPOHzQr4
 fcug+ofAH+GqGhnkjn1G9OOZY8s+ADIIbnZZux6hYQ+6jAmulmYH
X-Gm-Gg: ASbGncuvOlDilLjPxY9w5yeYtgco/vdrmEE9v9xYltWm8DjJeH23mB44rmjZdTuzvn4
 thn9yCUj8DLn06YJ3K4GvAtiAGzOpjomWTfLDjGopuEc581sidhkLfxdHzoOKyj6bRq4+bRwKxY
 lNBwjxIsS8SH1aft+NG9D1IvX/PabcHCqJz9ZzPD+ZLiCXqQgY3iDwvr4cFWG4unjrwCfWhbfpl
 FEhUJLLlH9KWOxPetURG91QY4XE8hqK0oSaOATW2SGvol3GQagCzG6aQgC5EPkRwmcEKSBAeM7c
 Wu5ShiKX4tEG2xQwXp9MfHoKy6uoYRhCFNPpPA+y2am9P+DIE66HQ9tv/HFa480pbw==
X-Google-Smtp-Source: AGHT+IEK7wDyXw+0vilVaV0+dN4iW6PiXgnnNj1oWKEGcBrtPAl0ZOENoMnLkp4GMzaZ09BdVWv62A==
X-Received: by 2002:a5d:5f4f:0:b0:386:375a:8322 with SMTP id
 ffacd0b85a97d-38a221ea68cmr46738957f8f.13.1736050090367; 
 Sat, 04 Jan 2025 20:08:10 -0800 (PST)
Received: from pro2 (p200300e0b747500078d774d9859911e7.dip0.t-ipconnect.de.
 [2003:e0:b747:5000:78d7:74d9:8599:11e7])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-38a1c8a8d32sm44901663f8f.99.2025.01.04.20.08.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 04 Jan 2025 20:08:09 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: 75024 <at> debbugs.gnu.org
Subject: Re: bug#75024: [PATCH] Fix check for underlining capability on ttys
In-Reply-To: <m2ttauj0lm.fsf@HIDDEN> ("Gerd =?utf-8?Q?M=C3=B6llmann=22'?=
 =?utf-8?Q?s?= message of "Mon, 23 Dec 2024 08:54:29 +0100")
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
 <m2ttauj0lm.fsf@HIDDEN>
Date: Sun, 05 Jan 2025 05:08:07 +0100
Message-ID: <m25xmtx5qw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
Cc: Mohsin Kaleem <mohkale@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


Hi Mohsin, friendly ping. Could you find the time to look at this?

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
>> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>>
>>> Tags: patch
>>
>> Please disregard the patch. I'll send another one later.
>
> I meanwhile found this, to my great surprise:
>
> #define TTY_CAP_UNDERLINE_STYLED	(0x32 & TTY_CAP_UNDERLINE)
>
> That makes TTY_CAP_UNDERLINE_STYLED =3D=3D TTY_CAP_UNDERLINE. And this te=
st
> in tty_capable_p
>
>   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,
>
> fails because it tests TTY_CAP_UNDERLINE twice, and requires both
> TS_enter_underline_mode and TF_set_underline_style to be usable for
> underline support. In Terminal.app, only TS_enter_underline_mode is
> available.
>
> Maybe this should have been=20
>
> #define TTY_CAP_UNDERLINE_STYLED	0x40
>
> ?
>
> BTW, the 0x32 also also makes no sense to me because of=20
>
> #define TTY_CAP_ITALIC  	0x10
> #define TTY_CAP_STRIKE_THROUGH	0x20
>
> CC to the original author to check.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 23 Dec 2024 07:55:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 23 02:55:34 2024
Received: from localhost ([127.0.0.1]:53163 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tPdHq-0006g3-8o
	for submit <at> debbugs.gnu.org; Mon, 23 Dec 2024 02:55:34 -0500
Received: from mail-ej1-f47.google.com ([209.85.218.47]:43215)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gerd.moellmann@HIDDEN>) id 1tPdHo-0006fs-JB
 for 75024 <at> debbugs.gnu.org; Mon, 23 Dec 2024 02:55:33 -0500
Received: by mail-ej1-f47.google.com with SMTP id
 a640c23a62f3a-aa679ad4265so889527966b.0
 for <75024 <at> debbugs.gnu.org>; Sun, 22 Dec 2024 23:55:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1734940471; x=1735545271; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=O3SlHbCXaTbZQOF2qis/4KZUQV5GaiWBBygpKdpvvcQ=;
 b=muGbKOfJm8EAbw91MLK5+7WszmbTR9MCVkbnoJc5cW87U9yUGJPA/w7LlUVvMQYTp/
 IkGenC6P5fWOy2XzZsSiXinUQ0J7G4DSa+nHo7pIomQRe1ktp3Z4Dw4LCSGPCm/HP/vf
 Xh7foSESk39PNp3ksUgz2wqCWLBCiNhaUIOO9w4DO64I4qm3R/sgk52bcfvQ93Klt3yE
 uNAMKSCUrJH1cvRLvsW5hhUdvFcFAvpminUmRtDC7RNeKCAfPdZxSh0GtoSxjzQ+bSHz
 yQLdhCC+b6eRNf22xIYcBrVeKupk1tN0b8s6kZBliCOgHkSizCTF1Qlw0p5IV0y9ywdX
 q7+Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1734940471; x=1735545271;
 h=content-transfer-encoding:mime-version:user-agent: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=O3SlHbCXaTbZQOF2qis/4KZUQV5GaiWBBygpKdpvvcQ=;
 b=ci8IdsZW/9ShEeE+LhmqbqyxFkRZQ8n1Vx5O2Dh79teuAEt2t/aYroCbXN1GAah84D
 thHig0TrmEGXOwKMS+BUs99nSgCMFQGGnQZ4DejYCb0++jxQFcYIFGzWewxSpJNiE38s
 DAclh2IJ94C6XyeYakuXAJirHrEq4QJiUwbOaR/RevCC4go3EIWZ8JtQb8+LLfOP3vk1
 +I55AXRUcQUqOV8s5i1SEys3MY4WnxDtCu5HVf4S2eemqP+MWznVOS7ofNW3ga0VIuCw
 vALwtppw5UtVSkQKVL8rHOHrz3U/CY9zW6IgDJXo4MIsoPxDxJThWxcHRuczHgYyx4lM
 GrPw==
X-Gm-Message-State: AOJu0Yw1XiixCeWtlDjvGZgRE7GbJQaED5aQKZnWTS663ypxkQ8Qw8XO
 R2NGa33zQjTqe+WB6irlEOX+aln0l+phYr8XLVnsZdUqmduLwFRQd7MhZQ==
X-Gm-Gg: ASbGncuu84N2/+ODnakK95L3B/atGV9LkDfLKgvJPgnhhPzwtsIWrDKjBxrXrcqiXUr
 fU118f2XtF+aXg5SCN5rSAFRqQatABBgHLFcZF7tRtZxUttc+xxg3H3UdGAwvaz8/rddrcxvlP3
 SbeoZcOuZZ6cHqHfqCLX5hFkzPBprNuQH1+whsyVOzjloR0m4lyK1DIayZSAO3MXDw5WF4rTbTX
 AIYDAt6Lo1kgVsIq1z2VFPsBD49E9N6TOoERXHPb0yh5sG6TKZ8lCdQI7HXhmC+a5CvrNRGuxzt
 gigyp4VHqsOV2KbUUCm1WIgH9qmvgt7tA3QX4wEfsF+aZivEWNnqtDPlVg4j+Ol7Hw==
X-Google-Smtp-Source: AGHT+IFoFr+FAw5ycBsoeK0K9D9/nMeYU+PJhfsRTd6KofAW7OClolHZ8+j3LSFIkvli+OKdFGIzag==
X-Received: by 2002:a17:907:2d22:b0:aa6:acbe:1a81 with SMTP id
 a640c23a62f3a-aac0822b57cmr1545709866b.21.1734940471219; 
 Sun, 22 Dec 2024 23:54:31 -0800 (PST)
Received: from pro2 (p200300e0b728c00045f88d4d4db0c1e7.dip0.t-ipconnect.de.
 [2003:e0:b728:c000:45f8:8d4d:4db0:c1e7])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-aac0f06ebf3sm479589466b.196.2024.12.22.23.54.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 22 Dec 2024 23:54:30 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: 75024 <at> debbugs.gnu.org
Subject: Re: bug#75024: [PATCH] Fix check for underlining capability on ttys
In-Reply-To: <m25xnbx7wy.fsf@HIDDEN> ("Gerd =?utf-8?Q?M=C3=B6llmann=22'?=
 =?utf-8?Q?s?= message of "Mon, 23 Dec 2024 06:52:45 +0100")
References: <m234ifoo6l.fsf@HIDDEN> <m25xnbx7wy.fsf@HIDDEN>
Date: Mon, 23 Dec 2024 08:54:29 +0100
Message-ID: <m2ttauj0lm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
Cc: Mohsin Kaleem <mohkale@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:
>
>> Tags: patch
>
> Please disregard the patch. I'll send another one later.

I meanwhile found this, to my great surprise:

#define TTY_CAP_UNDERLINE_STYLED	(0x32 & TTY_CAP_UNDERLINE)

That makes TTY_CAP_UNDERLINE_STYLED =3D=3D TTY_CAP_UNDERLINE. And this test
in tty_capable_p

  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,

fails because it tests TTY_CAP_UNDERLINE twice, and requires both
TS_enter_underline_mode and TF_set_underline_style to be usable for
underline support. In Terminal.app, only TS_enter_underline_mode is
available.

Maybe this should have been=20

#define TTY_CAP_UNDERLINE_STYLED	0x40

?

BTW, the 0x32 also also makes no sense to me because of=20

#define TTY_CAP_ITALIC  	0x10
#define TTY_CAP_STRIKE_THROUGH	0x20

CC to the original author to check.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at 75024 <at> debbugs.gnu.org:


Received: (at 75024) by debbugs.gnu.org; 23 Dec 2024 05:53:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 23 00:53:56 2024
Received: from localhost ([127.0.0.1]:52938 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tPbO8-0000Ir-MV
	for submit <at> debbugs.gnu.org; Mon, 23 Dec 2024 00:53:56 -0500
Received: from mail-ed1-f46.google.com ([209.85.208.46]:55335)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gerd.moellmann@HIDDEN>) id 1tPbO6-0000Ia-3x
 for 75024 <at> debbugs.gnu.org; Mon, 23 Dec 2024 00:53:55 -0500
Received: by mail-ed1-f46.google.com with SMTP id
 4fb4d7f45d1cf-5d437235769so248266a12.2
 for <75024 <at> debbugs.gnu.org>; Sun, 22 Dec 2024 21:53:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1734933168; x=1735537968; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=Wpq1JhBXH1heX8DjqB2kzmSEWp+1MB9s8BJVT8aNsH0=;
 b=S3CFOPAyqbpJTyodVubYrc1Z93ikhTGKaL57iQWQG93na8CfyPrIAtPq/dBJUWTnx1
 y60g0jSE3/M4J8lb70GbzumTqzFz8e7kP2nTxRDaZpnChQHRfgQr6JkCcACGkkawTfjW
 qRVs+5R8HgfbyjOLWn7x6GfixYYsyvAYuWpA4S1PCz8vVtiLDOSigC3mAhR2GJ0W1xEC
 fIJcYbhNjN57wtCT5ZyOXyT6OKUBvgs8U6NpNuoUit0/Ryw+qjcfzRTEc5hvFgh16Ale
 9pNHRx+FnqNmlcyNQ6yOsvemvsL8J6YFfT+5L3gD09/tRxMdN19AfV5yzAdlPE1zgx9I
 6h8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1734933168; x=1735537968;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:to:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=Wpq1JhBXH1heX8DjqB2kzmSEWp+1MB9s8BJVT8aNsH0=;
 b=L47Zw07S/6iy4W1BaxLGg4uWN7hMnlbXoHPHLLxX0dG28u3xDe+Nwdvp4zkGeNrUR6
 XpicQKJkHwcMYQJYZIRkL73ryrs4cO3NJezz/wZg7lztER/lo2kyc+YKWGB8t6aiO/0P
 t49JoJkZPXcnagN1If2iSxWfOd60KxYvbphHQH98S3xL0MDh3b1if/chD5IH24TIYtIw
 2DmboBfsDhnSaMRTY3k696CLGleryrJJyN/s/MUV9mRj/DBO/rIKIwXl7EOWApEycLmN
 wIoNWcF5+LoM6WMx10gtAv+tcHlv7ovcJVv5BwM1gFA8W8KxD30eMufwc+X2aCNg12Xc
 cPHw==
X-Gm-Message-State: AOJu0YyWpHeua+oEeMtBh9z46sx4mmA4u1Yxuiu3V5/T2zwpmnbPUz+m
 IoOrJvkqqnZkpUHSs3INCvYeByUc7OXFSzwhAsP03Xqha4z2G+XOxH8CIA==
X-Gm-Gg: ASbGncsfpHsGd8XR0++QjX6aEvZzO1tWiyucQDlYlJ9DIW6JJy+iM9XmsDUE+2QkjXV
 tvf1e/v2uiXwnYYNm0uVgky+qOyZ41whlEWntLb8XnIL/2yr0k5tAmJGsr5XVFa754sLkq9gV9k
 Hcz7WHrHSFPl6mY+GaQ4iWDFz7yx7S9hpqMneC6JV9V8wqoatPdKyXECNf3iWgUL5p/tq250EtV
 /5BaGSFaKYFUKKj80CO3EPztLzQguuQo8hbE2zsKZyvAbo2j222Oq8LMmS4LsV7JpxOW9EoT601
 0tRo8BACUYqDm37O8samPm4j4xGkb50L/R8JW/8aAZn+Wj0anXtwUfe8lpHF/uVLvQ==
X-Google-Smtp-Source: AGHT+IE4r84vp+tfZOz/o6tCfeOoEnbH/HgEaACzH/PqEXOmj+9q1NL5nc+3s93i+HUdISQB2gvL6w==
X-Received: by 2002:a17:907:d92:b0:aa6:7c8e:8087 with SMTP id
 a640c23a62f3a-aac27026fdfmr1095567466b.12.1734933167850; 
 Sun, 22 Dec 2024 21:52:47 -0800 (PST)
Received: from pro2 (p200300e0b728c00045f88d4d4db0c1e7.dip0.t-ipconnect.de.
 [2003:e0:b728:c000:45f8:8d4d:4db0:c1e7])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-aaee340665asm15551466b.187.2024.12.22.21.52.46
 for <75024 <at> debbugs.gnu.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 22 Dec 2024 21:52:46 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: 75024 <at> debbugs.gnu.org
Subject: Re: bug#75024: [PATCH] Fix check for underlining capability on ttys
In-Reply-To: <m234ifoo6l.fsf@HIDDEN> ("Gerd =?utf-8?Q?M=C3=B6llmann=22'?=
 =?utf-8?Q?s?= message of "Sun, 22 Dec 2024 14:13:54 +0100")
References: <m234ifoo6l.fsf@HIDDEN>
Date: Mon, 23 Dec 2024 06:52:45 +0100
Message-ID: <m25xnbx7wy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 75024
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Gerd M=C3=B6llmann <gerd.moellmann@HIDDEN> writes:

> Tags: patch

Please disregard the patch. I'll send another one later.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Dec 2024 13:14:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 22 08:14:05 2024
Received: from localhost ([127.0.0.1]:49379 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tPLmW-0003Ru-Tu
	for submit <at> debbugs.gnu.org; Sun, 22 Dec 2024 08:14:05 -0500
Received: from lists.gnu.org ([209.51.188.17]:49692)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gerd.moellmann@HIDDEN>) id 1tPLmU-0003Ra-0m
 for submit <at> debbugs.gnu.org; Sun, 22 Dec 2024 08:14:02 -0500
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 <gerd.moellmann@HIDDEN>)
 id 1tPLmT-0001UJ-47
 for bug-gnu-emacs@HIDDEN; Sun, 22 Dec 2024 08:14:01 -0500
Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <gerd.moellmann@HIDDEN>)
 id 1tPLmR-0003ud-8M
 for bug-gnu-emacs@HIDDEN; Sun, 22 Dec 2024 08:14:00 -0500
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5d0f6fa6f8bso5410312a12.0
 for <bug-gnu-emacs@HIDDEN>; Sun, 22 Dec 2024 05:13:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1734873237; x=1735478037; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=jHp9XNXeGIdNQE40oPCgQfzeKy4KbwiTw8WEBcXfAs4=;
 b=lBKIZ8iWFOAmkwolxjX/BR/bgBpBxyV1jjIDuIy9BxLPU2qcUUsI0d4LPy4bfFV4iL
 XbR9we/GN/5muikZotKMQrbeot5/DuVASyZjxNu+kJqVXyEIMf8H9j2RgbI/qCF0B7WQ
 mUupDNjFJYxB5orhgM/UkBfdbZ79rYlBkp4UMje31zmLrVcuYucCaebtOsnSphhgaSOU
 IDgUrzjTQiQ1qFWkdOJDWPxu6hbI2aM6MEjYP5eB60GPmpzRCMrd3OA8EQL+/aHZ+JUx
 OAusxh3pfQ3Yd4tj6o6OR0KQVZ41VlWwHJFS8S30gflAFlRnx3JlqRL7ge1OyXcSkloo
 Vchg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1734873237; x=1735478037;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=jHp9XNXeGIdNQE40oPCgQfzeKy4KbwiTw8WEBcXfAs4=;
 b=ZpCHnkTRQMWyIuLaxU2p/pNDHbit/YtVStNn+/9+zImjKvdBI1PoarNsVKCkWADcp+
 xs7PHqs0jBjZ9iwrKupTAFWY0ekay03WCHYmsuIeFPxNmiUrtjuBQa/h5hYD+ZZRs6X+
 vv7wbGODXKcNVWpjPrgjtiuk0iL7YQtHPPYQftypZmmyP7pSXGMGD2qu5kJHhZxNZmRA
 19TniLU7GY8X3+NIE9Wi3nPimxG3ceijx1/FQ5DA4ArLvPoJXDzgQx7o1hJxyX4c4nyh
 s7aftgU4u0eryihcbakrKl9zboCh+Si1+vPNJ/IuIRquNQNTFm9UI1L0dKryv09mCKu6
 xHIw==
X-Gm-Message-State: AOJu0Yw8DFbSa3MebnuNsylNlRTEOQZLdwVo8xRWreumFKe+52739J5H
 ATIJ1cUa9hVQH0J7u75NeioQEulUaIvdAy5BRbm08hi8gh8cGEX7S2oecQ==
X-Gm-Gg: ASbGncuQi9khaVXsqznvcECelbjfI2Eicnf0R6+w1YqZWhIh3yiolPMGqQEmrktOiOV
 xBOoCxP6fnIOm1xolR6lDgfTJ5qQq5tyQvdavKEB6360QnikC4c54Hh07fdCFhu83evCQmGbZnp
 WoXulgHHfvffBQBMWHRg5WbQHlG4C44n0gMBeiemr7JskDIcXFrxRY8A//wsS9Ro7uNJEWNtUrs
 z4oxwMkyq7HivOQMR9ZbvWOfUz1OUvUqJEcdtjL6vSbenII1JTCrQCvpQlcEX69zDmnU5EUrHEV
 IniD9CRVRg97rWnLzumkyMo7v+UwycPiEXy4EpQko3/PQU49OXkCUopWkHHdOVa9rA==
X-Google-Smtp-Source: AGHT+IGbHHTDFL2E9B2zE3Uu6H2n2pM9bvQkn7oiwsCOkvUV7A/Sco853LGpZ9TWL993MtNM6cR02w==
X-Received: by 2002:a05:6402:13c8:b0:5d4:3761:d184 with SMTP id
 4fb4d7f45d1cf-5d81dd7f3b0mr8968500a12.10.1734873236892; 
 Sun, 22 Dec 2024 05:13:56 -0800 (PST)
Received: from pro2 (p200300e0b71f6700b0196211433a3436.dip0.t-ipconnect.de.
 [2003:e0:b71f:6700:b019:6211:433a:3436])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d80701ac68sm3664387a12.78.2024.12.22.05.13.54
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 22 Dec 2024 05:13:55 -0800 (PST)
From: =?utf-8?Q?Gerd_M=C3=B6llmann?= <gerd.moellmann@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Fix check for underlining capability on ttys
X-Debbugs-Cc: 
Date: Sun, 22 Dec 2024 14:13:54 +0100
Message-ID: <m234ifoo6l.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::52b;
 envelope-from=gerd.moellmann@HIDDEN; helo=mail-ed1-x52b.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain

Tags: patch

With current master

emacs -nw -Q on Terminal.app, $TERM=xterm-256color

1. (display-supports-face-attributes-p '(underline t))
     => nil

2. C-h f context-menu-map RET
   => The separator line in *Help* in underlined, which
   means that term.c thinks that underlines can be used.

display-supports-face-attribute-p uses tty_capable_p in term.c.
This code in tty_capable_p looks wrong:

  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);

It returns false as soon as it finds TS_enter_underline_mode is cannot
be used, and doesn't check TS_set_underline_style. The output code uses
one or the other

  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);
	}
    }

In GNU Emacs 31.0.50 (build 6, aarch64-apple-darwin24.2.0) of 2024-12-22
 built on pro2
Repository revision: d481da70010eab163d12f770ed11f8fef171406a
Repository branch: cl-packages
System Description:  macOS 15.2

Configured using:
 'configure --without-ns --cache-file
 /var/folders/1d/k_6t25f94sl83szqbf8gpkrh0000gn/T//config.cache.cl-packages
 --with-native-compilation --with-mps=yes CC=clang
 'CFLAGS=-Wgnu-imaginary-constant -Wunused-result -g
 -fno-omit-frame-pointer -F
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
 -Wno-ignored-attributes -Wno-flag-enum -Wno-missing-method-return-type
 -Wno-variadic-macros -Wno-strict-prototypes -Wno-availability
 -Wno-nullability-completeness' --prefix=/Users/gerd/.local'


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-Fix-check-for-underlining-capability-on-ttys.patch

From 419a5fa0fd98f673660b123f5b37c99cd0b8c61b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= <gerd@HIDDEN>
Date: Sun, 22 Dec 2024 14:11:33 +0100
Subject: [PATCH] Fix check for underlining capability on ttys

* src/term.c (tty_capable_p): Check both possible terminal capabilities
for underlining.
---
 src/term.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/term.c b/src/term.c
index f2d1846e488..875d4d2deff 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2113,18 +2113,20 @@ turn_off_face (struct frame *f, struct face *face)
 tty_capable_p (struct tty_display_info *tty, unsigned int caps)
 {
 #ifndef HAVE_ANDROID
-#define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit)				\
-  if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P (tty, NC_bit)))	\
-    return 0;
+# define TTY_CAPABLE_P(tty, cap, TS, NC_bit) \
+   ((caps & (cap)) && (TS) && MAY_USE_WITH_COLORS_P (tty, NC_bit))
+# define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \
+  if (!TTY_CAPABLE_P (tty, cap, TS, NC_bit)) \
+    return false;
+
+  if (!TTY_CAPABLE_P (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode,
+		      NC_UNDERLINE)
+      && !TTY_CAPABLE_P (tty, TTY_CAP_UNDERLINE_STYLED,
+			 tty->TF_set_underline_style, NC_UNDERLINE))
+    return false;
 
   TTY_CAPABLE_P_TRY (tty,
 		     TTY_CAP_INVERSE,	  tty->TS_standout_mode, NC_REVERSE);
-  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,
@@ -2135,8 +2137,7 @@ #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit)				\
 		     TTY_CAP_STRIKE_THROUGH, tty->TS_enter_strike_through_mode,
 		     NC_STRIKE_THROUGH);
 
-  /* We can do it!  */
-  return 1;
+  return true;
 #else
   return false;
 #endif
-- 
2.47.1


--=-=-=--




Acknowledgement sent to Gerd Möllmann <gerd.moellmann@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#75024; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 8 Mar 2025 08:30:02 UTC

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