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

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

[nongnu] elpa/multiple-cursors 466d036 063/434: Prompt for inclusion in


From: ELPA Syncer
Subject: [nongnu] elpa/multiple-cursors 466d036 063/434: Prompt for inclusion in white/black-lists when met with an unknown command
Date: Sat, 7 Aug 2021 09:19:55 -0400 (EDT)

branch: elpa/multiple-cursors
commit 466d03607d9e91b904c897809ac1ec3693ea25ce
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>

    Prompt for inclusion in white/black-lists when met with an unknown command
---
 multiple-cursors-core.el | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index e5b6ffc..a11e60e 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -121,6 +121,12 @@ cursor with updated info."
      (save-excursion ,@forms)
      (mc/pop-state-from-overlay current-state)))
 
+(defun mc/prompt-for-inclusion-in-whitelist (original-command)
+  (if (y-or-n-p (format "Do %S for all cursors?" original-command))
+      (add-to-list 'mc--cmds original-command)
+    (add-to-list 'mc--cmds-run-once original-command)
+    nil))
+
 (defun mc/execute-this-command-for-all-cursors ()
   "Used with post-command-hook to execute supported commands for
 all cursors. It also checks a list of explicitly unsupported
@@ -143,9 +149,10 @@ cursors."
           (message "%S is not supported with multiple cursors%s"
                    original-command
                    (get original-command 'mc--unsupported))
-        (if (not (memq original-command mc--cmds))
-            (when (and original-command (not (memq original-command 
mc--cmds-run-once)))
-              (message "Skipping %S" original-command))
+        (when (and original-command
+                   (not (memq original-command mc--cmds-run-once))
+                   (or (memq original-command mc--cmds)
+                       (mc/prompt-for-inclusion-in-whitelist 
original-command)))
           (mc/execute-command-for-all-fake-cursors original-command))))))
 
 (defun mc/remove-fake-cursors ()
@@ -230,7 +237,10 @@ from being executed if in multiple-cursors-mode."
                           undo-tree-redo
                           universal-argument
                           universal-argument-other-key
-                          mc/switch-from-mark-multiple-to-cursors))
+                          mc/switch-from-mark-multiple-to-cursors
+                          mc/edit-lines
+                          mc/edit-ends-of-lines
+                          mc/edit-beginnings-of-lines))
 
 ;; Commands that should be mirrored by all cursors
 (setq mc--cmds '(mc/keyboard-quit



reply via email to

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