bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#68689: 30.0.50; minibuffer-visible-completions should change complet


From: Spencer Baugh
Subject: bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help
Date: Wed, 24 Jan 2024 11:11:16 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

Patch to fix

>From c70736c52262cacb905ed1e564b2335a3c87f5b4 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@janestreet.com>
Date: Wed, 24 Jan 2024 11:10:40 -0500
Subject: [PATCH] Update minibuffer-show-help based on
 minibuffer-visible-completions

minibuffer-visible-completions makes some more convenient bindings
available, but the help shown by minibuffer-show-help wasn't
suggesting them.  Now it is.

* lisp/simple.el (completion-setup-function): Change help text when
minibuffer-visible-completions is non-nil. (bug#68689)
---
 lisp/simple.el | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 35fd76b8d1a..23019dd1138 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -10232,13 +10232,27 @@ completion-setup-function
       ;; Maybe insert help string.
       (when completion-show-help
        (goto-char (point-min))
-        (insert (substitute-command-keys
-                (if (display-mouse-p)
-                    "Click or type \\[minibuffer-choose-completion] on a 
completion to select it.\n"
-                   "Type \\[minibuffer-choose-completion] on a completion to 
select it.\n")))
-        (insert (substitute-command-keys
-                "Type \\[minibuffer-next-completion] or 
\\[minibuffer-previous-completion] \
-to move point between completions.\n\n"))))))
+        (if minibuffer-visible-completions
+            (let ((helps
+                   (with-current-buffer (window-buffer 
(active-minibuffer-window))
+                     (list
+                      (substitute-command-keys
+                      (if (display-mouse-p)
+                          "Click or type 
\\[minibuffer-choose-completion-or-exit] on a completion to select it.\n"
+                         "Type \\[minibuffer-choose-completion-or-exit] on a 
completion to select it.\n"))
+                      (substitute-command-keys
+                      "Type \\[minibuffer-next-completion], 
\\[minibuffer-previous-completion], \
+\\[minibuffer-next-line-completion], \\[minibuffer-previous-line-completion] \
+to move point between completions.\n\n")))))
+              (dolist (help helps)
+                (insert help)))
+          (insert (substitute-command-keys
+                  (if (display-mouse-p)
+                      "Click or type \\[minibuffer-choose-completion] on a 
completion to select it.\n"
+                     "Type \\[minibuffer-choose-completion] on a completion to 
select it.\n")))
+          (insert (substitute-command-keys
+                  "Type \\[minibuffer-next-completion] or 
\\[minibuffer-previous-completion] \
+to move point between completions.\n\n")))))))
 
 (add-hook 'completion-setup-hook #'completion-setup-function)
 
-- 
2.39.3


reply via email to

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