Function: eshell-rewrite-named-command

eshell-rewrite-named-command is a byte-compiled function defined in esh-cmd.el.gz.

Signature

(eshell-rewrite-named-command TERMS)

Documentation

If no other rewriting rule transforms TERMS, assume a named command.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-cmd.el.gz
(defun eshell-rewrite-named-command (terms)
  "If no other rewriting rule transforms TERMS, assume a named command."
  (let ((sym (if eshell-in-pipeline-p
		 'eshell-named-command*
	       'eshell-named-command))
        (grouped-terms (eshell-prepare-splice terms)))
    (cond
     (grouped-terms
      `(let ((terms (nconc ,@grouped-terms)))
         (,sym (car terms) (cdr terms))))
     ;; If no terms are spliced, use a simpler command form.
     ((cdr terms)
      (list sym (car terms) `(list ,@(cdr terms))))
     (t
      (list sym (car terms))))))