File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -247,12 +247,12 @@ protected by @code{shell-quote-argument};
247
247
@code {combine-and-quote-strings } is @emph {not } intended to protect
248
248
special characters from shell evaluation.
249
249
250
- @defun shell- split-string string
250
+ @defun split-string-shell-command string
251
251
This function splits @var {string } into substrings, respecting double
252
252
and single quotes, as well as backslash quoting.
253
253
254
254
@smallexample
255
- (shell- split-string "ls /tmp/'foo bar'")
255
+ (split-string-shell-command "ls /tmp/'foo bar'")
256
256
@result {} ("ls" "/tmp/foo bar")
257
257
@end smallexample
258
258
@end defun
Original file line number Diff line number Diff line change @@ -2971,7 +2971,7 @@ The former is now declared obsolete.
2971
2971
* Lisp Changes in Emacs 28.1
2972
2972
2973
2973
+++
2974
- *** New function 'shell- split-string'.
2974
+ *** New function 'split-string-shell-command '.
2975
2975
This splits a shell string into separate components, respecting single
2976
2976
and double quotes, as well as backslash quoting.
2977
2977
Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ Useful for shells like zsh that has this feature."
459
459
(push (mapconcat #'identity (nreverse arg) " " ) args)))
460
460
(cons (nreverse args) (nreverse begins)))))
461
461
462
- (defun shell- split-string (string )
462
+ (defun split-string-shell-command (string )
463
463
" Split STRING (a shell command) into a list of strings.
464
464
General shell syntax, like single and double quoting, as well as
465
465
backslash quoting, is respected."
Original file line number Diff line number Diff line change 46
46
'((" cd" " ba" " " ) 1 4 7 )))))
47
47
48
48
(ert-deftest shell-tests-split-string ()
49
- (should (equal (shell- split-string " ls /tmp" )
49
+ (should (equal (split-string-shell-command " ls /tmp" )
50
50
'(" ls" " /tmp" )))
51
- (should (equal (shell- split-string " ls '/tmp/foo bar'" )
51
+ (should (equal (split-string-shell-command " ls '/tmp/foo bar'" )
52
52
'(" 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\" " )
54
54
'(" 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'" )
56
56
'(" 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'" )
58
58
'(" 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" )
60
60
'(" ls" " /tmp/foo bar" ))))
61
61
62
62
; ;; shell-tests.el ends here
You can’t perform that action at this time.
0 commit comments