all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mohsin Kaleem <mohkale@kisara.moe>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>, 75024@debbugs.gnu.org
Subject: bug#75024: [PATCH] Fix check for underlining capability on ttys
Date: Sun, 05 Jan 2025 11:36:50 +0000	[thread overview]
Message-ID: <874j2dh4q5.fsf@kisara.moe> (raw)
In-Reply-To: <m25xmtx5qw.fsf@gmail.com>

Gerd Möllmann <gerd.moellmann@gmail.com> 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 == 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 
>>
>> #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 
>>
>> #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.

-- 
Mohsin Kaleem





  reply	other threads:[~2025-01-05 11:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-22 13:13 bug#75024: [PATCH] Fix check for underlining capability on ttys Gerd Möllmann
2024-12-23  5:52 ` Gerd Möllmann
     [not found]   ` <m2ttauj0lm.fsf@gmail.com>
2025-01-05  4:08     ` Gerd Möllmann
2025-01-05 11:36       ` Mohsin Kaleem [this message]
2025-01-05 11:48         ` Gerd Möllmann
2025-01-05 11:53           ` Mohsin Kaleem
2025-01-05 11:54             ` Gerd Möllmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874j2dh4q5.fsf@kisara.moe \
    --to=mohkale@kisara.moe \
    --cc=75024@debbugs.gnu.org \
    --cc=gerd.moellmann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.