Further improvements to completion-list-mode-map

* doc/emacs/mini.texi (Completion Commands): Mention the change,
and mention the 'n' and 'p' keys bound to 'next-completion' and
'previous-completion'. (bug#47699).
* lisp/minibuffer.el (minibuffer-local-completion-map): Change the
M-g key to M-g M-c.

* lisp/simple.el (completion-list-mode-map): Change the M-g key to
M-g M-c.
(read-expression-map): Bind M-g M-c to
read-expression-switch-to-completions.
(read-expression-switch-to-completions): New function.
This commit is contained in:
Gregory Heytings 2021-05-25 10:39:48 +02:00 committed by Lars Ingebrigtsen
parent de9a11255d
commit ce2de3b50a
4 changed files with 15 additions and 6 deletions

View file

@ -375,8 +375,8 @@ used with the completion list:
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
@kbd{M-g} does the same. You can also select the window in other ways
(@pxref{Windows}).
@kbd{M-g M-c} does the same. You can also select the window in other
ways (@pxref{Windows}).
@findex choose-completion
@item @key{RET}
@ -388,12 +388,14 @@ point (@code{choose-completion}).
@findex next-completion
@item @key{TAB}
@item @key{RIGHT}
@item @key{n}
While in the completion list buffer, these keys move point to the
following completion alternative (@code{next-completion}).
@findex previous-completion
@item @key{S-TAB}
@item @key{LEFT}
@item @key{p}
While in the completion list buffer, these keys move point to the
previous completion alternative (@code{previous-completion}).

View file

@ -444,8 +444,8 @@ major mode.
** Completion List Mode
New key bindings have been added: 'n' and 'p' to navigate completions,
and 'M-g' to switch to the minibuffer, and you can also switch back
to the completion list buffer with 'M-g'.
and 'M-g M-c' to switch to the minibuffer, and you can also switch back
to the completion list buffer with 'M-g M-c'.
** Benchmark
*** New function 'benchmark-call' to measure the execution time of a function.

View file

@ -2603,7 +2603,7 @@ The completion method is determined by `completion-at-point-functions'."
(define-key map "?" 'minibuffer-completion-help)
(define-key map [prior] 'switch-to-completions)
(define-key map "\M-v" 'switch-to-completions)
(define-key map "\M-g" 'switch-to-completions)
(define-key map "\M-g\M-c" 'switch-to-completions)
map)
"Local keymap for minibuffer input with completion.")

View file

@ -1661,6 +1661,7 @@ in *Help* buffer. See also the command `describe-char'."
(define-key m "\t" 'completion-at-point)
(define-key m "\r" 'read--expression-try-read)
(define-key m "\n" 'read--expression-try-read)
(define-key m "\M-g\M-c" 'read-expression-switch-to-completions)
(set-keymap-parent m minibuffer-local-map)
m))
@ -8848,7 +8849,7 @@ makes it easier to edit it."
(define-key map "z" 'kill-current-buffer)
(define-key map "n" 'next-completion)
(define-key map "p" 'previous-completion)
(define-key map "\M-g" 'switch-to-minibuffer)
(define-key map "\M-g\M-c" 'switch-to-minibuffer)
map)
"Local map for completion list buffers.")
@ -9138,6 +9139,12 @@ select the completion near point.\n\n"))))))
(when (bobp)
(next-completion 1)))))
(defun read-expression-switch-to-completions ()
"Select the completion list window while reading an expression."
(interactive)
(completion-help-at-point)
(switch-to-completions))
(defun switch-to-minibuffer ()
"Select the minibuffer window."
(interactive)