branch: elpa/multiple-cursors
commit 2ccfc74bf4c00b15c44972843486d35403aab474
Merge: be149f9 d26cecd
Author: Jules Tamangan <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #252 from bb2020/master
Add defcustom boolean `mc/always-run-for-all`. When non-nil every command
will be run for every cursor
---
multiple-cursors-core.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index aa5b2c2..650ce3c 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -310,6 +310,11 @@ cursor with updated info."
(mc/pop-state-from-overlay mc--stored-state-for-undo)
(setq mc--stored-state-for-undo nil)))
+(defcustom mc/always-run-for-all nil
+ "Disables whitelisting and always executes commands for every fake cursor."
+ :type '(boolean)
+ :group 'multiple-cursors)
+
(defun mc/prompt-for-inclusion-in-whitelist (original-command)
"Asks the user, then adds the command either to the once-list or the
all-list."
(let ((all-p (y-or-n-p (format "Do %S for all cursors?" original-command))))
@@ -399,7 +404,8 @@ the original cursor, to inform about the lack of support."
(when (and original-command
(not (memq original-command
mc--default-cmds-to-run-once))
(not (memq original-command mc/cmds-to-run-once))
- (or (memq original-command
mc--default-cmds-to-run-for-all)
+ (or mc/always-run-for-all
+ (memq original-command
mc--default-cmds-to-run-for-all)
(memq original-command mc/cmds-to-run-for-all)
(mc/prompt-for-inclusion-in-whitelist
original-command)))
(mc/execute-command-for-all-fake-cursors
original-command))))))))))