unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: 68689@debbugs.gnu.org
Subject: bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help
Date: Wed, 24 Jan 2024 11:11:16 -0500	[thread overview]
Message-ID: <ierplxqognv.fsf@janestreet.com> (raw)
In-Reply-To: <ierjznysogr.fsf@igm-qws-u22796a.mail-host-address-is-not-set> (Spencer Baugh's message of "Wed, 24 Jan 2024 11:09:08 -0500")

[-- Attachment #1: Type: text/plain, Size: 15 bytes --]


Patch to fix


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Update-minibuffer-show-help-based-on-minibuffer-visi.patch --]
[-- Type: text/x-patch, Size: 2679 bytes --]

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	other threads:[~2024-01-24 16:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 16:09 bug#68689: 30.0.50; minibuffer-visible-completions should change completion-show-help Spencer Baugh
2024-01-24 16:11 ` Spencer Baugh [this message]
2024-01-24 16:47 ` Juri Linkov
2024-01-24 17:22   ` Spencer Baugh
2024-01-25  7:50     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ierplxqognv.fsf@janestreet.com \
    --to=sbaugh@janestreet.com \
    --cc=68689@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).