From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#46859: 28.0.50; [PATCH]: Add option to truncate long lines in xref.el Date: Wed, 03 Mar 2021 09:52:38 +0000 Message-ID: <4119ea3055ef8f306fc0@heytings.org> References: <87im69uzlt.fsf@mail.linkov.net> <878s74fv27.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40474"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46859@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 03 10:53:09 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 1lHOBp-000ARm-Fk for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Mar 2021 10:53:09 +0100 Original-Received: from localhost ([::1]:33388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHOBo-0005b9-EB for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Mar 2021 04:53:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHOBi-0005ay-Ks for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2021 04:53:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHOBi-0002XV-Dk for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2021 04:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lHOBi-0000eM-Ci for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2021 04:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Mar 2021 09:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46859 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46859-submit@debbugs.gnu.org id=B46859.16147651632457 (code B ref 46859); Wed, 03 Mar 2021 09:53:02 +0000 Original-Received: (at 46859) by debbugs.gnu.org; 3 Mar 2021 09:52:43 +0000 Original-Received: from localhost ([127.0.0.1]:55206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHOBP-0000dZ-0P for submit@debbugs.gnu.org; Wed, 03 Mar 2021 04:52:43 -0500 Original-Received: from heytings.org ([95.142.160.155]:41174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHOBM-0000dO-U7 for 46859@debbugs.gnu.org; Wed, 03 Mar 2021 04:52:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1614765159; bh=YYgOc0gHcS0ato+zRr/MXUaAGmAK2Gs5QaJ/hv/DBLY=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=wMAZkhtJ+IWqGCCoBEoeCMeaKY7VWMWAv/HgtYjpxzLIJa4+2lvlgaOXtqYWj3gLe AGTh0ircyWHb3CjR7o23HI08WB26G+7TUyrOxCNxJoQGhIcUzFnMlu6OEwNmistbUI Cqmotgj2wDxMwXutkxpPDFQnx+vp3IAj8FQ9s0Fw60/30QU4L3ZzHcraz6/lcGT5Ut bbqchkXYVdvpruK/+pVpAiqgj+Fwm3sDtvgasSVucP7lRlIfGcjP8eN4H1/nnX5Vhp mzCdHKLcn7LHOjNYC/DH1EnZc34NDCKBeoBtx8o15Y+8pM1PIjm/65aWf7FW8xtE+p FK3q7KEdC/0Jw== In-Reply-To: <878s74fv27.fsf@mail.linkov.net> 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:201269 Archived-At: >>> But maybe your new option would be easier to customize. >> >> Yeah, maybe. However, without benchmarking, it is quite clear that >> adding your option is faster than my patch, since ripgrep has to search >> the whole minified file. I assume it short circuits, so that results >> are delivered quicker to emacs. Maybe this bug can be closed. > > Your new option is still necessary for the default case when > 'xref-search-program' is 'grep' since GNU grep has no option to truncate > output, so xref should do post-processing for grep. > Actually, it is possible to truncate output with GNU grep: grep -oE '.{0,100}PATTERN.{0,100}' prints at most 100 characters before and after PATTERN. I find this much better than ripgrep -M.