;;; esh-cmd.el --- command invocation -*- lexical-binding:t -*-
-;; Copyright (C) 1999-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: John Wiegley <johnw@gnu.org>
hook function should throw it using the tag `eshell-replace-command'.
For example:
- (add-hook 'eshell-named-command-hook 'subst-with-cd)
+ (add-hook \\='eshell-named-command-hook \\='subst-with-cd)
(defun subst-with-cd (command args)
- (throw 'eshell-replace-command
+ (throw \\='eshell-replace-command
(eshell-parse-command \"cd\" args)))
Although useless, the above code will cause any non-glob, non-Lisp
-command (i.e., 'ls' as opposed to '*ls' or '(ls)') to be replaced by a
+command (i.e., `ls' as opposed to `*ls' or `(ls)') to be replaced by a
call to `cd' using the arguments that were passed to the function."
:type 'hook
:group 'eshell-cmd)
"If non-nil, enable Eshell debugging code.
This is slow, and only useful for debugging problems with Eshell.
If you change this without using customize after Eshell has loaded,
-you must re-load 'esh-cmd.el'."
+you must re-load `esh-cmd.el'."
:initialize 'custom-initialize-default
:set (lambda (symbol value)
(set symbol value)
(defvar eshell-command-arguments nil)
(defvar eshell-in-pipeline-p nil
"Internal Eshell variable, non-nil inside a pipeline.
-Has the value 'first, 'last for the first/last commands in the pipeline,
+Has the value `first', `last' for the first/last commands in the pipeline,
otherwise t.")
(defvar eshell-in-subcommand-p nil)
(defvar eshell-last-arguments nil)
(macroexp-progn commands))))
(defun eshell-debug-command (tag subform)
- "Output a debugging message to '*eshell last cmd*'."
+ "Output a debugging message to `*eshell last cmd*'."
(let ((buf (get-buffer-create "*eshell last cmd*"))
(text (eshell-stringify eshell-current-command)))
(with-current-buffer buf
(setq terms (cdr terms))))
(defun eshell-rewrite-sexp-command (terms)
- "Rewrite a sexp in initial position, such as '(+ 1 2)'."
+ "Rewrite a sexp in initial position, such as `(+ 1 2)'."
;; this occurs when a Lisp expression is in first position
(if (and (listp (car terms))
(eq (caar terms) 'eshell-command-to-value))
(car (cdar terms))))
(defun eshell-rewrite-initial-subcommand (terms)
- "Rewrite a subcommand in initial position, such as '{+ 1 2}'."
+ "Rewrite a subcommand in initial position, such as `{+ 1 2}'."
(if (and (listp (car terms))
(eq (caar terms) 'eshell-as-subcommand))
(car terms)))
final))
(defun eshell-parse-subcommand-argument ()
- "Parse a subcommand argument of the form '{command}'."
+ "Parse a subcommand argument of the form `{command}'."
(if (and (not eshell-current-argument)
(not eshell-current-quoted)
(eq (char-after) ?\{)
"Separate TERMS using SEPARATOR.
If REVERSED is non-nil, the list of separated term groups will be
returned in reverse order. If LAST-TERMS-SYM is a symbol, its value
-will be set to a list of all the separator operators found (or '(list
-nil)' if none)."
+will be set to a list of all the separator operators found (or (nil)
+if none)."
(let ((sub-terms (list t))
(eshell-sep-terms (list t))
subchains)
(defmacro eshell-do-pipelines-synchronously (pipeline)
"Execute the commands in PIPELINE in sequence synchronously.
Output of each command is passed as input to the next one in the pipeline.
-This is used on systems where `start-process' is not supported."
+This is used on systems where async subprocesses are not supported."
(when (setq pipeline (cadr pipeline))
`(progn
,(when (cdr pipeline)
"Execute the commands in PIPELINE, connecting each to one another."
`(let ((eshell-in-pipeline-p t) tailproc)
(progn
- ,(if (fboundp 'start-process)
+ ,(if (fboundp 'make-process)
`(eshell-do-pipelines ,pipeline)
`(let ((tail-handles (eshell-create-handles
(car (aref eshell-current-handles
;; we can modify any `let' forms to evaluate only once.
(if (macrop (car form))
(let ((exp (eshell-copy-tree (macroexpand form))))
- (eshell-manipulate (format "expanding macro `%s'"
- (symbol-name (car form)))
+ (eshell-manipulate (format-message "expanding macro `%s'"
+ (symbol-name (car form)))
(setcar form (car exp))
(setcdr form (cdr exp)))))
(let ((args (cdr form)))
(t
(if (and args (not (memq (car form) '(run-hooks))))
(eshell-manipulate
- (format "evaluating arguments to `%s'"
- (symbol-name (car form)))
+ (format-message "evaluating arguments to `%s'"
+ (symbol-name (car form)))
(while args
(setcar args (eshell-do-eval (car args) synchronous-p))
(setq args (cdr args)))))