From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reuben Thomas Newsgroups: gmane.emacs.bugs Subject: bug#18209: Add ability to truncate long grep matches Date: Wed, 6 Aug 2014 12:52:46 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c33d70572b7f04fff49c33 X-Trace: ger.gmane.org 1407326058 26641 80.91.229.3 (6 Aug 2014 11:54:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2014 11:54:18 +0000 (UTC) To: 18209@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 06 13:54:12 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XEznG-00032V-Lt for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 13:54:10 +0200 Original-Received: from localhost ([::1]:38168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEznG-00032f-AC for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 07:54:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEznB-00032N-DF for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 07:54:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEzn8-0005zU-RP for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 07:54:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEzn8-0005zK-Ny for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 07:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XEzn8-0002eS-89 for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 07:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Reuben Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Aug 2014 11:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18209 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.140732598210112 (code B ref -1); Wed, 06 Aug 2014 11:54:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Aug 2014 11:53:02 +0000 Original-Received: from localhost ([127.0.0.1]:59978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEzmA-0002cq-3v for submit@debbugs.gnu.org; Wed, 06 Aug 2014 07:53:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39272) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEzm7-0002cV-Kn for submit@debbugs.gnu.org; Wed, 06 Aug 2014 07:53:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEzm1-0005mT-D4 for submit@debbugs.gnu.org; Wed, 06 Aug 2014 07:52:54 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:34341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEzm1-0005mN-9W for submit@debbugs.gnu.org; Wed, 06 Aug 2014 07:52:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEzlz-0002wU-WE for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 07:52:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEzly-0005lm-Kk for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 07:52:51 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEzly-0005li-HX for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 07:52:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36899) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1XEzly-0008M1-3Q for bug-emacs@gnu.org; Wed, 06 Aug 2014 07:52:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEzlw-0005lC-KD for bug-emacs@gnu.org; Wed, 06 Aug 2014 07:52:50 -0400 Original-Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]:51880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEzlw-0005kx-Av for bug-emacs@gnu.org; Wed, 06 Aug 2014 07:52:48 -0400 Original-Received: by mail-la0-f41.google.com with SMTP id s18so1845968lam.28 for ; Wed, 06 Aug 2014 04:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=8Sf0Mc5f+sTDN222YlU1/64Khr/f7CjC3wRDHVKgfrc=; b=REet7LJ11oIMcJZ7IPmfCweAyvNzYZbZwlnh6jV3+MbaWtwmmDh9jMIA+qWTghOTEw rXEoJjXEfo3WsFztRWQTa0Rx5soZnbDw2EJ+0gdC2rCjApVIFYbeM9tpp2uHIi1mY0Ar EzhP9OzV08WphHLyrr1VjSaQ9nweaK2v+oLNk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=8Sf0Mc5f+sTDN222YlU1/64Khr/f7CjC3wRDHVKgfrc=; b=lJV2/0dTBuvbP+v8bFR8gtLcIjq4K6dpISWjZ+JYWXYw3ikSutEo94RSyvenrzzoml LbCAnaKJ1+DVg3jEZ7moSQjWd0PS4SeN/MKuOZypjn9zsVrLyCaVJXiXO/TJ0kGaYPlm vRcKMIg4qfuKjw94kcqBd9T5sn3wg95trdK/5ZemKSVv7iW6a7pDX4ItOB3G7OYaDg8n CPj2ugx4jWQ44FaYDpk43C3HUjvoWBl8qFNg3VzzwjRppMSkFMT2qqTcQ62etWTSxCQu hl42sw7pLyITq2p6ZOc6lJh1HUDksYpfXE7P+8bqyWQlyMAV3G4J8HmF6LwLOa8URavi 65Aw== X-Gm-Message-State: ALoCoQkPPg+i/iRaywcHUBpuzyJ/EsOSEYoorM8ixQ6a/8uA2f5FgpF9HDf+LodxD/HFgSpQoS+o X-Received: by 10.112.198.34 with SMTP id iz2mr10146355lbc.96.1407325966897; Wed, 06 Aug 2014 04:52:46 -0700 (PDT) Original-Received: by 10.152.246.10 with HTTP; Wed, 6 Aug 2014 04:52:46 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92172 Archived-At: --001a11c33d70572b7f04fff49c33 Content-Type: text/plain; charset=UTF-8 In some files (e.g. in text files using newline as a paragraph delimiter) one can get matches in very long lines that can occupy several screenfuls. These are not always straightforward to avoid. There's no way to tell (GNU) grep to truncate its output; perhaps Emacs could help here, by being able to specify a maximum length of match to show? For bonus points, show part of the line that matches, with ellipses, rather than just truncating the line; but even without that it would be useful, provided that the truncation is clearly marked: the annoyance and slowness of navigating *grep* buffers full of enormous matches which are almost always not what one is looking for would be great! (I just managed to work around one source, minified Javascript mixed in with non-minified files, by omitting *.min.js in the list of files grep should ignore, but this is not always easy either: sometimes one might only have the minified form to hand, and might want to grep it e.g. while debugging.) -- http://rrt.sc3d.org --001a11c33d70572b7f04fff49c33 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In some files (e.g. in text files using newline as a = paragraph delimiter) one can get matches in very long lines that can occupy= several screenfuls. These are not always straightforward to avoid. There&#= 39;s no way to tell (GNU) grep to truncate its output; perhaps Emacs could = help here, by being able to specify a maximum length of match to show? For = bonus points, show part of the line that matches, with ellipses, rather tha= n just truncating the line; but even without that it would be useful, provi= ded that the truncation is clearly marked: the annoyance and slowness of na= vigating *grep* buffers full of enormous matches which are almost always no= t what one is looking for would be great!

(I just managed to work around one source, minified Javascript mi= xed in with non-minified files, by omitting *.min.js in the list of files g= rep should ignore, but this is not always easy either: sometimes one might = only have the minified form to hand, and might want to grep it e.g. while d= ebugging.)
--001a11c33d70572b7f04fff49c33--