Commit 0d5e8361 authored by Stefan Monnier's avatar Stefan Monnier

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.
parent a20845c1
Pipeline #1203 failed with stage
in 51 minutes and 5 seconds
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
(require 'ring) (require 'ring)
(require 'esh-opt) (require 'esh-opt)
(require 'esh-mode)
(require 'em-pred) (require 'em-pred)
(require 'eshell) (require 'eshell)
...@@ -192,7 +193,6 @@ element, regardless of any text on the command line. In that case, ...@@ -192,7 +193,6 @@ element, regardless of any text on the command line. In that case,
(defvar eshell-isearch-map (defvar eshell-isearch-map
(let ((map (copy-keymap isearch-mode-map))) (let ((map (copy-keymap isearch-mode-map)))
(define-key map [(control ?m)] 'eshell-isearch-return) (define-key map [(control ?m)] 'eshell-isearch-return)
(define-key map [return] 'eshell-isearch-return)
(define-key map [(control ?r)] 'eshell-isearch-repeat-backward) (define-key map [(control ?r)] 'eshell-isearch-repeat-backward)
(define-key map [(control ?s)] 'eshell-isearch-repeat-forward) (define-key map [(control ?s)] 'eshell-isearch-repeat-forward)
(define-key map [(control ?g)] 'eshell-isearch-abort) (define-key map [(control ?g)] 'eshell-isearch-abort)
...@@ -220,7 +220,7 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil." ...@@ -220,7 +220,7 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil."
"Initialize the history management code for one Eshell buffer." "Initialize the history management code for one Eshell buffer."
(when (eshell-using-module 'eshell-cmpl) (when (eshell-using-module 'eshell-cmpl)
(add-hook 'pcomplete-try-first-hook (add-hook 'pcomplete-try-first-hook
'eshell-complete-history-reference nil t)) #'eshell-complete-history-reference nil t))
(if (and (eshell-using-module 'eshell-rebind) (if (and (eshell-using-module 'eshell-rebind)
(not eshell-non-interactive-p)) (not eshell-non-interactive-p))
...@@ -235,11 +235,13 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil." ...@@ -235,11 +235,13 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil."
(lambda () (lambda ()
(if (>= (point) eshell-last-output-end) (if (>= (point) eshell-last-output-end)
(setq overriding-terminal-local-map (setq overriding-terminal-local-map
eshell-isearch-map)))) nil t) eshell-isearch-map))))
nil t)
(add-hook 'isearch-mode-end-hook (add-hook 'isearch-mode-end-hook
(function (function
(lambda () (lambda ()
(setq overriding-terminal-local-map nil))) nil t)) (setq overriding-terminal-local-map nil)))
nil t))
(define-key eshell-mode-map [up] 'eshell-previous-matching-input-from-input) (define-key eshell-mode-map [up] 'eshell-previous-matching-input-from-input)
(define-key eshell-mode-map [down] 'eshell-next-matching-input-from-input) (define-key eshell-mode-map [down] 'eshell-next-matching-input-from-input)
(define-key eshell-mode-map [(control up)] 'eshell-previous-input) (define-key eshell-mode-map [(control up)] 'eshell-previous-input)
...@@ -288,17 +290,17 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil." ...@@ -288,17 +290,17 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil."
(if eshell-history-file-name (if eshell-history-file-name
(eshell-read-history nil t)) (eshell-read-history nil t))
(add-hook 'eshell-exit-hook 'eshell-write-history nil t)) (add-hook 'eshell-exit-hook #'eshell-write-history nil t))
(unless eshell-history-ring (unless eshell-history-ring
(setq eshell-history-ring (make-ring eshell-history-size))) (setq eshell-history-ring (make-ring eshell-history-size)))
(add-hook 'eshell-exit-hook 'eshell-write-history nil t) (add-hook 'eshell-exit-hook #'eshell-write-history nil t)
(add-hook 'kill-emacs-hook 'eshell-save-some-history) (add-hook 'kill-emacs-hook #'eshell-save-some-history)
(make-local-variable 'eshell-input-filter-functions) (make-local-variable 'eshell-input-filter-functions)
(add-hook 'eshell-input-filter-functions 'eshell-add-to-history nil t) (add-hook 'eshell-input-filter-functions #'eshell-add-to-history nil t)
(define-key eshell-command-map [(control ?l)] 'eshell-list-history) (define-key eshell-command-map [(control ?l)] 'eshell-list-history)
(define-key eshell-command-map [(control ?x)] 'eshell-get-next-from-history)) (define-key eshell-command-map [(control ?x)] 'eshell-get-next-from-history))
...@@ -754,7 +756,7 @@ matched." ...@@ -754,7 +756,7 @@ matched."
(setq nth (eshell-hist-word-reference nth))) (setq nth (eshell-hist-word-reference nth)))
(unless (numberp mth) (unless (numberp mth)
(setq mth (eshell-hist-word-reference mth))) (setq mth (eshell-hist-word-reference mth)))
(cons (mapconcat 'identity (eshell-sublist textargs nth mth) " ") (cons (mapconcat #'identity (eshell-sublist textargs nth mth) " ")
end)))) end))))
(defun eshell-hist-parse-modifier (hist reference) (defun eshell-hist-parse-modifier (hist reference)
......
...@@ -191,7 +191,7 @@ allowed." ...@@ -191,7 +191,7 @@ allowed."
(term-exec term-buf program program nil args) (term-exec term-buf program program nil args)
(let ((proc (get-buffer-process term-buf))) (let ((proc (get-buffer-process term-buf)))
(if (and proc (eq 'run (process-status proc))) (if (and proc (eq 'run (process-status proc)))
(set-process-sentinel proc 'eshell-term-sentinel) (set-process-sentinel proc #'eshell-term-sentinel)
(error "Failed to invoke visual command"))) (error "Failed to invoke visual command")))
(term-char-mode) (term-char-mode)
(if eshell-escape-control-x (if eshell-escape-control-x
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
;; hook `eshell-parse-argument-hook'. For a good example of this, see ;; hook `eshell-parse-argument-hook'. For a good example of this, see
;; `eshell-parse-drive-letter', defined in eshell-dirs.el. ;; `eshell-parse-drive-letter', defined in eshell-dirs.el.
(provide 'esh-arg) ;;; Code:
(require 'esh-mode) (require 'esh-util)
(defgroup eshell-arg nil (defgroup eshell-arg nil
"Argument parsing involves transforming the arguments passed on the "Argument parsing involves transforming the arguments passed on the
...@@ -36,6 +36,48 @@ yield the values intended." ...@@ -36,6 +36,48 @@ yield the values intended."
:tag "Argument parsing" :tag "Argument parsing"
:group 'eshell) :group 'eshell)
;;; Internal Variables:
(defvar eshell-current-argument nil)
(defvar eshell-current-modifiers nil)
(defvar eshell-arg-listified nil)
(defvar eshell-nested-argument nil)
(defvar eshell-current-quoted nil)
(defvar eshell-inside-quote-regexp nil)
(defvar eshell-outside-quote-regexp nil)
;;; User Variables:
(defcustom eshell-arg-load-hook nil
"A hook that gets run when `eshell-arg' is loaded."
:version "24.1" ; removed eshell-arg-initialize
:type 'hook
:group 'eshell-arg)
(defcustom eshell-delimiter-argument-list '(?\; ?& ?\| ?\> ?\s ?\t ?\n)
"List of characters to recognize as argument separators."
:type '(repeat character)
:group 'eshell-arg)
(defcustom eshell-special-chars-inside-quoting '(?\\ ?\")
"Characters which are still special inside double quotes."
:type '(repeat character)
:group 'eshell-arg)
(defcustom eshell-special-chars-outside-quoting
(append eshell-delimiter-argument-list '(?# ?! ?\\ ?\" ?\'))
"Characters that require escaping outside of double quotes.
Without escaping them, they will introduce a change in the argument."
:type '(repeat character)
:group 'eshell-arg)
(defsubst eshell-arg-delimiter (&optional pos)
"Return non-nil if POS is an argument delimiter.
If POS is nil, the location of point is checked."
(let ((pos (or pos (point))))
(or (= pos (point-max))
(memq (char-after pos) eshell-delimiter-argument-list))))
(defcustom eshell-parse-argument-hook (defcustom eshell-parse-argument-hook
(list (list
;; a term such as #<buffer NAME>, or #<process NAME> is a buffer ;; a term such as #<buffer NAME>, or #<process NAME> is a buffer
...@@ -113,47 +155,13 @@ treated as a literal character." ...@@ -113,47 +155,13 @@ treated as a literal character."
:type 'hook :type 'hook
:group 'eshell-arg) :group 'eshell-arg)
;;; Code:
;;; User Variables:
(defcustom eshell-arg-load-hook nil
"A hook that gets run when `eshell-arg' is loaded."
:version "24.1" ; removed eshell-arg-initialize
:type 'hook
:group 'eshell-arg)
(defcustom eshell-delimiter-argument-list '(?\; ?& ?\| ?\> ?\s ?\t ?\n)
"List of characters to recognize as argument separators."
:type '(repeat character)
:group 'eshell-arg)
(defcustom eshell-special-chars-inside-quoting '(?\\ ?\")
"Characters which are still special inside double quotes."
:type '(repeat character)
:group 'eshell-arg)
(defcustom eshell-special-chars-outside-quoting
(append eshell-delimiter-argument-list '(?# ?! ?\\ ?\" ?\'))
"Characters that require escaping outside of double quotes.
Without escaping them, they will introduce a change in the argument."
:type '(repeat character)
:group 'eshell-arg)
;;; Internal Variables:
(defvar eshell-current-argument nil)
(defvar eshell-current-modifiers nil)
(defvar eshell-arg-listified nil)
(defvar eshell-nested-argument nil)
(defvar eshell-current-quoted nil)
(defvar eshell-inside-quote-regexp nil)
(defvar eshell-outside-quote-regexp nil)
;;; Functions: ;;; Functions:
(defun eshell-arg-initialize () (defun eshell-arg-initialize ()
"Initialize the argument parsing code." "Initialize the argument parsing code."
;; This is supposedly run after enabling esh-mode, when eshell-mode-map
;; already exists.
(defvar eshell-command-map)
(define-key eshell-command-map [(meta ?b)] 'eshell-insert-buffer-name) (define-key eshell-command-map [(meta ?b)] 'eshell-insert-buffer-name)
(set (make-local-variable 'eshell-inside-quote-regexp) nil) (set (make-local-variable 'eshell-inside-quote-regexp) nil)
(set (make-local-variable 'eshell-outside-quote-regexp) nil)) (set (make-local-variable 'eshell-outside-quote-regexp) nil))
...@@ -195,13 +203,6 @@ Without escaping them, they will introduce a change in the argument." ...@@ -195,13 +203,6 @@ Without escaping them, they will introduce a change in the argument."
(setq eshell-current-argument argument)) (setq eshell-current-argument argument))
(throw 'eshell-arg-done t)) (throw 'eshell-arg-done t))
(defsubst eshell-arg-delimiter (&optional pos)
"Return non-nil if POS is an argument delimiter.
If POS is nil, the location of point is checked."
(let ((pos (or pos (point))))
(or (= pos (point-max))
(memq (char-after pos) eshell-delimiter-argument-list))))
(defun eshell-quote-argument (string) (defun eshell-quote-argument (string)
"Return STRING with magic characters quoted. "Return STRING with magic characters quoted.
Magic characters are those in `eshell-special-chars-outside-quoting'." Magic characters are those in `eshell-special-chars-outside-quoting'."
...@@ -405,4 +406,5 @@ If the form has no `type', the syntax is parsed as if `type' were ...@@ -405,4 +406,5 @@ If the form has no `type', the syntax is parsed as if `type' were
(char-to-string (char-after))))) (char-to-string (char-after)))))
(goto-char end))))))) (goto-char end)))))))
(provide 'esh-arg)
;;; esh-arg.el ends here ;;; esh-arg.el ends here
...@@ -105,6 +105,8 @@ ...@@ -105,6 +105,8 @@
(require 'eldoc)) (require 'eldoc))
(require 'esh-arg) (require 'esh-arg)
(require 'esh-proc) (require 'esh-proc)
(require 'esh-module)
(require 'esh-io)
(require 'esh-ext) (require 'esh-ext)
(eval-when-compile (eval-when-compile
...@@ -1337,7 +1339,7 @@ messages, and errors." ...@@ -1337,7 +1339,7 @@ messages, and errors."
(eshell-print "\n")) (eshell-print "\n"))
(eshell-close-handles 0 (list 'quote result))))) (eshell-close-handles 0 (list 'quote result)))))
(defalias 'eshell-lisp-command* 'eshell-lisp-command) (defalias 'eshell-lisp-command* #'eshell-lisp-command)
(provide 'esh-cmd) (provide 'esh-cmd)
......
...@@ -31,17 +31,12 @@ ...@@ -31,17 +31,12 @@
;;; Code: ;;; Code:
(provide 'esh-ext)
(require 'esh-util) (require 'esh-util)
(eval-when-compile (eval-when-compile (require 'cl-lib))
(require 'cl-lib)
(require 'esh-cmd))
(require 'esh-io) (require 'esh-io)
(require 'esh-arg) (require 'esh-arg)
(require 'esh-opt) (require 'esh-opt)
(require 'esh-proc)
(defgroup eshell-ext nil (defgroup eshell-ext nil
"External commands are invoked when operating system executables are "External commands are invoked when operating system executables are
...@@ -179,7 +174,7 @@ external version." ...@@ -179,7 +174,7 @@ external version."
(defun eshell-ext-initialize () (defun eshell-ext-initialize ()
"Initialize the external command handling code." "Initialize the external command handling code."
(add-hook 'eshell-named-command-hook 'eshell-explicit-command nil t)) (add-hook 'eshell-named-command-hook #'eshell-explicit-command nil t))
(defun eshell-explicit-command (command args) (defun eshell-explicit-command (command args)
"If a command name begins with `*', call it externally always. "If a command name begins with `*', call it externally always.
...@@ -193,8 +188,6 @@ This bypasses all Lisp functions and aliases." ...@@ -193,8 +188,6 @@ This bypasses all Lisp functions and aliases."
(error "%s: external command not found" (error "%s: external command not found"
(substring command 1)))))) (substring command 1))))))
(autoload 'eshell-close-handles "esh-io")
(defun eshell-remote-command (command args) (defun eshell-remote-command (command args)
"Insert output from a remote COMMAND, using ARGS. "Insert output from a remote COMMAND, using ARGS.
A remote command is something that executes on a different machine. A remote command is something that executes on a different machine.
...@@ -211,7 +204,7 @@ causing the user to wonder if anything's really going on..." ...@@ -211,7 +204,7 @@ causing the user to wonder if anything's really going on..."
(progn (progn
(setq exitcode (setq exitcode
(shell-command (shell-command
(mapconcat 'shell-quote-argument (mapconcat #'shell-quote-argument
(append (list command) args) " ") (append (list command) args) " ")
outbuf errbuf)) outbuf errbuf))
(eshell-print (with-current-buffer outbuf (buffer-string))) (eshell-print (with-current-buffer outbuf (buffer-string)))
...@@ -235,6 +228,8 @@ causing the user to wonder if anything's really going on..." ...@@ -235,6 +228,8 @@ causing the user to wonder if anything's really going on..."
(cl-assert interp) (cl-assert interp)
(if (functionp (car interp)) (if (functionp (car interp))
(apply (car interp) (append (cdr interp) args)) (apply (car interp) (append (cdr interp) args))
(require 'esh-proc)
(declare-function eshell-gather-process-output "esh-proc" (command args))
(eshell-gather-process-output (eshell-gather-process-output
(car interp) (append (cdr interp) args))))) (car interp) (append (cdr interp) args)))))
...@@ -249,7 +244,7 @@ Adds the given PATH to $PATH.") ...@@ -249,7 +244,7 @@ Adds the given PATH to $PATH.")
(if args (if args
(progn (progn
(setq eshell-path-env (getenv "PATH") (setq eshell-path-env (getenv "PATH")
args (mapconcat 'identity args path-separator) args (mapconcat #'identity args path-separator)
eshell-path-env eshell-path-env
(if prepend (if prepend
(concat args path-separator eshell-path-env) (concat args path-separator eshell-path-env)
...@@ -336,4 +331,5 @@ line of the form #!<interp>." ...@@ -336,4 +331,5 @@ line of the form #!<interp>."
(cdr interp))))) (cdr interp)))))
(or interp (list fullname))))))) (or interp (list fullname)))))))
(provide 'esh-ext)
;;; esh-ext.el ends here ;;; esh-ext.el ends here
...@@ -68,8 +68,6 @@ ...@@ -68,8 +68,6 @@
;;; Code: ;;; Code:
(provide 'esh-io)
(require 'esh-arg) (require 'esh-arg)
(require 'esh-util) (require 'esh-util)
...@@ -511,4 +509,5 @@ Returns what was actually sent, or nil if nothing was sent." ...@@ -511,4 +509,5 @@ Returns what was actually sent, or nil if nothing was sent."
(eshell-output-object-to-target object (car target)) (eshell-output-object-to-target object (car target))
(setq target (cdr target)))))) (setq target (cdr target))))))
(provide 'esh-io)
;;; esh-io.el ends here ;;; esh-io.el ends here
...@@ -58,13 +58,10 @@ ...@@ -58,13 +58,10 @@
;;; Code: ;;; Code:
(provide 'esh-mode)
(require 'esh-util) (require 'esh-util)
(require 'esh-module) (require 'esh-module)
(require 'esh-cmd) (require 'esh-cmd)
(require 'esh-io) (require 'esh-arg) ;For eshell-parse-arguments
(require 'esh-var)
(defgroup eshell-mode nil (defgroup eshell-mode nil
"This module contains code for handling input from the user." "This module contains code for handling input from the user."
...@@ -202,6 +199,12 @@ This is used by `eshell-watch-for-password-prompt'." ...@@ -202,6 +199,12 @@ This is used by `eshell-watch-for-password-prompt'."
:type 'boolean :type 'boolean
:group 'eshell-mode) :group 'eshell-mode)
(defcustom eshell-directory-name
(locate-user-emacs-file "eshell/" ".eshell/")
"The directory where Eshell control files should be kept."
:type 'directory
:group 'eshell)
(defvar eshell-first-time-p t (defvar eshell-first-time-p t
"A variable which is non-nil the first time Eshell is loaded.") "A variable which is non-nil the first time Eshell is loaded.")
...@@ -292,7 +295,7 @@ and the hook `eshell-exit-hook'." ...@@ -292,7 +295,7 @@ and the hook `eshell-exit-hook'."
;; It's fine to run this unconditionally since it can be customized ;; It's fine to run this unconditionally since it can be customized
;; via the `eshell-kill-processes-on-exit' variable. ;; via the `eshell-kill-processes-on-exit' variable.
(and (fboundp 'eshell-query-kill-processes) (and (fboundp 'eshell-query-kill-processes)
(not (memq 'eshell-query-kill-processes eshell-exit-hook)) (not (memq #'eshell-query-kill-processes eshell-exit-hook))
(eshell-query-kill-processes)) (eshell-query-kill-processes))
(run-hooks 'eshell-exit-hook)) (run-hooks 'eshell-exit-hook))
...@@ -334,7 +337,6 @@ and the hook `eshell-exit-hook'." ...@@ -334,7 +337,6 @@ and the hook `eshell-exit-hook'."
(define-key eshell-command-map [(control ?b)] 'eshell-backward-argument) (define-key eshell-command-map [(control ?b)] 'eshell-backward-argument)
(define-key eshell-command-map [(control ?e)] 'eshell-show-maximum-output) (define-key eshell-command-map [(control ?e)] 'eshell-show-maximum-output)
(define-key eshell-command-map [(control ?f)] 'eshell-forward-argument) (define-key eshell-command-map [(control ?f)] 'eshell-forward-argument)
(define-key eshell-command-map [return] 'eshell-copy-old-input)
(define-key eshell-command-map [(control ?m)] 'eshell-copy-old-input) (define-key eshell-command-map [(control ?m)] 'eshell-copy-old-input)
(define-key eshell-command-map [(control ?o)] 'eshell-kill-output) (define-key eshell-command-map [(control ?o)] 'eshell-kill-output)
(define-key eshell-command-map [(control ?r)] 'eshell-show-output) (define-key eshell-command-map [(control ?r)] 'eshell-show-output)
...@@ -414,19 +416,19 @@ and the hook `eshell-exit-hook'." ...@@ -414,19 +416,19 @@ and the hook `eshell-exit-hook'."
(and initfunc (fboundp initfunc) (funcall initfunc)))) (and initfunc (fboundp initfunc) (funcall initfunc))))
(if eshell-send-direct-to-subprocesses (if eshell-send-direct-to-subprocesses
(add-hook 'pre-command-hook 'eshell-intercept-commands t t)) (add-hook 'pre-command-hook #'eshell-intercept-commands t t))
(if eshell-scroll-to-bottom-on-input (if eshell-scroll-to-bottom-on-input
(add-hook 'pre-command-hook 'eshell-preinput-scroll-to-bottom t t)) (add-hook 'pre-command-hook #'eshell-preinput-scroll-to-bottom t t))
(when eshell-scroll-show-maximum-output (when eshell-scroll-show-maximum-output
(set (make-local-variable 'scroll-conservatively) 1000)) (set (make-local-variable 'scroll-conservatively) 1000))
(when eshell-status-in-mode-line (when eshell-status-in-mode-line
(add-hook 'eshell-pre-command-hook 'eshell-command-started nil t) (add-hook 'eshell-pre-command-hook #'eshell-command-started nil t)
(add-hook 'eshell-post-command-hook 'eshell-command-finished nil t)) (add-hook 'eshell-post-command-hook #'eshell-command-finished nil t))
(add-hook 'kill-buffer-hook 'eshell-kill-buffer-function t t) (add-hook 'kill-buffer-hook #'eshell-kill-buffer-function t t)
(if eshell-first-time-p (if eshell-first-time-p
(run-hooks 'eshell-first-time-mode-hook)) (run-hooks 'eshell-first-time-mode-hook))
...@@ -451,10 +453,10 @@ and the hook `eshell-exit-hook'." ...@@ -451,10 +453,10 @@ and the hook `eshell-exit-hook'."
(if eshell-send-direct-to-subprocesses (if eshell-send-direct-to-subprocesses
(progn (progn
(setq eshell-send-direct-to-subprocesses nil) (setq eshell-send-direct-to-subprocesses nil)
(remove-hook 'pre-command-hook 'eshell-intercept-commands t) (remove-hook 'pre-command-hook #'eshell-intercept-commands t)
(message "Sending subprocess input on RET")) (message "Sending subprocess input on RET"))
(setq eshell-send-direct-to-subprocesses t) (setq eshell-send-direct-to-subprocesses t)
(add-hook 'pre-command-hook 'eshell-intercept-commands t t) (add-hook 'pre-command-hook #'eshell-intercept-commands t t)
(message "Sending subprocess input directly"))) (message "Sending subprocess input directly")))
(defun eshell-self-insert-command () (defun eshell-self-insert-command ()
...@@ -543,7 +545,7 @@ and the hook `eshell-exit-hook'." ...@@ -543,7 +545,7 @@ and the hook `eshell-exit-hook'."
"Push a mark at the end of the last input text." "Push a mark at the end of the last input text."
(push-mark (1- eshell-last-input-end) t)) (push-mark (1- eshell-last-input-end) t))
(custom-add-option 'eshell-pre-command-hook 'eshell-push-command-mark) (custom-add-option 'eshell-pre-command-hook #'eshell-push-command-mark)
(defsubst eshell-goto-input-start () (defsubst eshell-goto-input-start ()
"Goto the start of the last command input. "Goto the start of the last command input.
...@@ -551,7 +553,7 @@ Putting this function on `eshell-pre-command-hook' will mimic Plan 9's ...@@ -551,7 +553,7 @@ Putting this function on `eshell-pre-command-hook' will mimic Plan 9's
9term behavior." 9term behavior."
(goto-char eshell-last-input-start)) (goto-char eshell-last-input-start))
(custom-add-option 'eshell-pre-command-hook 'eshell-goto-input-start) (custom-add-option 'eshell-pre-command-hook #'eshell-goto-input-start)
(defsubst eshell-interactive-print (string) (defsubst eshell-interactive-print (string)
"Print STRING to the eshell display buffer." "Print STRING to the eshell display buffer."
...@@ -1021,4 +1023,5 @@ This function could be in the list `eshell-output-filter-functions'." ...@@ -1021,4 +1023,5 @@ This function could be in the list `eshell-output-filter-functions'."
(custom-add-option 'eshell-output-filter-functions (custom-add-option 'eshell-output-filter-functions
'eshell-handle-ansi-color) 'eshell-handle-ansi-color)
(provide 'esh-mode)
;;; esh-mode.el ends here ;;; esh-mode.el ends here
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
;;; Code: ;;; Code:
(provide 'esh-module)
(require 'eshell)
(require 'esh-util) (require 'esh-util)
(defgroup eshell-module nil (defgroup eshell-module nil
...@@ -101,4 +98,5 @@ customization group. Example: `eshell-cmpl' for that module." ...@@ -101,4 +98,5 @@ customization group. Example: `eshell-cmpl' for that module."
(unload-feature module) (unload-feature module)
(message "Unloading %s...done" (symbol-name module)))))) (message "Unloading %s...done" (symbol-name module))))))
(provide 'esh-module)
;;; esh-module.el ends here ;;; esh-module.el ends here
...@@ -23,9 +23,6 @@ ...@@ -23,9 +23,6 @@
;;; Code: ;;; Code:
(provide 'esh-opt)
(require 'esh-ext)
;; Unused.