branch: elpa/multiple-cursors
commit ae0033fe3d216906b96b8780e3845879d077afd6
Author: Magnar Sveen <[email protected]>
Commit: Magnar Sveen <[email protected]>
Protect post-command-hook from errors to avoids undead cursors
---
multiple-cursors-core.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index c24a9f5..59a145f 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -266,6 +266,14 @@ not be recognized through the command-remapping lookup."
this-original-command))))
(defun mc/execute-this-command-for-all-cursors ()
+ "Wrap around `mc/execute-this-command-for-all-cursors-1' to protect hook."
+ (condition-case error
+ (mc/execute-this-command-for-all-cursors-1)
+ (error
+ (message "[mc] problem in `mc/execute-this-command-for-all-cursors': %s"
+ (error-message-string error)))))
+
+(defun mc/execute-this-command-for-all-cursors-1 ()
"Used with post-command-hook to execute supported commands for all cursors.
It uses two lists of commands to know what to do: the run-once