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

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

[nongnu] elpa/multiple-cursors 3ce6e4a 199/434: Avoid strange behavior w


From: ELPA Syncer
Subject: [nongnu] elpa/multiple-cursors 3ce6e4a 199/434: Avoid strange behavior with smartrep
Date: Sat, 7 Aug 2021 09:20:25 -0400 (EDT)

branch: elpa/multiple-cursors
commit 3ce6e4a67031c2d52c0e422beeca3cac906e4044
Author: Takafumi Arakaki <aka.tkf@gmail.com>
Commit: Takafumi Arakaki <aka.tkf@gmail.com>

    Avoid strange behavior with smartrep
    
    smartrep `intern`s commands into own obarray to help
    `describe-bindings`, but this is bad for multiple-cursors as it makes
    impossible to compare command with `memq` (`eq`).  This patch
    re-`intern's the command to make the command comparable by `eq'.
---
 multiple-cursors-core.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 5a37526..eba2417 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -340,9 +340,16 @@ the original cursor, to inform about the lack of support."
 
             ;; if it's a lambda, we can't know if it's supported or not
             ;; - so go ahead and assume it's ok, because we're just optimistic 
like that
-            (if (not (symbolp original-command))
+            (if (or (not (symbolp original-command))
+                    ;; lambda registered by smartrep
+                    (string-prefix-p "(" (symbol-name original-command)))
                 (mc/execute-command-for-all-fake-cursors original-command)
 
+              ;; smartrep `intern's commands into own obarray to help
+              ;; `describe-bindings'.  So, let's re-`intern' here to
+              ;; make the command comparable by `eq'.
+              (setq original-command (intern (symbol-name original-command)))
+
               ;; otherwise it's a symbol, and we can be more thorough
               (if (get original-command 'mc--unsupported)
                   (message "%S is not supported with multiple cursors%s"



reply via email to

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