Skip to content

Commit

Permalink
Add rg-finish-functions (#142)
Browse files Browse the repository at this point in the history
This would allow the same functionality as
compilation-finish-functions, i.e. add hooks called when the ripgrep
process finishes.

Could for instance be used to select the *rg* buffer after a search:
(add-to-list 'rg-finish-functions (lambda (buffer _) (pop-to-buffer buffer)))
  • Loading branch information
dajva committed Mar 18, 2023
1 parent f09de8b commit 766e299
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rg-result.el
Expand Up @@ -299,6 +299,12 @@ Becomes buffer local in `rg-mode' buffers.")
(defvar rg-ellipsis (if (char-displayable-p ?…) "[…]" "[...]")
"Used when hiding command line.")

(defvar rg-finish-functions '()
"Functions to call when a ripgrep process finishes.
Each function is called with two arguments: the compilation buffer,
and a string describing how the process finished.")


;; Defuns

Expand Down

0 comments on commit 766e299

Please sign in to comment.