From: Lars Ingebrigtsen Date: Thu, 17 Mar 2022 11:55:24 +0000 (+0100) Subject: Make `?' work again in read-multiple-choice X-Git-Tag: emacs-29.0.90~1931^2~1068 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=06488ded6b9d8b4971e2e6c5b98b4fab6fe2d167;p=emacs.git Make `?' work again in read-multiple-choice * lisp/emacs-lisp/rmc.el (read-multiple-choice): Make the `?' key work again to show the help text. --- diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index c450505dfd9..195035e6be9 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el @@ -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))) diff --git a/test/lisp/emacs-lisp/rmc-tests.el b/test/lisp/emacs-lisp/rmc-tests.el index ed30d82c3b8..385b0fe44a5 100644 --- a/test/lisp/emacs-lisp/rmc-tests.el +++ b/test/lisp/emacs-lisp/rmc-tests.el @@ -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