summaryrefslogtreecommitdiff
path: root/lisp/eshell/eshell.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2019-04-08 14:28:34 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2019-04-08 14:28:34 -0400
commit0d5e83611e5157800fd855fe8e3f60c8eff0af7c (patch)
tree647b4c911934746d9cbd866f64a1e8f7579f6e30 /lisp/eshell/eshell.el
parenta20845c160de2ba9f42b3af714d770df502d0577 (diff)
downloademacs-0d5e83611e5157800fd855fe8e3f60c8eff0af7c.tar.gz
emacs-0d5e83611e5157800fd855fe8e3f60c8eff0af7c.tar.bz2
emacs-0d5e83611e5157800fd855fe8e3f60c8eff0af7c.zip
Eshell: Try to untangle the dependencies; move 'provide's to the end
* lisp/eshell/esh-arg.el: Move defsubst and vars before first use. Don't require `esh-mode but esh-util instead. * lisp/eshell/esh-cmd.el: Require esh-module and esh-io. * lisp/eshell/esh-ext.el: Don't require esh-proc nor esh-cmd. (eshell-external-command): Require esh-proc for eshell-gather-process-output. * lisp/eshell/esh-mode.el: Don't require esh-io nor esh-var, but require esh-arg. (eshell-directory-name): Move from eshell.el. * lisp/eshell/esh-module.el: Don't require eshell. * lisp/eshell/esh-opt.el: Don't require esh-ext at top-level. (eshell--do-opts, eshell-show-usage): Require it here instead. * lisp/eshell/esh-proc.el: Don't require esh-cmd, but require esh-io. (eshell-reset-after-proc, eshell-record-process-object) (eshell-gather-process-output, eshell-send-eof-to-process): Require esh-mode and esh-var here. * lisp/eshell/esh-var.el: Require esh-module, esh-arg, and esh-io. * lisp/eshell/eshell.el: Require esh-module, esh-proc, esh-io, and esh-cmd. But don't require esh-mode. (eshell-directory-name): Move to esh-mode. (eshell-return-exits-minibuffer): Don't bind 'return' and 'M-return' since we already bind RET and M-RET.
Diffstat (limited to 'lisp/eshell/eshell.el')
-rw-r--r--lisp/eshell/eshell.el24
1 files changed, 10 insertions, 14 deletions
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index c7ed7103e40..db20f7d9ec5 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -175,10 +175,10 @@
(eval-when-compile
(require 'cl-lib))
(require 'esh-util)
-;; Provide eshell before requiring esh-mode, to avoid a recursive load.
-;; (Bug #34954)
-(provide 'eshell)
-(require 'esh-mode)
+(require 'esh-module) ;For eshell-using-module
+(require 'esh-proc) ;For eshell-wait-for-process
+(require 'esh-io) ;For eshell-last-command-status
+(require 'esh-cmd)
(defgroup eshell nil
"Command shell implemented entirely in Emacs Lisp.
@@ -220,12 +220,6 @@ shells such as bash, zsh, rc, 4dos."
:type 'string
:group 'eshell)
-(defcustom eshell-directory-name
- (locate-user-emacs-file "eshell/" ".eshell/")
- "The directory where Eshell control files should be kept."
- :type 'directory
- :group 'eshell)
-
;;;_* Running Eshell
;;
;; There are only three commands used to invoke Eshell. The first two
@@ -259,11 +253,12 @@ buffer selected (or created)."
buf))
(defun eshell-return-exits-minibuffer ()
+ ;; This is supposedly run after enabling esh-mode, when eshell-mode-map
+ ;; already exists.
+ (defvar eshell-mode-map)
(define-key eshell-mode-map [(control ?g)] 'abort-recursive-edit)
- (define-key eshell-mode-map [return] 'exit-minibuffer)
(define-key eshell-mode-map [(control ?m)] 'exit-minibuffer)
(define-key eshell-mode-map [(control ?j)] 'exit-minibuffer)
- (define-key eshell-mode-map [(meta return)] 'exit-minibuffer)
(define-key eshell-mode-map [(meta control ?m)] 'exit-minibuffer))
(defvar eshell-non-interactive-p nil
@@ -278,7 +273,6 @@ non-interactive sessions, such as when using `eshell-command'.")
"Execute the Eshell command string COMMAND.
With prefix ARG, insert output into the current buffer at point."
(interactive)
- (require 'esh-cmd)
(unless arg
(setq arg current-prefix-arg))
(let ((eshell-non-interactive-p t))
@@ -366,7 +360,8 @@ corresponding to a successful execution."
(let ((result (eshell-do-eval
(list 'eshell-commands
(list 'eshell-command-to-value
- (eshell-parse-command command))) t)))
+ (eshell-parse-command command)))
+ t)))
(cl-assert (eq (car result) 'quote))
(if (and status-var (symbolp status-var))
(set status-var eshell-last-command-status))
@@ -406,4 +401,5 @@ Emacs."
(run-hooks 'eshell-load-hook)
+(provide 'eshell)
;;; eshell.el ends here