From 9ea3137bc8601cac9465e953e4e79ee15963e24a Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 9 Dec 2019 00:19:43 +0200 Subject: [PATCH] Move recenter/scroll keybindings from minibuffer-local-map to read-char map * lisp/minibuffer.el (minibuffer-local-map): Move remap of recenter/scroll keybindings to read-char-from-minibuffer-map. * lisp/subr.el (read-char-from-minibuffer-map): Move remap of recenter/scroll keybindings here from minibuffer-local-map. (bug#38502) --- etc/NEWS | 3 --- lisp/minibuffer.el | 6 ------ lisp/subr.el | 11 +++++++++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 8ac8ea2e409..ff5ac5103f7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -765,9 +765,6 @@ list the contents of such directories when completing file names. ** Minibuffer -*** Scrolling and recentering commands in the minibuffer are invoked -on the original window (that was selected before activating the minibuffer). - +++ *** A new user option, 'minibuffer-beginning-of-buffer-movement', has been introduced to allow controlling how the 'M-<' command works in diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c2183a67ae5..8af8aca30ec 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2244,12 +2244,6 @@ The completion method is determined by `completion-at-point-functions'." (define-key map "\C-g" 'abort-recursive-edit) (define-key map "\M-<" 'minibuffer-beginning-of-buffer) - (define-key map [remap recenter-top-bottom] 'minibuffer-recenter-top-bottom) - (define-key map [remap scroll-up-command] 'minibuffer-scroll-up-command) - (define-key map [remap scroll-down-command] 'minibuffer-scroll-down-command) - (define-key map [remap scroll-other-window] 'minibuffer-scroll-other-window) - (define-key map [remap scroll-other-window-down] 'minibuffer-scroll-other-window-down) - (define-key map "\r" 'exit-minibuffer) (define-key map "\n" 'exit-minibuffer)) diff --git a/lisp/subr.el b/lisp/subr.el index de7d919abfe..ca5af0f0ab7 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2672,8 +2672,15 @@ floating point support." (defvar read-char-from-minibuffer-map (let ((map (make-sparse-keymap))) (set-keymap-parent map minibuffer-local-map) - (define-key map [remap self-insert-command] - 'read-char-from-minibuffer-insert-char) + + (define-key map [remap self-insert-command] 'read-char-from-minibuffer-insert-char) + + (define-key map [remap recenter-top-bottom] 'minibuffer-recenter-top-bottom) + (define-key map [remap scroll-up-command] 'minibuffer-scroll-up-command) + (define-key map [remap scroll-down-command] 'minibuffer-scroll-down-command) + (define-key map [remap scroll-other-window] 'minibuffer-scroll-other-window) + (define-key map [remap scroll-other-window-down] 'minibuffer-scroll-other-window-down) + map) "Keymap for the `read-char-from-minibuffer' function.") -- 2.39.2