From 1ee0192b792124663a0a40a729dd83c047d21535 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Wed, 26 Jun 2019 13:59:06 -0500 Subject: Fix eshell-mode-map initialization * lisp/eshell/esh-mode.el (eshell-mode-map, eshell-command-map): Set up normal keymaps and prefix commands rather than re-initializing them in each eshell buffer * lisp/eshell/em-cmpl.el (eshell-cmpl-mode-map, eshell-cmpl-mode) (eshell-cmpl-initialize): * lisp/eshell/em-hist.el (eshell-hist-mode-map, eshell-hist-mode) (eshell-hist-initialize): * lisp/eshell/em-pred.el (eshell-pred-mode-map, eshell-pred-mode) (eshell-pred-initialize): * lisp/eshell/em-prompt.el (eshell-prompt-mode-map, eshell-prompt-mode) (eshell-prompt-initialize): * lisp/eshell/em-rebind.el (eshell-rebind-mode-map, eshell-rebind-mode) (eshell-rebind-initialize): * lisp/eshell/esh-arg.el (eshell-arg-mode-map, eshell-arg-mode) (eshell-arg-initialize): * lisp/eshell/esh-proc.el (eshell-proc-mode-map, eshell-proc-mode) (eshell-proc-initialize): * lisp/eshell/esh-var.el (eshell-var-mode-map, eshell-var-mode) (eshell-var-initialize): Create a new minor mode with a keymap and call it in the module initialization function. bug#33808 bug#22792 --- lisp/eshell/em-prompt.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'lisp/eshell/em-prompt.el') diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el index adc68b6c856..993a740b825 100644 --- a/lisp/eshell/em-prompt.el +++ b/lisp/eshell/em-prompt.el @@ -97,8 +97,20 @@ arriving, or after." :options '(eshell-show-maximum-output) :group 'eshell-prompt) +(defvar eshell-prompt-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-c C-n") #'eshell-next-prompt) + (define-key map (kbd "C-c C-p") #'eshell-previous-prompt) + map)) + ;;; Functions: +(define-minor-mode eshell-prompt-mode + "Minor mode for eshell-prompt module. + +\\{eshell-prompt-mode-map}" + :keymap eshell-prompt-mode-map) + (defun eshell-prompt-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the prompting code." (unless eshell-non-interactive-p @@ -110,9 +122,7 @@ arriving, or after." (set (make-local-variable 'eshell-skip-prompt-function) 'eshell-skip-prompt) - - (define-key eshell-command-map [(control ?n)] 'eshell-next-prompt) - (define-key eshell-command-map [(control ?p)] 'eshell-previous-prompt))) + (eshell-prompt-mode))) (defun eshell-emit-prompt () "Emit a prompt if eshell is being used interactively." -- cgit v1.2.3