From 2aaced16866f8b17ee109a0c5682b3896e713f5c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 27 Oct 2019 13:21:21 -0400 Subject: [PATCH] * lisp/loadup.el: Load minibuffer after cl-generic This is so minibuffer.el can make use of cl-generic * lisp/minibuffer.el (minibuffer-local-completion-map): Move switch-to-completions bindings here from... * lisp/simple.el (minibuffer-local-completion-map): ... here. --- lisp/loadup.el | 9 ++++----- lisp/minibuffer.el | 2 ++ lisp/simple.el | 7 ++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lisp/loadup.el b/lisp/loadup.el index e60922e380a..0246dc10262 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -195,7 +195,6 @@ (load "emacs-lisp/nadvice") (load "emacs-lisp/cl-preloaded") -(load "minibuffer") ;After loaddefs, for define-minor-mode. (load "obarray") ;abbrev.el is implemented in terms of obarrays. (load "abbrev") ;lisp-mode.el and simple.el use define-abbrev-table. (load "simple") @@ -247,6 +246,7 @@ (load "indent") (load "emacs-lisp/cl-generic") +(load "minibuffer") ;Needs cl-generic (and define-minor-mode). (load "frame") (load "startup") (load "term/tty-colors") @@ -390,10 +390,9 @@ lost after dumping"))) (let* ((base (concat "emacs-" emacs-version ".")) (exelen (if (eq system-type 'windows-nt) -4)) (files (file-name-all-completions base default-directory)) - (versions (mapcar (function - (lambda (name) - (string-to-number - (substring name (length base) exelen)))) + (versions (mapcar (lambda (name) + (string-to-number + (substring name (length base) exelen))) files))) (setq emacs-repository-version (ignore-errors (emacs-repository-get-version)) emacs-repository-branch (ignore-errors (emacs-repository-get-branch))) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c92a91e76ce..9a8db078193 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2251,6 +2251,8 @@ The completion method is determined by `completion-at-point-functions'." ;; (define-key map "\e\t" 'minibuffer-force-complete) (define-key map " " 'minibuffer-complete-word) (define-key map "?" 'minibuffer-completion-help) + (define-key map [prior] 'switch-to-completions) + (define-key map "\M-v" 'switch-to-completions) map) "Local keymap for minibuffer input with completion.") diff --git a/lisp/simple.el b/lisp/simple.el index 338f3e3fd89..5502cd49aa4 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3336,7 +3336,7 @@ to `shell-command-history'." (shell-completion-vars) (set (make-local-variable 'minibuffer-default-add-function) 'minibuffer-default-add-shell-commands)) - (apply 'read-from-minibuffer prompt initial-contents + (apply #'read-from-minibuffer prompt initial-contents minibuffer-local-shell-command-map nil (or hist 'shell-command-history) @@ -8494,10 +8494,7 @@ Called from `temp-buffer-show-hook'." "In this buffer, type \\[choose-completion] to \ select the completion near point.\n\n")))))) -(add-hook 'completion-setup-hook 'completion-setup-function) - -(define-key minibuffer-local-completion-map [prior] 'switch-to-completions) -(define-key minibuffer-local-completion-map "\M-v" 'switch-to-completions) +(add-hook 'completion-setup-hook #'completion-setup-function) (defun switch-to-completions () "Select the completion list window." -- 2.39.2