aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell
diff options
context:
space:
mode:
authorJohn Wiegley <[email protected]>2005-08-26 22:51:03 +0000
committerJohn Wiegley <[email protected]>2005-08-26 22:51:03 +0000
commitf4dd136182ff83c1150d7c6869732119acf93319 (patch)
tree5371d4edc046f04540816acd941f94a0c97f4369 /lisp/eshell
parent35595517d23d675a509e843f988544930c2725c4 (diff)
(eshell-rewrite-named-command): Changed the code around a bit so that
an extraneous nil argument is not added to a command when no args are given.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/esh-cmd.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index d396908d8a..e655a87f89 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -453,12 +453,14 @@ hooks should be run before and after the command."
(defun eshell-rewrite-named-command (terms)
"If no other rewriting rule transforms TERMS, assume a named command."
- (list (if eshell-in-pipeline-p
- 'eshell-named-command*
- 'eshell-named-command)
- (car terms)
- (and (cdr terms)
- (append (list 'list) (cdr terms)))))
+ (let ((sym (if eshell-in-pipeline-p
+ 'eshell-named-command*
+ 'eshell-named-command))
+ (cmd (car terms))
+ (args (cdr terms)))
+ (if args
+ (list sym cmd (append (list 'list) (cdr terms)))
+ (list sym cmd))))
(eshell-deftest cmd named-command
"Execute named command"