summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-var.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/esh-var.el
parenta20845c160de2ba9f42b3af714d770df502d0577 (diff)
downloademacs-0d5e83611e5157800fd855fe8e3f60c8eff0af7c.tar.gz
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/esh-var.el')
-rw-r--r--lisp/eshell/esh-var.el19
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index d8be72e3596..82e0f7135ba 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -105,11 +105,12 @@
;;; Code:
-(provide 'esh-var)
-
(require 'esh-util)
(require 'esh-cmd)
(require 'esh-opt)
+(require 'esh-module)
+(require 'esh-arg)
+(require 'esh-io)
(require 'pcomplete)
(require 'env)
@@ -206,6 +207,9 @@ function), and the arguments passed to this function would be the list
(set (make-local-variable 'process-environment)
(eshell-copy-environment)))
+ ;; This is supposedly run after enabling esh-mode, when eshell-command-map
+ ;; already exists.
+ (defvar eshell-command-map)
(define-key eshell-command-map [(meta ?v)] 'eshell-insert-envvar)
(set (make-local-variable 'eshell-special-chars-inside-quoting)
@@ -213,16 +217,16 @@ function), and the arguments passed to this function would be the list
(set (make-local-variable 'eshell-special-chars-outside-quoting)
(append eshell-special-chars-outside-quoting '(?$)))
- (add-hook 'eshell-parse-argument-hook 'eshell-interpolate-variable t t)
+ (add-hook 'eshell-parse-argument-hook #'eshell-interpolate-variable t t)
(add-hook 'eshell-prepare-command-hook
- 'eshell-handle-local-variables nil t)
+ #'eshell-handle-local-variables nil t)
(when (eshell-using-module 'eshell-cmpl)
(add-hook 'pcomplete-try-first-hook
- 'eshell-complete-variable-reference nil t)
+ #'eshell-complete-variable-reference nil t)
(add-hook 'pcomplete-try-first-hook
- 'eshell-complete-variable-assignment nil t)))
+ #'eshell-complete-variable-assignment nil t)))
(defun eshell-handle-local-variables ()
"Allow for the syntax `VAR=val <command> <args>'."
@@ -532,7 +536,7 @@ For example, to retrieve the second element of a user's record in
(setq separator (caar indices)
refs (cdr refs)))
(setq value
- (mapcar 'eshell-convert
+ (mapcar #'eshell-convert
(split-string value separator)))))
(cond
((< (length refs) 0)
@@ -618,4 +622,5 @@ For example, to retrieve the second element of a user's record in
(setq pcomplete-stub (substring arg pos))
(throw 'pcomplete-completions (pcomplete-entries)))))
+(provide 'esh-var)
;;; esh-var.el ends here