GNU bug report logs - #76077
Add grep-hook in harmony with occur-hook

Previous Next

Package: emacs;

Reported by: Ship Mints <shipmints <at> gmail.com>

Date: Wed, 5 Feb 2025 19:08:02 UTC

Severity: normal

Merged with 76078

Full log


Message #13 received at 76077 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 76077 <at> debbugs.gnu.org
Subject: Re: bug#76077: Add grep-hook in harmony with occur-hook
Date: Thu, 6 Feb 2025 06:32:42 -0500
[Message part 1 (text/plain, inline)]
Great. I've adapted this to my purpose. Thank you.

I suppose this is now memorialized on the mailing list should anyone want
to search it up.

-Stephane

On Thu, Feb 6, 2025 at 2:40 AM Juri Linkov <juri <at> linkov.net> wrote:

> > grep is missing a hook similar to occur-hook. It is very useful to know
> > when results are returned and also to perform operations on the resulting
> > buffer.
>
> Does this work for you?
>
> #+begin_src emacs-lisp
> (add-hook 'compilation-finish-functions
>           (lambda (cur-buffer msg)
>             (when (and (string-match-p "finished" msg)
>                        (eq (with-current-buffer cur-buffer major-mode)
>                            'grep-mode)) ;; i.e. not compilation-mode
>               (message "Grep finished in %s" cur-buffer))))
> #+end_src
>
[Message part 2 (text/html, inline)]

This bug report was last modified 193 days ago.

Previous Next


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