]> git.eshelyaron.com Git - emacs.git/commitdiff
Rename shell-split-string to split-string-shell-command
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 15 Jul 2021 08:29:04 +0000 (10:29 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 15 Jul 2021 08:29:04 +0000 (10:29 +0200)
* lisp/shell.el (split-string-shell-command):
* doc/lispref/processes.texi (Shell Arguments): Rename from
shell-split-string.

doc/lispref/processes.texi
etc/NEWS
lisp/shell.el
test/lisp/shell-tests.el

index c8e9f0cea6e21b0c669a77e7df481afcfd8adf67..90c42156372f094ff11fb90930f778d748dd88eb 100644 (file)
@@ -247,12 +247,12 @@ protected by @code{shell-quote-argument};
 @code{combine-and-quote-strings} is @emph{not} intended to protect
 special characters from shell evaluation.
 
-@defun shell-split-string string
+@defun split-string-shell-command string
 This function splits @var{string} into substrings, respecting double
 and single quotes, as well as backslash quoting.
 
 @smallexample
-(shell-split-string "ls /tmp/'foo bar'")
+(split-string-shell-command "ls /tmp/'foo bar'")
      @result{} ("ls" "/tmp/foo bar")
 @end smallexample
 @end defun
index 29c2d9db73f3c44e5d8be880d02097cd4424e16c..7388a0f625180d6484ec22ed41b00e7dc41a6dae 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2971,7 +2971,7 @@ The former is now declared obsolete.
 * Lisp Changes in Emacs 28.1
 
 +++
-*** New function 'shell-split-string'.
+*** New function 'split-string-shell-command'.
 This splits a shell string into separate components, respecting single
 and double quotes, as well as backslash quoting.
 
index 15783bb924629af533a724d5acc57eeaaaac6853..5444b5837c259a566451f58ad02ecef13b76c7f6 100644 (file)
@@ -459,7 +459,7 @@ Useful for shells like zsh that has this feature."
           (push (mapconcat #'identity (nreverse arg) "") args)))
       (cons (nreverse args) (nreverse begins)))))
 
-(defun shell-split-string (string)
+(defun split-string-shell-command (string)
   "Split STRING (a shell command) into a list of strings.
 General shell syntax, like single and double quoting, as well as
 backslash quoting, is respected."
index ad54644e55684abcaba8f8905bba9eb96f795e1c..1e5de71ad79023191b1f525a0cf9881fe03eae49 100644 (file)
                    '(("cd" "ba" "") 1 4 7)))))
 
 (ert-deftest shell-tests-split-string ()
-  (should (equal (shell-split-string "ls /tmp")
+  (should (equal (split-string-shell-command "ls /tmp")
                  '("ls" "/tmp")))
-  (should (equal (shell-split-string "ls '/tmp/foo bar'")
+  (should (equal (split-string-shell-command "ls '/tmp/foo bar'")
                  '("ls" "/tmp/foo bar")))
-  (should (equal (shell-split-string "ls \"/tmp/foo bar\"")
+  (should (equal (split-string-shell-command "ls \"/tmp/foo bar\"")
                  '("ls" "/tmp/foo bar")))
-  (should (equal (shell-split-string "ls /tmp/'foo bar'")
+  (should (equal (split-string-shell-command "ls /tmp/'foo bar'")
                  '("ls" "/tmp/foo bar")))
-  (should (equal (shell-split-string "ls /tmp/'foo\\ bar'")
+  (should (equal (split-string-shell-command "ls /tmp/'foo\\ bar'")
                  '("ls" "/tmp/foo\\ bar")))
-  (should (equal (shell-split-string "ls /tmp/foo\\ bar")
+  (should (equal (split-string-shell-command "ls /tmp/foo\\ bar")
                  '("ls" "/tmp/foo bar"))))
 
 ;;; shell-tests.el ends here