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

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

[nongnu] elpa/multiple-cursors ae0033f 140/434: Protect post-command-hoo


From: ELPA Syncer
Subject: [nongnu] elpa/multiple-cursors ae0033f 140/434: Protect post-command-hook from errors to avoids undead cursors
Date: Sat, 7 Aug 2021 09:20:12 -0400 (EDT)

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

    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



reply via email to

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