# HG changeset patch # User John Wiegley # Date 1125096663 0 # Node ID 2980740e3f1c004de2ccbbd611fdd6df7b145404 # Parent b6ae9d87069a32f8e8f6374b5f5866e10d81dc60 (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 -r b6ae9d87069a -r 2980740e3f1c lisp/eshell/esh-cmd.el --- a/lisp/eshell/esh-cmd.el Fri Aug 26 22:39:49 2005 +0000 +++ b/lisp/eshell/esh-cmd.el Fri Aug 26 22:51:03 2005 +0000 @@ -453,12 +453,14 @@ (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"