summaryrefslogtreecommitdiff
path: root/lisp/eshell/em-alias.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-09-12 01:20:07 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-09-12 01:20:07 -0400
commit170266d096bc4d0952bee907532d14503e882bf6 (patch)
tree9c25a5a63af77941b8ee141e275406ed6eb9c27c /lisp/eshell/em-alias.el
parentd3b049e6015c09a2d1ea101e5fb466c6ce9f61e0 (diff)
downloademacs-170266d096bc4d0952bee907532d14503e882bf6.tar.gz
Cleanup Eshell to rely less on dynamic scoping.
* lisp/eshell/esh-opt.el (eshell-eval-using-options): Don't bind usage-msg, last-value, and ext-command here. Bind `args' closer to `body'. (temp-args, last-value, usage-msg, ext-command, args): Don't defvar. (eshell--args): Declare new dynamic var. (eshell-do-opt): Add argument `args'. Bind our own usage-msg, last-value, and ext-command. Pass `args' to `body'. (eshell-process-args): Bind eshell--args. (eshell-set-option): Use eshell--args. * lisp/eshell/eshell.el (eshell): Use derived-mode-p. * lisp/eshell/esh-var.el (eshell-parse-variable): Use backquote. (eshell-parse-variable-ref): Remove unused vars `end' and `err'. (eshell-glob-function): Declare. * lisp/eshell/esh-util.el: Require cl-lib. (eshell-read-hosts-file): Avoid add-to-list. * lisp/eshell/esh-cmd.el (eshell-parse-lisp-argument): Remove unused var `err'. * lisp/eshell/em-unix.el (compilation-scroll-output, locate-history-list): Declare. (eshell/diff): Remove unused var `err'. * lisp/eshell/em-rebind.el (eshell-delete-backward-char): Remove unused arg `killflag'. * lisp/eshell/em-pred.el (eshell-parse-modifiers): Remove unused var `err'. * lisp/eshell/em-ls.el (eshell-ls-highlight-alist): Move defvars before first use. * lisp/eshell/em-glob.el (eshell-glob-matches, message-shown): Move declaration before first use. * lisp/eshell/em-alias.el (eshell-maybe-replace-by-alias): Use backquotes. * autorevert.el (auto-revert-notify-handler): Use `cl-dolist' since we rely on cl-return.
Diffstat (limited to 'lisp/eshell/em-alias.el')
-rw-r--r--lisp/eshell/em-alias.el17
1 files changed, 5 insertions, 12 deletions
diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el
index a46b48c01b3..9a9cc4cd567 100644
--- a/lisp/eshell/em-alias.el
+++ b/lisp/eshell/em-alias.el
@@ -221,18 +221,11 @@ file named by `eshell-aliases-file'.")
(let ((alias (eshell-lookup-alias command)))
(if alias
(throw 'eshell-replace-command
- (list
- 'let
- (list
- (list 'eshell-command-name
- (list 'quote eshell-last-command-name))
- (list 'eshell-command-arguments
- (list 'quote eshell-last-arguments))
- (list 'eshell-prevent-alias-expansion
- (list 'quote
- (cons command
- eshell-prevent-alias-expansion))))
- (eshell-parse-command (nth 1 alias))))))))
+ `(let ((eshell-command-name ',eshell-last-command-name)
+ (eshell-command-arguments ',eshell-last-arguments)
+ (eshell-prevent-alias-expansion
+ ',(cons command eshell-prevent-alias-expansion)))
+ ,(eshell-parse-command (nth 1 alias))))))))
(defun eshell-alias-completions (name)
"Find all possible completions for NAME.