From 97000714a1a5af4a4d9928af49133b01470af38b Mon Sep 17 00:00:00 2001 From: Trust me I am a doctor Date: Mon, 8 Mar 2021 22:11:32 +0000 Subject: [PATCH] Add a hook after vr/replace vr/query-replace --- visual-regexp.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/visual-regexp.el b/visual-regexp.el index 89d8d44..5484a94 100644 --- a/visual-regexp.el +++ b/visual-regexp.el @@ -221,6 +221,9 @@ If nil, don't limit the number of matches shown in visual feedback." (defvar vr/initialize-hook nil "Hook called before vr/replace and vr/query-replace") +(defvar vr/end-hook nil + "Hook called after vr/replace and vr/query-replace") + ;;; private variables (defconst vr--match-faces '(vr/match-0 vr/match-1) @@ -773,7 +776,8 @@ visible all the time in the minibuffer." (unless (overlayp vr--minibuffer-message-overlay) (delete-overlay vr--minibuffer-message-overlay)) (vr--delete-overlay-displays) - (vr--delete-overlays)))) + (vr--delete-overlays) + (run-hooks 'vr/end-hook)))) (add-hook 'multiple-cursors-mode-enabled-hook ;; run vr/mc-mark once per cursor by default (do not ask the user)