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

Previous Next

Package: emacs;

Reported by: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Date: Sun, 22 Dec 2024 13:15:02 UTC

Severity: normal

Fixed in version 31.1

Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Mohsin Kaleem <mohkale <at> kisara.moe>, 75024 <at> debbugs.gnu.org
Subject: bug#75024: Fix check for underlining capability on ttys
Date: Fri, 07 Mar 2025 20:27:29 +0100
Stefan Kangas <stefankangas <at> gmail.com> 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.




This bug report was last modified 135 days ago.

Previous Next


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