- ;; If a command desire to replace its execution form with
- ;; another command form, all it needs to do is throw the
- ;; new form using the exception tag
- ;; `eshell-replace-command'. For example, let's say that
- ;; the form currently being eval'd is:
- ;;
- ;; (eshell-named-command \"hello\")
- ;;
- ;; Now, let's assume the 'hello' command is an Eshell
- ;; alias, the definition of which yields the command:
- ;;
- ;; (eshell-named-command \"echo\" (list \"Hello\" \"world\"))
- ;;
- ;; What the alias code would like to do is simply
- ;; substitute the alias form for the original form. To
- ;; accomplish this, all it needs to do is to throw the
- ;; substitution form with the `eshell-replace-command'
- ;; tag, and the form will be replaced within the current
- ;; command, and execution will then resume (iteratively)
- ;; as before. Thus, aliases can even contain references
- ;; to asynchronous sub-commands, and things will still
- ;; work out as they should.