]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `?' work again in read-multiple-choice
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 17 Mar 2022 11:55:24 +0000 (12:55 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 17 Mar 2022 11:55:39 +0000 (12:55 +0100)
* lisp/emacs-lisp/rmc.el (read-multiple-choice): Make the `?' key
work again to show the help text.

lisp/emacs-lisp/rmc.el
test/lisp/emacs-lisp/rmc-tests.el

index c450505dfd9b63489d78f1d9407abc3cc304c056..195035e6be91d97f53b197358ba81d11f49f56d9 100644 (file)
@@ -169,8 +169,9 @@ Usage example:
                       \\='((?a \"always\")
                         (?s \"session only\")
                         (?n \"no\")))"
-  (let* ((choices (if show-help choices (append choices '((?? "?")))))
-         (altered-names (mapcar #'rmc--add-key-description choices))
+  (let* ((prompt-choices
+          (if show-help choices (append choices '((?? "?")))))
+         (altered-names (mapcar #'rmc--add-key-description prompt-choices))
          (full-prompt
           (format
            "%s (%s): "
@@ -181,7 +182,7 @@ Usage example:
       (save-excursion
         (if show-help
             (setq buf (rmc--show-help prompt help-string show-help
-                                   choices altered-names)))
+                                      choices altered-names)))
        (while (not tchar)
          (message "%s%s"
                    (if wrong-char
@@ -200,7 +201,7 @@ Usage example:
                             (lambda (elem)
                               (cons (capitalize (cadr elem))
                                     (car elem)))
-                            choices)))
+                            prompt-choices)))
                   (condition-case nil
                       (let ((cursor-in-echo-area t))
                         (read-event))
@@ -238,7 +239,7 @@ Usage example:
             (when wrong-char
               (ding))
             (setq buf (rmc--show-help prompt help-string show-help
-                                   choices altered-names))))))
+                                      choices altered-names))))))
     (when (buffer-live-p buf)
       (kill-buffer buf))
     (assq tchar choices)))
index ed30d82c3b8d645e1dfa90c21071413ab5139f8c..385b0fe44a5440f71a7438d1752f4958b3e8cf66 100644 (file)
@@ -86,7 +86,6 @@
 a: [A]aa                 b: [B]bb                 c: [C]cc
                                                   a really long
                                                   description of ccc
-                                                  \n?: [?]
-")))))
+                                                  \n")))))
 
 ;;; rmc-tests.el ends here