summaryrefslogtreecommitdiff
path: root/lisp/eshell/em-prompt.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/eshell/em-prompt.el')
-rw-r--r--lisp/eshell/em-prompt.el16
1 files changed, 13 insertions, 3 deletions
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."