emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/embark 56e28c23d5: Add user option to confirm embark-ac


From: ELPA Syncer
Subject: [elpa] externals/embark 56e28c23d5: Add user option to confirm embark-act-all (fix #457)
Date: Tue, 8 Feb 2022 15:57:37 -0500 (EST)

branch: externals/embark
commit 56e28c23d56da3ae4b755bfa50a181bdedf439e6
Author: Omar Antolín Camarena <omar.antolin@gmail.com>
Commit: Omar Antolín Camarena <omar.antolin@gmail.com>

    Add user option to confirm embark-act-all (fix #457)
---
 README.org  |  5 ++++-
 embark.el   | 12 ++++++++++--
 embark.texi |  5 ++++-
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 8b075bd6a4..8e99804778 100644
--- a/README.org
+++ b/README.org
@@ -150,7 +150,10 @@ sets:
 
 - The =embark-act-all= command runs the same action on each of the
   current candidates. It is just like using =embark-act= on each
-  candidate in turn.
+  candidate in turn. (Because you can easily act on many more
+  candidates than you meant to, by default Embark asks you to confirm
+  uses of =embark-act-all=; you can turn this off by setting the user
+  option =embark-confirm-act-all= to =nil=.)
 
 - The =embark-collect-snapshot= command produces a buffer listing all
   the current candidates, for you to peruse and run actions on at your
diff --git a/embark.el b/embark.el
index 30f20eae37..84656650e1 100644
--- a/embark.el
+++ b/embark.el
@@ -359,6 +359,13 @@ prescribe a default for commands not used as alist keys."
                  (alist :key-type (choice function (const t))
                         :value-type boolean)))
 
+(defcustom embark-confirm-act-all t
+  "Should `embark-act-all' prompt the user for confirmation?
+Even if this variable is nil you may still be prompted to confirm
+some uses of `embark-act-all', namely, for those actions whose
+entry in `embark-pre-action-hooks' includes `embark--confirm'."
+  :type 'boolean)
+
 (defcustom embark-default-action-overrides nil
   "Alist associating target types with overriding default actions.
 When the source of a target is minibuffer completion, the default
@@ -2155,8 +2162,9 @@ ARG is the prefix argument."
           (when (and (eq action (embark--default-action type))
                      (eq action embark--command))
             (setq candidates (mapcar #'embark--orig-target candidates)))
-          (when (or (not (memq 'embark--confirm
-                               (alist-get action embark-pre-action-hooks)))
+          (when (or (not (or embark-confirm-act-all
+                             (memq 'embark--confirm
+                                   (alist-get action 
embark-pre-action-hooks))))
                     (y-or-n-p (format "Run %s on %d %ss? "
                                       action (length candidates) type)))
             (if (memq action embark-multitarget-actions)
diff --git a/embark.texi b/embark.texi
index bea884d707..dcc0b52d4c 100644
--- a/embark.texi
+++ b/embark.texi
@@ -242,7 +242,10 @@ sets:
 @item
 The @samp{embark-act-all} command runs the same action on each of the
 current candidates. It is just like using @samp{embark-act} on each
-candidate in turn.
+candidate in turn. (Because you can easily act on many more
+candidates than you meant to, by default Embark asks you to confirm
+uses of @samp{embark-act-all}; you can turn this off by setting the user
+option @samp{embark-confirm-act-all} to @samp{nil}.)
 
 @item
 The @samp{embark-collect-snapshot} command produces a buffer listing all



reply via email to

[Prev in Thread] Current Thread [Next in Thread]