From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#50207: 28.0.50; ansi-color-compilation-filter and rgrep Date: Fri, 09 Dec 2022 09:20:35 +0200 Organization: LINKOV.NET Message-ID: <868rjhm57w.fsf@mail.linkov.net> References: <9c24f4b0-e7aa-62d3-5737-0edffb8b2501@gmail.com> <87lf4nbj1l.fsf@mail.linkov.net> <875yeled97.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30415"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: Jim Porter , Manuel Uberti , 50207@debbugs.gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 09 08:44:23 2022 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 1p3Y3S-0007nK-WE for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 08:44:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3Y3A-0002SU-Qd; Fri, 09 Dec 2022 02:44:04 -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 1p3Y39-0002QB-29 for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 02:44:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3Y38-0004pj-Mo for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 02:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3Y38-0004AY-HZ for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 02:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2022 07:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50207 X-GNU-PR-Package: emacs Original-Received: via spool by 50207-submit@debbugs.gnu.org id=B50207.167057181415947 (code B ref 50207); Fri, 09 Dec 2022 07:44:02 +0000 Original-Received: (at 50207) by debbugs.gnu.org; 9 Dec 2022 07:43:34 +0000 Original-Received: from localhost ([127.0.0.1]:34349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3Y2g-000499-1m for submit@debbugs.gnu.org; Fri, 09 Dec 2022 02:43:34 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:44369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3Y2d-00048z-TB for 50207@debbugs.gnu.org; Fri, 09 Dec 2022 02:43:32 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 93FEB60003; Fri, 9 Dec 2022 07:43:22 +0000 (UTC) In-Reply-To: <875yeled97.fsf@gmail.com> (Augusto Stoffel's message of "Thu, 08 Dec 2022 23:34:12 +0100") 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:250361 Archived-At: >>>> - (add-hook 'compilation-filter-hook #'ansi-color-compilation-filter) >>> >>> I encountered this a bit ago, and did a bit of diagnosis, but it ended up >>> on my back-burner. I think the issue is due to how the >>> compilation-filter-hooks for grep and ansi-color interact. `grep-filter' is >>> fairly simple and wants to see both the start and end of an ANSI-colorized >>> region, so it "rewinds" to the beginning of a line every time it's >>> called. `ansi-color-compilation-filter', on the other hand, is smart enough >>> to handle the case where it only sees the start of a colorized region in >>> one call, and the end in the next call (see `ansi-color-context' for >>> details). >> >> Would it be possible to solve the problem by adding a new buffer-local >> variable (disabled by default) that will enable line mode for >> `ansi-color-compilation-filter' so that it will handle only complete lines >> like grep mode does? > > To complement this a bit, my hunch is that the problem is due to > `compilation-filter-start' being a number and not a marker (bug?). When > `grep-filter' deletes some characters between `compilation-filter-start' > and the beginning of its line, it causes `ansi-color-compilation-filter' > to skip treating a portion of the buffer. Have you tried to replace a number with a marker? Does it help to fix this bug?