unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47699: [PATCH] Improve completion-list-mode-map
@ 2021-04-11  1:03 Gregory Heytings
  2021-04-11  7:24 ` Eli Zaretskii
  2021-04-11  7:31 ` Eli Zaretskii
  0 siblings, 2 replies; 33+ messages in thread
From: Gregory Heytings @ 2021-04-11  1:03 UTC (permalink / raw)
  To: 47699

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


Currently completion-list-mode-map does not give a specific meaning to 
most keys, which means that most keypresses display an error "Buffer is 
read-only #<buffer *Completions*>".  I suggest to make it a child of 
special-mode-map, and to bind the "n" and "p" keys to "next-completion" 
and "previous-completion".

Patch attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff; name=0001-Improve-completion-list-mode-map.patch, Size: 1315 bytes --]

From 53dd1bcb56e743452f5bb825f46c60ed19ae72d1 Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
Date: Sun, 11 Apr 2021 00:53:54 +0000
Subject: [PATCH] Improve completion-list-mode-map

* lisp/simple.el (completion-list-mode-map): Make special-mode-map its
parent, unbind the 'g' revert key, add the 'n' and 'p' keys for
next-completion and previous-completion.
---
 lisp/simple.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/simple.el b/lisp/simple.el
index 999755a642..82ac6fc6b3 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -8767,6 +8767,8 @@ makes it easier to edit it."
 
 (defvar completion-list-mode-map
   (let ((map (make-sparse-keymap)))
+    (set-keymap-parent map special-mode-map)
+    (define-key map "g" nil) ;; nothing to revert
     (define-key map [mouse-2] 'choose-completion)
     (define-key map [follow-link] 'mouse-face)
     (define-key map [down-mouse-2] nil)
@@ -8778,6 +8780,8 @@ makes it easier to edit it."
     (define-key map [backtab] 'previous-completion)
     (define-key map "q" 'quit-window)
     (define-key map "z" 'kill-current-buffer)
+    (define-key map "n" 'next-completion)
+    (define-key map "p" 'previous-completion)
     map)
   "Local map for completion list buffers.")
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2021-05-25 19:27 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-11  1:03 bug#47699: [PATCH] Improve completion-list-mode-map Gregory Heytings
2021-04-11  7:24 ` Eli Zaretskii
2021-04-11  7:31 ` Eli Zaretskii
2021-04-11  7:58   ` Gregory Heytings
2021-04-11  8:14     ` Eli Zaretskii
2021-04-11  8:31       ` Gregory Heytings
2021-04-11  8:34         ` Eli Zaretskii
2021-04-11 10:14           ` Gregory Heytings
2021-04-11 10:40             ` Eli Zaretskii
2021-04-11 10:50               ` Gregory Heytings
2021-04-11 13:31                 ` Eli Zaretskii
2021-04-11 18:30                   ` Gregory Heytings
2021-04-11 18:46                     ` Eli Zaretskii
2021-04-11 19:13                       ` Gregory Heytings
2021-04-11 19:37                         ` Eli Zaretskii
2021-04-11 20:44                           ` Gregory Heytings
2021-04-12  7:24                             ` Gregory Heytings
2021-04-11 18:59                     ` bug#47699: [External] : " Drew Adams
2021-04-11 19:21                       ` Gregory Heytings
2021-04-11 22:33                         ` Drew Adams
2021-04-12  6:49                           ` Gregory Heytings
2021-04-12 14:50                             ` Drew Adams
2021-05-25  4:39                     ` Lars Ingebrigtsen
2021-05-25  7:32                       ` Gregory Heytings
2021-05-25  7:37                         ` Lars Ingebrigtsen
2021-05-25  8:34                           ` Gregory Heytings
2021-05-25  8:40                             ` Lars Ingebrigtsen
2021-05-25  8:42                               ` Gregory Heytings
2021-05-25 12:31                       ` Basil L. Contovounesios
2021-05-25 19:22                         ` Lars Ingebrigtsen
2021-05-25 19:25                         ` Gregory Heytings
2021-05-25 19:27                           ` Gregory Heytings
2021-04-11 22:36         ` Juri Linkov

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).