Function: eshell-maybe-replace-by-alias

eshell-maybe-replace-by-alias is a byte-compiled function defined in em-alias.el.gz.

Signature

(eshell-maybe-replace-by-alias COMMAND ARGS)

Documentation

Call COMMAND's alias definition, if it exists.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/em-alias.el.gz
(defun eshell-maybe-replace-by-alias (command _args)
  "Call COMMAND's alias definition, if it exists."
  (unless (and eshell-prevent-alias-expansion
	       (member command eshell-prevent-alias-expansion))
    (when-let ((alias (eshell-lookup-alias command)))
      (throw 'eshell-replace-command
             `(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)))))))