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

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

bug#64425: [PATCH] Mention minibuffer-next-completion in completion-help


From: Spencer Baugh
Subject: bug#64425: [PATCH] Mention minibuffer-next-completion in completion-help
Date: Mon, 03 Jul 2023 10:00:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Spencer Baugh <sbaugh@janestreet.com>
>> Date: Mon, 3 Jul 2023 09:31:11 -0400
>> Cc: Spencer Baugh <sbaugh@catern.com>, 64425@debbugs.gnu.org
>> 
>> On Mon, Jul 3, 2023, 09:27 Eli Zaretskii <eliz@gnu.org> wrote:
>> 
>>  > Date: Mon, 03 Jul 2023 13:19:27 +0000 (UTC)
>>  > From: Spencer Baugh <sbaugh@catern.com>
>>  > Cc: Spencer Baugh <sbaugh@janestreet.com>, 64425@debbugs.gnu.org
>>  > 
>>  >  > diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi 
>>  >  > index 9bf4da67644..517a6262522 100644 
>>  >  > --- a/doc/emacs/mini.texi 
>>  >  > +++ b/doc/emacs/mini.texi 
>>  >  > @@ -393,7 +393,7 @@ Completion Commands 
>>  >  >  @vindex minibuffer-completion-auto-choose 
>>  >  >  @item M-@key{DOWN} 
>>  >  >  @itemx M-@key{UP} 
>>  >  > -While in the minibuffer, these keys navigate through the completions 
>>  >  > +These keys navigate through the completions 
>>  > 
>>  >  I don't understand this change: do you mean that these keys are 
>>  >  available not only in the minibuffer? 
>>  > 
>>  > Yes, my change adds bindings for them also in the completions buffer. So 
>> they can be used
>>  identically
>>  > in both places.
>> 
>>  Then the manual should say "in the minibuffer and in the completions
>>  buffer
>> 
>> They are also available in regular buffers after triggering 
>> completion-at-point. Should we note that too?
>
> Yes, but in another place, where completion-at-point is documented.

OK, fair enough.  Actually, that part is already done, in (info "(emacs)
Symbol Completion").

So revised patch updating the minibuffer completion documentation:

>From 7c6bc1fc940252b65f2d63c98ff2d53f02699091 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@janestreet.com>
Date: Mon, 3 Jul 2023 09:59:04 -0400
Subject: [PATCH] Mention minibuffer-next-completion in completion-help

Now that it's not necessary to switch to the *Completions* buffer to
switch between and choose completions, we should make that clear in
the help text.  Let's also make the bindings uniform both in and
outside the *Completions* buffer so users don't have to think about
the difference.

In working with new users, they've assumed that since the help text in
*Completions* says "Click on a completion to select it", that that's
the only way to select a completion.  This text should help clarify
that.

* doc/emacs/mini.texi (Completion Commands): Document new bindings.
* lisp/simple.el (completion-list-mode-map): Bind
minibuffer-{next,previous,choose}-completion.
(completion-setup-function): Mention bindings for
minibuffer-{next,previous,choose}-completion. (Bug#64425)
---
 doc/emacs/mini.texi | 12 ++++++------
 lisp/simple.el      | 15 ++++++++++-----
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi
index 9bf4da67644..8281c8cb9d4 100644
--- a/doc/emacs/mini.texi
+++ b/doc/emacs/mini.texi
@@ -393,11 +393,11 @@ Completion Commands
 @vindex minibuffer-completion-auto-choose
 @item M-@key{DOWN}
 @itemx M-@key{UP}
-While in the minibuffer, these keys navigate through the completions
-displayed in the completions buffer.  When
-@code{minibuffer-completion-auto-choose} is non-@code{nil} (which is
-the default), using these commands also inserts the current completion
-candidate into the minibuffer.  If
+While in the minibuffer or in the completion list buffer, these keys
+navigate through the completions displayed in the completion list
+buffer.  When @code{minibuffer-completion-auto-choose} is
+non-@code{nil} (which is the default), using these commands also
+inserts the current completion candidate into the minibuffer.  If
 @code{minibuffer-completion-auto-choose} is @code{nil}, you can use
 the @kbd{M-@key{RET}} command to insert the completion candidates into
 the minibuffer.  By default, that exits the minibuffer, but with a
@@ -410,7 +410,7 @@ Completion Commands
 @itemx @key{prior}
 Typing @kbd{M-v}, while in the minibuffer, selects the window showing
 the completion list (@code{switch-to-completions}).  This paves the
-way for using the commands below.  @key{PageUp}, @key{prior} and
+way for also using the commands below.  @key{PageUp}, @key{prior} and
 @kbd{M-g M-c} does the same.  You can also select the window in other
 ways (@pxref{Windows}).
 
diff --git a/lisp/simple.el b/lisp/simple.el
index b6efb06fc27..3513bb82293 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -9670,6 +9670,9 @@ completion-list-mode-map
     (define-key map [right] 'next-completion)
     (define-key map [?\t] 'next-completion)
     (define-key map [backtab] 'previous-completion)
+    (define-key map (kbd "M-<up>") 'minibuffer-previous-completion)
+    (define-key map (kbd "M-<down>") 'minibuffer-next-completion)
+    (define-key map (kbd "M-RET") 'minibuffer-choose-completion)
     (define-key map "z" 'kill-current-buffer)
     (define-key map "n" 'next-completion)
     (define-key map "p" 'previous-completion)
@@ -10064,11 +10067,13 @@ completion-setup-function
       ;; Maybe insert help string.
       (when completion-show-help
        (goto-char (point-min))
-       (if (display-mouse-p)
-           (insert "Click on a completion to select it.\n"))
-       (insert (substitute-command-keys
-                "In this buffer, type \\[choose-completion] to \
-select the completion near point.\n\n"))))))
+        (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]