branch: externals/embark
commit 2a89517044693381a1eeb058e3e7a41fc5ab5900
Author: Omar Antolín <omar.anto...@gmail.com>
Commit: Omar Antolín <omar.anto...@gmail.com>

    Set default-directory for non-interactive actions (fix #616)
---
 embark.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/embark.el b/embark.el
index 2f08fd7863..7eaf736b5c 100644
--- a/embark.el
+++ b/embark.el
@@ -1958,6 +1958,7 @@ minibuffer before executing the action."
                       (when dedicate (set-window-dedicated-p dedicate nil)))
                     (unless (eq final-window action-window)
                       (select-window final-window))))
+              ;; TODO uniformize the command and non-interactive cases?
               (let ((argument
                      (if multi
                          (or (plist-get target :candidates) ; embark-act-all
@@ -1968,7 +1969,8 @@ minibuffer before executing the action."
                     (embark--run-action-hooks embark-pre-action-hooks
                                               action target quit)
                     (unwind-protect
-                        (let ((current-prefix-arg prefix))
+                        (let ((current-prefix-arg prefix)
+                              (default-directory directory))
                           (funcall action argument))
                       (embark--run-action-hooks embark-post-action-hooks
                                                 action target quit))))))))

Reply via email to