GNU bug report logs - #49609
[PATCH] Add option for handling SGR control sequences in compilation-mode

Previous Next

Package: emacs;

Reported by: Ivan Sokolov <ivan-p-sokolov <at> ya.ru>

Date: Sat, 17 Jul 2021 19:38:01 UTC

Severity: normal

Tags: patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 49609 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: 49609 <at> debbugs.gnu.org
Subject: Re: [PATCH] Add option for handling SGR control sequences in
 compilation-mode
Date: Sat, 17 Jul 2021 13:57:41 -0700
One issue I've seen with handling SGR control sequences in
compilation-mode is that it can sometimes cause issues with grep-mode
and other similar modes in third-party packages. `grep-filter' also
handles SGR control sequences, but only works with full lines; this is
a simplification to (mostly) ensure that both the start and end of a
"match" highlight are present at the same time, so that `grep-filter'
can just use a simple regexp.

However, as far as I understand it, `ansi-color-apply-on-region' has
no such limitation and can handle parsing the *start* of some
highlighted text in one call to the function, and then handle the end
of it in another call. If, when grep is printing results, the output
is flushed in the middle of a match highlight, this results in the SGR
sequence to start a highlight being stripped by the time `grep-filter'
runs, so it's not able to fontify the match.

It might be nice if `grep-filter' were smart enough to work with the
output as-is rather than only operating on whole lines. That would
probably be more robust. However, for this patch, maybe it would be
enough to locally set `ansi-color-for-compilation-mode' to nil for
grep-mode.




This bug report was last modified 3 years and 304 days ago.

Previous Next


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