GNU bug report logs -
#54774
28.1; ansi-color with no colors in Emacs-28
Previous Next
Reported by: Thierry Volpiatto <thievol <at> posteo.net>
Date: Thu, 7 Apr 2022 20:01:02 UTC
Severity: normal
Tags: moreinfo
Found in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 4/8/2022 6:23 AM, Lars Ingebrigtsen wrote:
> Thierry Volpiatto <thievol <at> posteo.net> writes:
>
>> it seems using ansi-color-apply in Emacs-28 is not working properly,
>> there is no colors. In Emacs-29 it is working properly (very nice)
>> without needing a workaround used previously in emacs-27 (code commented).
>> See code below to reproduce and Screenshots attached.
>
> I'm not sure I understand this bug report. Are you asking for the code
> in ansi-color in Emacs 29 to be backported to Emacs 28.2?
I think the issue is that there were some changes in Emacs 28.1 (by me,
see commit ceb9da3b7125fbdf0da04a3b158ac1e792c87f4f) to add support for
ANSI "bright" colors. In 29, Miha added support for 256-color and 24-bit
ANSI colors as well (see 0fa2279b90bf5a638d8377032b71135e1374e8fb).
I've verified that Emacs 28.1 properly handles normal and bright ANSI
colors in shell output. Bold/italic/etc works correctly as well, even
though I added an unnecessary quote to the face definitions - that's
been fixed in Emacs 29, and could be backported to 28, though I don't
think it causes any serious problems.
That said, it looks like Thierry had written some code for Emacs 27 that
scans the output of a command that uses ANSI 256-color sequences and
then translates those sequences into ANSI 8-color sequences that
ansi-color.el will understand. However, that code no longer works in
Emacs 28, possibly due to my changes to support ANSI bright colors. I'm
not sure this is actually a bug in Emacs; it may just mean that
Thierry's workaround needs to be updated to account for the
ansi-color.el changes I made.
I'm a little unclear about what actually broke though, and haven't had a
chance to dig deeper. Some basic testing of `ansi-color-apply' shows
that it does what I expect. From "emacs -Q":
(require 'ansi-color)
(ansi-color-apply "\033[44mfoo\033[0m")
-> #("foo" 0 3 (font-lock-face (:background "blue2")))
(ansi-color-apply "\033[44;33mfoo\033[0m")
-> #("foo" 0 3 (font-lock-face ((:foreground "yellow3")
(:background "blue2"))))
That's the same behavior as Emacs 27.2 with some trivial differences
(Emacs 27.2 uses `foreground-color' instead of `:foreground').
This bug report was last modified 3 years and 45 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.