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#44983: Truncate long lines of grep output Date: Tue, 01 Dec 2020 22:34:37 +0200 Organization: LINKOV.NET Message-ID: <87lfeh6zw8.fsf@mail.linkov.net> References: <87v9dlc3ti.fsf_-_@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13617"; 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: 44983@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 01 21:39:24 2020 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 1kkCQl-0003Qj-SD for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Dec 2020 21:39:23 +0100 Original-Received: from localhost ([::1]:39416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkCQk-0001Oy-V3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Dec 2020 15:39:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkCPS-0008KR-V2 for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 15:38:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50030) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkCPS-0005Iy-Fj for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 15:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kkCPS-0003TL-CV for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 15:38: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: Tue, 01 Dec 2020 20:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44983 X-GNU-PR-Package: emacs Original-Received: via spool by 44983-submit@debbugs.gnu.org id=B44983.160685504813293 (code B ref 44983); Tue, 01 Dec 2020 20:38:02 +0000 Original-Received: (at 44983) by debbugs.gnu.org; 1 Dec 2020 20:37:28 +0000 Original-Received: from localhost ([127.0.0.1]:33340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkCOu-0003SL-1z for submit@debbugs.gnu.org; Tue, 01 Dec 2020 15:37:28 -0500 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:51169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkCOt-0003S7-41 for 44983@debbugs.gnu.org; Tue, 01 Dec 2020 15:37:27 -0500 Original-Received: from mail.gandi.net (m91-129-99-98.cust.tele2.ee [91.129.99.98]) (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id D5F44240003; Tue, 1 Dec 2020 20:37:19 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Tue, 1 Dec 2020 17:02:09 +0200") 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:194761 Archived-At: >>> Is the same problem exhibited by commands using the Xref UI? I don't >>> remember seeing it, but of course our projects can be very different. >> No difference from grep, Xref output has the same problem. > > Perhaps (setq truncate-lines t) could help in that case? I customized truncate-lines to t long ago, and still this doesn't help to improve performance on long lines in grep output. > Then the lines would be cut at the window width, as you suggest below. > >> This will avoid the need of using such workarounds as in bug#44941: >> grep -a "$@" | cut -c -200 > > That might cut filenames unnecessary. Even when those a long, we need them > in their entirety. > > The Grep results parsing code could be changed to only take the first XY > characters of each line, though. The proposed patch doesn't cut filenames, it hides only endings of long lines. But still performance is not much better on very long lines.