From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 07:53:02 2014 Received: (at submit) by debbugs.gnu.org; 6 Aug 2014 11:53:02 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,HTML_MESSAGE, T_DKIM_INVALID autolearn=disabled version=3.3.2 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 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 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 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 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 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 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 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 MIME-Version: 1.0 X-Received: by 10.112.198.34 with SMTP id iz2mr10146355lbc.96.1407325966897; Wed, 06 Aug 2014 04:52:46 -0700 (PDT) Received: by 10.152.246.10 with HTTP; Wed, 6 Aug 2014 04:52:46 -0700 (PDT) Date: Wed, 6 Aug 2014 12:52:46 +0100 Message-ID: Subject: Add ability to truncate long grep matches From: Reuben Thomas To: bug-emacs Content-Type: multipart/alternative; boundary=001a11c33d70572b7f04fff49c33 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) --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-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 13:44:47 2014 Received: (at 18209) by debbugs.gnu.org; 6 Aug 2014 17:44:47 +0000 Received: from localhost ([127.0.0.1]:60640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5GZ-0006tq-GB for submit@debbugs.gnu.org; Wed, 06 Aug 2014 13:44:47 -0400 Received: from mercure.iro.umontreal.ca ([132.204.24.67]:35857) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5GW-0006th-Ub for 18209@debbugs.gnu.org; Wed, 06 Aug 2014 13:44:45 -0400 Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 74AFD84F3C; Wed, 6 Aug 2014 13:44:44 -0400 (EDT) Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 268B51E5B74; Wed, 6 Aug 2014 13:44:20 -0400 (EDT) Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 01B30B40CD; Wed, 6 Aug 2014 13:44:19 -0400 (EDT) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#18209: Add ability to truncate long grep matches Message-ID: References: Date: Wed, 06 Aug 2014 13:44:19 -0400 In-Reply-To: (Reuben Thomas's message of "Wed, 6 Aug 2014 12:52:46 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-Spam-Status: No X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 18209 Cc: 18209@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) >>>>> "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) -- Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 13:47:57 2014 Received: (at 18209) by debbugs.gnu.org; 6 Aug 2014 17:47:57 +0000 Received: from localhost ([127.0.0.1]:60663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5Jd-000700-5L for submit@debbugs.gnu.org; Wed, 06 Aug 2014 13:47:57 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:50292) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5Ja-0006zk-Bi for 18209@debbugs.gnu.org; Wed, 06 Aug 2014 13:47:55 -0400 Received: by mail-la0-f53.google.com with SMTP id gl10so2469817lab.40 for <18209@debbugs.gnu.org>; Wed, 06 Aug 2014 10:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=eTojbZ9iPFi/xTmzrkniWPzl2hm3I/hz10XAXo/3pFw=; b=qG3TnueXcBji45NtmylcxBe3E2rN52eP5KDLOlEvGoPEGk2fNiAUU9HVZWMCoPrTRT OSBrGEYPXp6FQjuMboxvqmfTTmKmdWCvTCuKDXkD3BxqJ26xhQrhErXKFah6CRYWIe5F Sy3DImX4s9WygoWllLeIIdkJMpR/J5FcuAe18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=eTojbZ9iPFi/xTmzrkniWPzl2hm3I/hz10XAXo/3pFw=; b=TobUb38Ej7dLRWrVaXuECgx2T7Z8rFU8LpaWRD6wfYvVRPWSaCCTVr7q5adjYg0Dd8 PoDb6dqSRrSl9m+4OvKhJMYFrg/lWPmTA+Zhgf6V94/FQ8yD51MO/qPAMkIHqTT9LEXk iBfS0GHutvymj2Ay+B77ZKZaT+CoQ+orm9rgRwScycL13S7PFitAffqR+fgOa7qSkmrS pXzegq9eAIhqaJxXr4QinSEzXKazFZKgpS7gHlZDGj/NycZIIfLJ+ilKNkwHAKwZNc1p iMql5ZC2ZZ77Gw1hRJnDMoupXjDfyFVfx8pyOBSb0eCck3ThfEOAVf8GGB6gbMx7anuE WSvw== X-Gm-Message-State: ALoCoQnqAlCsTwfmpe7CYMtSJxVjCJEB8JrgDWNHtI/pgB03OehP9gl8MhmpfKX7ifPpr48IfWK3 MIME-Version: 1.0 X-Received: by 10.112.204.164 with SMTP id kz4mr12015411lbc.15.1407347268399; Wed, 06 Aug 2014 10:47:48 -0700 (PDT) Received: by 10.152.246.10 with HTTP; Wed, 6 Aug 2014 10:47:48 -0700 (PDT) In-Reply-To: References: Date: Wed, 6 Aug 2014 18:47:48 +0100 Message-ID: Subject: Re: bug#18209: Add ability to truncate long grep matches From: Reuben Thomas To: Stefan Monnier Content-Type: multipart/alternative; boundary=001a11c3bfaa024cb904fff99224 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18209 Cc: 18209@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11c3bfaa024cb904fff99224 Content-Type: text/plain; charset=UTF-8 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. -- http://rrt.sc3d.org --001a11c3bfaa024cb904fff99224 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 6= August 2014 18:44, Stefan Monnier <monnier@iro.umontreal.ca>= ; wrote:
>>>>> "Reuben" =3D= =3D Reuben Thomas <rrt@sc3d.org> = writes:

> In some files (e.g. in text files using newline as a paragraph delimit= er)
> one can get matches in very long lines that can occupy several screenf= uls.
> These are not always straightforward to avoid. There's no way to t= ell (GNU)
> grep to truncate its output; perhaps Emacs could help here, by being a= ble
> to specify a maximum length of match to show? For bonus points, show p= art
> of the line that matches, with ellipses, rather than just truncating t= he
> 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 wh= at
> one is looking for would be great!

FWIW, I have the following in my ~/.emacs:

=C2=A0 =C2=A0(defun sm-compilation-mode-hook ()
=C2=A0 =C2=A0 =C2=A0(setq truncate-lines t))
=C2=A0 =C2=A0(add-hook 'compilation-mode-hook #'sm-compilation-mode= -hook)

That's ingenious, obvious, a= nd thanks very muchious.

--
http://rrt.sc3d.org
--001a11c3bfaa024cb904fff99224-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 12 14:39:24 2020 Received: (at 18209) by debbugs.gnu.org; 12 Aug 2020 18:39:24 +0000 Received: from localhost ([127.0.0.1]:45513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5vel-0007YJ-Q4 for submit@debbugs.gnu.org; Wed, 12 Aug 2020 14:39:24 -0400 Received: from mail-yb1-f173.google.com ([209.85.219.173]:41548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5veh-0007Y0-Nq for 18209@debbugs.gnu.org; Wed, 12 Aug 2020 14:39:23 -0400 Received: by mail-yb1-f173.google.com with SMTP id s195so1896065ybc.8 for <18209@debbugs.gnu.org>; Wed, 12 Aug 2020 11:39:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=EeYnKx+ADwgQ7xVwvxEXQgmqXct/hguqYKkXnsohVYw=; b=Iq+geyMI3IGoA+WGBceno6otbWfmNQnYDNsFZssZryoN/i4aG5zvOfIJe3MtU+xP3z vFP/ezhjEqDwL99A0zI908OXHJUGYpHbMUp2q91hXZ79UAs72qmG7EPJxDXQ1jGzT/9A cwRUYDOXjZ0xHSQHZBzUKIUYBRdgcxTwef1XS06YpAyFpYLip7NPYGdLpPuov4tZgjCX RlkoymdXVyzrBmE+/Q6Wasw9/JZLbrxtTvqiyCoMYpzmOG9HqIfSekoQlWc8xfIwUaJo 2bLjb1T3gcDUK0vWeEerXaBH6QDbPakgGDTeSCNoQJ4RjE1YcsObP9gG4hwGEI8JhV+R uYMQ== X-Gm-Message-State: AOAM531FqHbQNy16n0+LmlXkOXpXm5qGYaA+/3smdDwPi5UBIMpjm8QV f9AnVmv59mvzbyFqLX1xos97SM4nnH2qfvUqfkg= X-Google-Smtp-Source: ABdhPJz8K3YmPZOo0eTsGkuHbPIVi+bgz+CqRD0Jn5f3XyGm9d1ODDBNtNcmvva9GzQBXeSHPAs+DM5JOc8UHcwzYeM= X-Received: by 2002:a25:b88b:: with SMTP id w11mr1078319ybj.129.1597257554211; Wed, 12 Aug 2020 11:39:14 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 12 Aug 2020 11:39:13 -0700 From: Stefan Kangas In-Reply-To: (Reuben Thomas's message of "Wed, 6 Aug 2014 18:47:48 +0100") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Date: Wed, 12 Aug 2020 11:39:13 -0700 Message-ID: Subject: Re: bug#18209: Add ability to truncate long grep matches To: Reuben Thomas Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18209 Cc: Stefan Monnier , 18209@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 12 14:43:49 2020 Received: (at 18209) by debbugs.gnu.org; 12 Aug 2020 18:43:49 +0000 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 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 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) MIME-Version: 1.0 References: In-Reply-To: From: Reuben Thomas Date: Wed, 12 Aug 2020 19:43:29 +0100 Message-ID: Subject: Re: bug#18209: Add ability to truncate long grep matches To: Stefan Kangas Content-Type: multipart/alternative; boundary="00000000000009a86305acb29137" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18209 Cc: Stefan Monnier , 18209@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --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-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 12 14:51:12 2020 Received: (at 18209-done) by debbugs.gnu.org; 12 Aug 2020 18:51:12 +0000 Received: from localhost ([127.0.0.1]:45570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5vq2-0007vw-7s for submit@debbugs.gnu.org; Wed, 12 Aug 2020 14:51:12 -0400 Received: from mail-yb1-f171.google.com ([209.85.219.171]:36603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5vpz-0007vV-2K for 18209-done@debbugs.gnu.org; Wed, 12 Aug 2020 14:51:00 -0400 Received: by mail-yb1-f171.google.com with SMTP id g3so1928656ybc.3 for <18209-done@debbugs.gnu.org>; Wed, 12 Aug 2020 11:50:58 -0700 (PDT) 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=onRDLiTAJU6GNdCUeShmFLXzxtUMXvH2tZ2FDJMBSg0=; b=Hf9IoYL3q6ew2NYPgwmzdyILjCughgZanlfRscxr9OhPKZGUrFKshXgDrDkZFv1xlm bb2bMU+2nnjtzjlskTwcQOkbX3iK/YdGUmQGixE0T3jE4ZWGlRdCvnKXvdzw9rpqXPG7 gZz4xFuFAy1XDjTW2JVQFDXP3OwheAvrH7w1+n9+d0iEYZYtCEjgKxqdLti6R4H3qTAo ROoNbQ8McH9gQAYvXD6Z2FiIq+QEoRTX0BFsXHovIJlHCW4qCuejgQmWEj67n/tjz6oH d6AQGD2SY44XPRnXfFHhfYIxeKRVYuF3k9zNxE2WY6TOH+h/m5b6SNAMUShl2r5VMXfe ctSg== X-Gm-Message-State: AOAM532jlOGKTxzCEHG1GRTeGfMU/YLE7t6mLov6xhRfMXe602LbPGv/ cAg8r+ZhXqTSoyCSa6/vUumloRD2gJT96CRERKU= X-Google-Smtp-Source: ABdhPJwq1y43p39R1r41ZYHcb+Pyd1J4k+skgNqt2QlzkV8y+VVFaPffp7q3Y1HWd78i7sIRnTumRcr7dDMFJd5iD/k= X-Received: by 2002:a5b:508:: with SMTP id o8mr1197336ybp.43.1597258253630; Wed, 12 Aug 2020 11:50:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Stefan Kangas Date: Wed, 12 Aug 2020 20:50:42 +0200 Message-ID: Subject: Re: bug#18209: Add ability to truncate long grep matches To: Reuben Thomas Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18209-done Cc: Stefan Monnier , 18209-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Reuben Thomas writes: > That worked, thanks! Thanks! Closing. From unknown Sun Aug 17 10:17:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 10 Sep 2020 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator