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, 27 Aug 2021 09:06:38 +0300 Organization: LINKOV.NET Message-ID: <87lf4nbj1l.fsf@mail.linkov.net> References: <9c24f4b0-e7aa-62d3-5737-0edffb8b2501@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="2278"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Manuel Uberti , 50207@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 27 08:24:47 2021 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 1mJVIE-0000SK-So for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Aug 2021 08:24:46 +0200 Original-Received: from localhost ([::1]:50572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJVID-0007i0-OA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Aug 2021 02:24:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJVHW-0006kr-Vu for bug-gnu-emacs@gnu.org; Fri, 27 Aug 2021 02:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJVHW-0001YM-NJ for bug-gnu-emacs@gnu.org; Fri, 27 Aug 2021 02:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJVHW-00043e-Jy for bug-gnu-emacs@gnu.org; Fri, 27 Aug 2021 02:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Aug 2021 06:24: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.163004542515548 (code B ref 50207); Fri, 27 Aug 2021 06:24:02 +0000 Original-Received: (at 50207) by debbugs.gnu.org; 27 Aug 2021 06:23:45 +0000 Original-Received: from localhost ([127.0.0.1]:51087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJVHE-00042h-MG for submit@debbugs.gnu.org; Fri, 27 Aug 2021 02:23:44 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:58107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJVHA-000426-US for 50207@debbugs.gnu.org; Fri, 27 Aug 2021 02:23:41 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 490B21BF203; Fri, 27 Aug 2021 06:23:32 +0000 (UTC) In-Reply-To: <9c24f4b0-e7aa-62d3-5737-0edffb8b2501@gmail.com> (Jim Porter's message of "Thu, 26 Aug 2021 10:07:52 -0700") 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" Xref: news.gmane.io gmane.emacs.bugs:212796 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?