From bb746be5638a17c99e1647ecc178e3b9d97e4ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Sun, 18 Oct 2015 14:23:35 +0200 Subject: [PATCH] * lisp/subr.el (shell-quote-argument): Improve documentation. --- lisp/subr.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index c903ee3..e55647b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2713,8 +2713,14 @@ Note: :data and :device are currently not supported on Windows." (defun shell-quote-argument (argument) "Quote ARGUMENT for passing as argument to an inferior shell. -This function is designed to work with the syntax of your system's -standard shell, and might produce incorrect results with unusual shells." +This is safe for shells conforming to POSIX sh. No safety +guarantees are made for other shells, but the standard MS-DOS and +Windows NT shells are supported as well. + +Being safe in this context means that as long as the result is +surrounded by delimiters in the syntax of the respective shell, +it's guaranteed that it will be parsed as one token and that the +value of the token will be exactly ARGUMENT." (cond ((eq system-type 'ms-dos) ;; Quote using double quotes, but escape any existing quotes in -- 2.5.0