From ae0033fe3d216906b96b8780e3845879d077afd6 Mon Sep 17 00:00:00 2001 From: Magnar Sveen Date: Thu, 27 Sep 2012 18:53:57 +0200 Subject: [PATCH] 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