From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#75024: [PATCH] Fix check for underlining capability on ttys Date: Sun, 05 Jan 2025 12:48:54 +0100 Message-ID: References: <874j2dh4q5.fsf@kisara.moe> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12040"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 75024@debbugs.gnu.org To: Mohsin Kaleem Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 12:50:22 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tUP9B-00032J-Sg for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 12:50:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUP8u-0005rc-Im; Sun, 05 Jan 2025 06:50:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUP8s-0005rM-NJ for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 06:50:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tUP8s-00016G-Dz for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 06:50:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=2ilFNXWOgzZ+2Z9GAZT1rzdfBju8wjXbr3mf19uZt5w=; b=ZhquRoYLhShtozr90v3dRFfY4jGiYjmVG5H4DbEukDr8bruuFdvQeJ1jNxch9NT23Am2BcXauD73aBdunyEQR9/tPMcBzQhPEkJarkbZh+ejzisAJGuomCXImuO0z9jqIk+kfQmN6HEVyr2QrjtciNYUgmwnqdTZsS1cbFpL5J2MNkk83CI156Wjhum3n4U3HcKb5liEy8k93jQD4jeOkwYyjNaaRYkjR0kcY6mYYdIjwBSFVGPZd/WltS2jsTBZ/pclRgSfo5a1/VwNZP2gX1VvQQzYk4VSgud2jrq68oEADcvZJJtiQ9vrQ1/0VdnJM/k7wRq95frC3eCSNxqCAA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUP8s-00065E-8v for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 06:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2025 11:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75024 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 75024-submit@debbugs.gnu.org id=B75024.173607774523273 (code B ref 75024); Sun, 05 Jan 2025 11:50:02 +0000 Original-Received: (at 75024) by debbugs.gnu.org; 5 Jan 2025 11:49:05 +0000 Original-Received: from localhost ([127.0.0.1]:60199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUP7x-00063J-5E for submit@debbugs.gnu.org; Sun, 05 Jan 2025 06:49:05 -0500 Original-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 ) id 1tUP7v-00062Q-DR for 75024@debbugs.gnu.org; Sun, 05 Jan 2025 06:49:04 -0500 Original-Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so153705775e9.0 for <75024@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) Original-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) In-Reply-To: <874j2dh4q5.fsf@kisara.moe> (Mohsin Kaleem's message of "Sun, 05 Jan 2025 11:36:50 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298548 Archived-At: Mohsin Kaleem writes: > Gerd M=C3=B6llmann 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?