GNU bug report logs - #18209
Add ability to truncate long grep matches

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Wed, 6 Aug 2014 11:54:02 UTC

Severity: wishlist

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 18209 <at> debbugs.gnu.org
Subject: bug#18209: Add ability to truncate long grep matches
Date: Wed, 12 Aug 2020 11:39:13 -0700
Reuben Thomas <rrt <at> sc3d.org> writes:

> On 6 August 2014 18:44, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
>
>  >>>>> "Reuben" == Reuben Thomas <rrt <at> sc3d.org> 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




This bug report was last modified 4 years and 342 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.