aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/lisp/eshell/esh-proc-tests.el24
1 files changed, 10 insertions, 14 deletions
diff --git a/test/lisp/eshell/esh-proc-tests.el b/test/lisp/eshell/esh-proc-tests.el
index cf869edbe0c..c1e8800f706 100644
--- a/test/lisp/eshell/esh-proc-tests.el
+++ b/test/lisp/eshell/esh-proc-tests.el
@@ -196,22 +196,18 @@ pipeline."
196;; against; that way, users don't need to have GNU coreutils (or 196;; against; that way, users don't need to have GNU coreutils (or
197;; similar) installed. 197;; similar) installed.
198 198
199;; This is needed because system shell quoting semantics is not relevant
200;; when Eshell is the shell.
201(defun esh-proc-test-quote-argument (argument)
202 "Quote ARGUMENT using Posix semantics."
203 (shell-quote-argument argument t))
204
199(defsubst esh-proc-test/emacs-command (command) 205(defsubst esh-proc-test/emacs-command (command)
200 "Evaluate COMMAND in a new Emacs batch instance." 206 "Evaluate COMMAND in a new Emacs batch instance."
201 (if (eq system-type 'windows-nt) 207 (mapconcat #'esh-proc-test-quote-argument
202 ;; The MS-Windows implementation of shell-quote-argument is too 208 `(,(expand-file-name invocation-name invocation-directory)
203 ;; much for arguments that already have quotes, so we quote "by 209 "-Q" "--batch" "--eval" ,(prin1-to-string command))
204 ;; hand" here. 210 " "))
205 (concat (shell-quote-argument
206 (expand-file-name invocation-name invocation-directory))
207 " -Q --batch --eval "
208 "\""
209 (string-replace "\"" "\\\"" (prin1-to-string command))
210 "\"")
211 (mapconcat #'shell-quote-argument
212 `(,(expand-file-name invocation-name invocation-directory)
213 "-Q" "--batch" "--eval" ,(prin1-to-string command))
214 " ")))
215 211
216(defvar esh-proc-test/emacs-echo 212(defvar esh-proc-test/emacs-echo
217 (esh-proc-test/emacs-command '(princ "hello\n")) 213 (esh-proc-test/emacs-command '(princ "hello\n"))