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/esh-proc.el | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'lisp/eshell/esh-proc.el') diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index 32a3eecb523..a6d6aae678d 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -109,6 +109,16 @@ information, for example." (defvar eshell-process-list nil "A list of the current status of subprocesses.") +(defvar eshell-proc-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-c M-i") #'eshell-insert-process) + (define-key map (kbd "C-c C-c") #'eshell-interrupt-process) + (define-key map (kbd "C-c C-k") #'eshell-kill-process) + (define-key map (kbd "C-c C-d") #'eshell-send-eof-to-process) + (define-key map (kbd "C-c C-s") #'list-processes) + (define-key map (kbd "C-c C-\\") #'eshell-quit-process) + map)) + ;;; Functions: (defun eshell-kill-process-function (proc status) @@ -121,20 +131,16 @@ PROC and STATUS to functions on the latter." (eshell-reset-after-proc status) (run-hook-with-args 'eshell-kill-hook proc status)) +(define-minor-mode eshell-proc-mode + "Minor mode for the proc eshell module. + +\\{eshell-proc-mode-map}" + :keymap eshell-proc-mode-map) + (defun eshell-proc-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the process handling code." (make-local-variable 'eshell-process-list) - ;; This is supposedly run after enabling esh-mode, when eshell-command-map - ;; already exists. - (defvar eshell-command-map) - (define-key eshell-command-map [(meta ?i)] 'eshell-insert-process) - (define-key eshell-command-map [(control ?c)] 'eshell-interrupt-process) - (define-key eshell-command-map [(control ?k)] 'eshell-kill-process) - (define-key eshell-command-map [(control ?d)] 'eshell-send-eof-to-process) -; (define-key eshell-command-map [(control ?q)] 'eshell-continue-process) - (define-key eshell-command-map [(control ?s)] 'list-processes) -; (define-key eshell-command-map [(control ?z)] 'eshell-stop-process) - (define-key eshell-command-map [(control ?\\)] 'eshell-quit-process)) + (eshell-proc-mode)) (defun eshell-reset-after-proc (status) "Reset the command input location after a process terminates. -- cgit v1.2.3