Skip to content

Commit 28e7b51

Browse files
committed
Rename shell-split-string to split-string-shell-command
* lisp/shell.el (split-string-shell-command): * doc/lispref/processes.texi (Shell Arguments): Rename from shell-split-string.
1 parent 4fb6cf3 commit 28e7b51

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

doc/lispref/processes.texi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ protected by @code{shell-quote-argument};
247247
@code{combine-and-quote-strings} is @emph{not} intended to protect
248248
special characters from shell evaluation.
249249

250-
@defun shell-split-string string
250+
@defun split-string-shell-command string
251251
This function splits @var{string} into substrings, respecting double
252252
and single quotes, as well as backslash quoting.
253253

254254
@smallexample
255-
(shell-split-string "ls /tmp/'foo bar'")
255+
(split-string-shell-command "ls /tmp/'foo bar'")
256256
@result{} ("ls" "/tmp/foo bar")
257257
@end smallexample
258258
@end defun

etc/NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2971,7 +2971,7 @@ The former is now declared obsolete.
29712971
* Lisp Changes in Emacs 28.1
29722972

29732973
+++
2974-
*** New function 'shell-split-string'.
2974+
*** New function 'split-string-shell-command'.
29752975
This splits a shell string into separate components, respecting single
29762976
and double quotes, as well as backslash quoting.
29772977

lisp/shell.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ Useful for shells like zsh that has this feature."
459459
(push (mapconcat #'identity (nreverse arg) "") args)))
460460
(cons (nreverse args) (nreverse begins)))))
461461

462-
(defun shell-split-string (string)
462+
(defun split-string-shell-command (string)
463463
"Split STRING (a shell command) into a list of strings.
464464
General shell syntax, like single and double quoting, as well as
465465
backslash quoting, is respected."

test/lisp/shell-tests.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@
4646
'(("cd" "ba" "") 1 4 7)))))
4747

4848
(ert-deftest shell-tests-split-string ()
49-
(should (equal (shell-split-string "ls /tmp")
49+
(should (equal (split-string-shell-command "ls /tmp")
5050
'("ls" "/tmp")))
51-
(should (equal (shell-split-string "ls '/tmp/foo bar'")
51+
(should (equal (split-string-shell-command "ls '/tmp/foo bar'")
5252
'("ls" "/tmp/foo bar")))
53-
(should (equal (shell-split-string "ls \"/tmp/foo bar\"")
53+
(should (equal (split-string-shell-command "ls \"/tmp/foo bar\"")
5454
'("ls" "/tmp/foo bar")))
55-
(should (equal (shell-split-string "ls /tmp/'foo bar'")
55+
(should (equal (split-string-shell-command "ls /tmp/'foo bar'")
5656
'("ls" "/tmp/foo bar")))
57-
(should (equal (shell-split-string "ls /tmp/'foo\\ bar'")
57+
(should (equal (split-string-shell-command "ls /tmp/'foo\\ bar'")
5858
'("ls" "/tmp/foo\\ bar")))
59-
(should (equal (shell-split-string "ls /tmp/foo\\ bar")
59+
(should (equal (split-string-shell-command "ls /tmp/foo\\ bar")
6060
'("ls" "/tmp/foo bar"))))
6161

6262
;;; shell-tests.el ends here

0 commit comments

Comments
 (0)