From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Reuben Thomas via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#18209: Add ability to truncate long grep matches Date: Wed, 12 Aug 2020 19:43:29 +0100 Message-ID: References: Reply-To: Reuben Thomas Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000009a86305acb29137" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28013"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , 18209@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 12 20:44:09 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 1k5vjN-00077b-GJ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Aug 2020 20:44:09 +0200 Original-Received: from localhost ([::1]:47626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5vjM-0006wM-D3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Aug 2020 14:44:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5vjG-0006wE-9I for bug-gnu-emacs@gnu.org; Wed, 12 Aug 2020 14:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33993) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5vjF-0003hB-Vm for bug-gnu-emacs@gnu.org; Wed, 12 Aug 2020 14:44:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k5vjF-0007i3-U1 for bug-gnu-emacs@gnu.org; Wed, 12 Aug 2020 14:44:01 -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, 12 Aug 2020 18:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18209 X-GNU-PR-Package: emacs Original-Received: via spool by 18209-submit@debbugs.gnu.org id=B18209.159725782929602 (code B ref 18209); Wed, 12 Aug 2020 18:44:01 +0000 Original-Received: (at 18209) by debbugs.gnu.org; 12 Aug 2020 18:43:49 +0000 Original-Received: from localhost ([127.0.0.1]:45539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5vj3-0007hO-IS for submit@debbugs.gnu.org; Wed, 12 Aug 2020 14:43:49 -0400 Original-Received: from mail-ot1-f54.google.com ([209.85.210.54]:37039) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5vj0-0007h6-Nf for 18209@debbugs.gnu.org; Wed, 12 Aug 2020 14:43:48 -0400 Original-Received: by mail-ot1-f54.google.com with SMTP id e11so2789084otk.4 for <18209@debbugs.gnu.org>; Wed, 12 Aug 2020 11:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kNkiMe4sJAWv86+sgkE8vmcw2pOoXhNrZCqnX2fFthI=; b=DGSQg5uDWp/rLzNOZbMMC5ML124ZpWzz37HFAhpvTrDcI6mt63JUTvigJ9AOwlhb6o CBaJ8EORVxfVI727HCtr8Tr0wfF7R+gHSalOEbVFKNavVTG+Qs+ZYmxi98wXTgq6tR8y Gf3hXOsnwPe8xctxqbi4mk6NudJTfeJmqdgBA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kNkiMe4sJAWv86+sgkE8vmcw2pOoXhNrZCqnX2fFthI=; b=WNZyIrBg1AGMM+chNAei6+JUVTT+z0NHp4JmCSUmy0Q9wfyE48UP4IO4RwmcvNfhlD Uqa9hopXtqk20GvJIvhQ8umeraLhY4CuqBeColgdHtML32VhOQJPDqiauIY0mrWMTHW1 YczTYo1v8dGMajgzSoKW+9F4Ak5h37KhpQ4GXBwHblwtYIQRGo+qbjv7PEH2QyYXm0Ju ThdZK83BQi3VihEUd6StOTYNmfZ4A6roL0tB11W9QzoQPQYSbKWteWVT7QlaV6SDvZvc HxIUb53z0KOi7JCg0fSj2uCg+yhqx/4bFXSiXla7ACbP21lgQydRmkQseKvnv27zptIH ivUw== X-Gm-Message-State: AOAM531K6Mh6DLOBvYgzveeR1vLJ0VXZY39I439u7bQIb3RPkb/Oi73W Y9kjFQybzyfAgYjcMFWRI9EPNhr88s3PnVn3PmgRBQ== X-Google-Smtp-Source: ABdhPJznr108bwN8fqjxVZeIHcUyeh/jMgT0cXNWuXZON773Xq6ZkgpdVjxLngw/IwIjXJnVPMY5mbocq4k5WO6vGIE= X-Received: by 2002:a9d:6c54:: with SMTP id g20mr998907otq.120.1597257821036; Wed, 12 Aug 2020 11:43:41 -0700 (PDT) In-Reply-To: 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:184860 Archived-At: --00000000000009a86305acb29137 Content-Type: text/plain; charset="UTF-8" That worked, thanks! -- https://rrt.sc3d.org On Wed, 12 Aug 2020, 19:39 Stefan Kangas, wrote: > Reuben Thomas writes: > > > On 6 August 2014 18:44, Stefan Monnier wrote: > > > > >>>>> "Reuben" == Reuben Thomas writes: > > > > > 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! > > > > FWIW, I have the following in my ~/.emacs: > > > > (defun sm-compilation-mode-hook () > > (setq truncate-lines t)) > > (add-hook 'compilation-mode-hook #'sm-compilation-mode-hook) > > > > That's ingenious, obvious, and thanks very muchious. > > Did that resolve the problem, or is there anything more to do here? > > Best regards, > Stefan Kangas > --00000000000009a86305acb29137 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That worked, thanks!


On Wed, 12 Aug 2020, 19:39 Stefan Kangas, <stefan@marxist.se> wrote:
Reuben Thomas <rrt@sc3d.org> writes:

> On 6 August 2014 18:44, Stefan Monnier <monnier@iro.umontreal= .ca> wrote:
>
>=C2=A0 >>>>> "Reuben" =3D=3D Reuben Thomas <= ;rrt@s= c3d.org> writes:
>
>=C2=A0 > In some files (e.g. in text files using newline as a paragr= aph delimiter)
>=C2=A0 > one can get matches in very long lines that can occupy seve= ral screenfuls.
>=C2=A0 > These are not always straightforward to avoid. There's = no way to tell (GNU)
>=C2=A0 > grep to truncate its output; perhaps Emacs could help here,= by being able
>=C2=A0 > to specify a maximum length of match to show? For bonus poi= nts, show part
>=C2=A0 > of the line that matches, with ellipses, rather than just t= runcating the
>=C2=A0 > line; but even without that it would be useful, provided th= at the
>=C2=A0 > truncation is clearly marked: the annoyance and slowness of= navigating
>=C2=A0 > *grep* buffers full of enormous matches which are almost al= ways not what
>=C2=A0 > one is looking for would be great!
>
>=C2=A0 FWIW, I have the following in my ~/.emacs:
>
>=C2=A0 =C2=A0 =C2=A0(defun sm-compilation-mode-hook ()
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(setq truncate-lines t))
>=C2=A0 =C2=A0 =C2=A0(add-hook 'compilation-mode-hook #'sm-compi= lation-mode-hook)
>
> That's ingenious, obvious, and thanks very muchious.

Did that resolve the problem, or is there anything more to do here?

Best regards,
Stefan Kangas
--00000000000009a86305acb29137--