branch: externals/embark
commit 035d8c0a3d0c45819646a122b242245021425943
Author: Omar Antolín <[email protected]>
Commit: Omar Antolín <[email protected]>

    Add waiting for consult-find upon reverting
---
 embark-consult.el | 8 ++++++++
 embark.el         | 4 +++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/embark-consult.el b/embark-consult.el
index 8c2e6750ac..c5d46154af 100644
--- a/embark-consult.el
+++ b/embark-consult.el
@@ -213,6 +213,14 @@ This function is meant to be added to 
`embark-collect-mode-hook'."
 (setf (alist-get 'consult-grep embark-exporters-alist)
       #'embark-consult-export-grep)
 
+;;; Support for reverting export from consult-find
+
+(defun embark-consult--wait-for-find ()
+  (when (eq embark--command 'consult-find)
+    (add-hook 'embark--export-pre-revert-hook #'embark-consult--await nil t)))
+
+(add-hook 'embark-after-export-hook #'embark-consult--wait-for-find)
+
 ;;; Support for consult-isearch
 
 (setf (alist-get 'consult-isearch embark-transformer-alist)
diff --git a/embark.el b/embark.el
index c7073b2504..cd942b98c9 100644
--- a/embark.el
+++ b/embark.el
@@ -2992,6 +2992,7 @@ otherwise display it in each of the WINDOWS."
       (if (eq exporter 'embark-collect)
           (embark-collect)
         (let ((after embark-after-export-hook)
+              (cmd embark--command)
               (name (embark--descriptive-buffer-name 'export))
               (revert (embark--export-revert-function)))
           (embark--quit-and-run
@@ -3005,7 +3006,8 @@ otherwise display it in each of the WINDOWS."
                  (dolist (window windows)
                    (set-window-buffer window (current-buffer)))
                (pop-to-buffer (current-buffer)))
-             (let ((embark-after-export-hook after))
+             (let ((embark-after-export-hook after)
+                   (embark--command cmd))
                (run-hooks 'embark-after-export-hook)))))))))
 
 (defmacro embark--export-rename (buffer title &rest body)

Reply via email to