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

    repunctuate-sentences works on a region in Emacs 29.1
---
 embark.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/embark.el b/embark.el
index 17820492cf..28bdbd7d0a 100644
--- a/embark.el
+++ b/embark.el
@@ -457,8 +457,6 @@ arguments and more details."
   '(;; use directory of target as default-directory
     (shell embark--cd)
     (eshell embark--cd)
-    ;; narrow to target for duration of action
-    (repunctuate-sentences embark--narrow-to-target)
     ;; mark the target preserving point and previous mark
     (kill-region embark--mark-target)
     (kill-ring-save embark--mark-target)
@@ -502,6 +500,11 @@ used for other types of action hooks, for more details see
                         (const :tag "Always" :always))
                 :value-type hook))
 
+(when (version-list-< (version-to-list emacs-version) '(29 1))
+  ;; narrow to target for duration of action
+  (setf (alist-get 'repunctuate-sentences embark-around-action-hooks)
+        '(embark--narrow-to-target)))
+
 (defcustom embark-multitarget-actions '(embark-insert embark-copy-as-kill)
   "Commands for which `embark-act-all' should pass a list of targets.
 Normally `embark-act-all' runs the same action on each candidate

Reply via email to