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

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

[nongnu] elpa/helm a4e4f06073: Fix error with read-multiple-choice


From: ELPA Syncer
Subject: [nongnu] elpa/helm a4e4f06073: Fix error with read-multiple-choice
Date: Sun, 24 Dec 2023 09:59:32 -0500 (EST)

branch: elpa/helm
commit a4e4f06073699c3900c6b5b98445f7f918d28563
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Fix error with read-multiple-choice
    
    Some commands like `kill-buffer' involve another function
    involving a completing-read, in this case we want to stop at this
    function and not go up to the initial interactive call (in this
    case kill-buffer).
    
    As the same problem may occur in other places, add a new defconst to
    store such functions.
    
    The issue is fixed by making helm-this-command returning the function
    (non interactive) calling completing-read instead of the initial command.
---
 helm-lib.el | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/helm-lib.el b/helm-lib.el
index f2161d416f..471b905755 100644
--- a/helm-lib.el
+++ b/helm-lib.el
@@ -435,6 +435,9 @@ This is done recursively."
     exit-minibuffer
     helm-M-x))
 
+(defconst helm-this-command-functions '(read-multiple-choice--long-answers)
+  "The functions that should be returned by `helm-this-command' when found.")
+
 (defun helm-this-command ()
   "Return the actual command in action.
 Like `this-command' but return the real command, and not
@@ -442,13 +445,18 @@ Like `this-command' but return the real command, and not
   (cl-loop for count from 1 to 50
            for btf = (backtrace-frame count)
            for fn = (cl-second btf)
-           if (and
-               ;; In some case we may have in the way an
-               ;; advice compiled resulting in byte-code,
-               ;; ignore it (Bug#691).
-               (symbolp fn)
-               (commandp fn)
-               (not (memq fn helm-this-command-black-list)))
+           ;; Some commands like `kill-buffer' involve another function
+           ;; involving a completing-read, in this case we want to stop at this
+           ;; function and not go up to the initial interactive call (in this
+           ;; case kill-buffer).
+           if (or (memq fn helm-this-command-functions)
+                  (and
+                   ;; In some case we may have in the way an
+                   ;; advice compiled resulting in byte-code,
+                   ;; ignore it (Bug#691).
+                   (symbolp fn)
+                   (commandp fn)
+                   (not (memq fn helm-this-command-black-list))))
            return fn
            else
            if (and (eq fn 'call-interactively)



reply via email to

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