From: John Wiegley Date: Fri, 26 Aug 2005 22:51:03 +0000 (+0000) Subject: (eshell-rewrite-named-command): Changed the code around a bit so that X-Git-Tag: emacs-pretest-22.0.90~7416 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f4dd136182ff83c1150d7c6869732119acf93319;p=emacs.git (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. --- diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index d396908d8a6..e655a87f898 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"