emacs-diffs
[Top][All Lists]
Advanced

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

master ce2de3b: Further improvements to completion-list-mode-map


From: Lars Ingebrigtsen
Subject: master ce2de3b: Further improvements to completion-list-mode-map
Date: Tue, 25 May 2021 04:40:13 -0400 (EDT)

branch: master
commit ce2de3b50a2068cfe4db738756858f0e6f53226b
Author: Gregory Heytings <gregory@heytings.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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.
---
 doc/emacs/mini.texi | 6 ++++--
 etc/NEWS            | 4 ++--
 lisp/minibuffer.el  | 2 +-
 lisp/simple.el      | 9 ++++++++-
 4 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi
index 564e576..2fdb1e7 100644
--- a/doc/emacs/mini.texi
+++ b/doc/emacs/mini.texi
@@ -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}).
 
diff --git a/etc/NEWS b/etc/NEWS
index d163c18..1541b74 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 36fb8e7..ec21b7b 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -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.")
 
diff --git a/lisp/simple.el b/lisp/simple.el
index b3470ac..8849919 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -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)



reply via email to

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