aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/strings.texi4
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/emacs-lisp/shortdoc.el6
-rw-r--r--lisp/emacs-lisp/subr-x.el2
-rw-r--r--test/lisp/emacs-lisp/subr-x-tests.el10
5 files changed, 12 insertions, 12 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 958ae4c0a15..c65d839a028 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -381,13 +381,13 @@ The default value of @var{separators} for @code{split-string}. Its
381usual value is @w{@code{"[ \f\t\n\r\v]+"}}. 381usual value is @w{@code{"[ \f\t\n\r\v]+"}}.
382@end defvar 382@end defvar
383 383
384@defun slice-string string regexp 384@defun string-slice string regexp
385Split @var{string} into a list of strings on @var{regexp} boundaries. 385Split @var{string} into a list of strings on @var{regexp} boundaries.
386As opposed to @code{split-string}, the boundaries are included in the 386As opposed to @code{split-string}, the boundaries are included in the
387result set: 387result set:
388 388
389@example 389@example
390(slice-string " two words " " +") 390(string-slice " two words " " +")
391 @result{} (" two" " words" " ") 391 @result{} (" two" " words" " ")
392@end example 392@end example
393@end defun 393@end defun
diff --git a/etc/NEWS b/etc/NEWS
index 9b4fcd92fc1..1d50555c8e1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1443,7 +1443,7 @@ that makes it a valid button.
1443+++ 1443+++
1444*** A number of new string manipulation functions have been added. 1444*** A number of new string manipulation functions have been added.
1445'string-clean-whitespace', 'string-fill', 'string-limit', 1445'string-clean-whitespace', 'string-fill', 'string-limit',
1446'string-limit', 'string-pad' and 'slice-string'. 1446'string-limit', 'string-pad' and 'string-slice'.
1447 1447
1448+++ 1448+++
1449*** New variable 'current-minibuffer-command'. 1449*** New variable 'current-minibuffer-command'.
diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index 3e1476adfc1..df31b0aaf1f 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -151,9 +151,9 @@ There can be any number of :example/:result elements."
151 :eval (split-string "foo bar") 151 :eval (split-string "foo bar")
152 :eval (split-string "|foo|bar|" "|") 152 :eval (split-string "|foo|bar|" "|")
153 :eval (split-string "|foo|bar|" "|" t)) 153 :eval (split-string "|foo|bar|" "|" t))
154 (slice-string 154 (string-slice
155 :eval (slice-string "foo-bar" "-") 155 :eval (string-slice "foo-bar" "-")
156 :eval (slice-string "foo-bar--zot-" "-+")) 156 :eval (string-slice "foo-bar--zot-" "-+"))
157 (string-lines 157 (string-lines
158 :eval (string-lines "foo\n\nbar") 158 :eval (string-lines "foo\n\nbar")
159 :eval (string-lines "foo\n\nbar" t)) 159 :eval (string-lines "foo\n\nbar" t))
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 250ba6e6fa2..db7e75dfd2b 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -301,7 +301,7 @@ a substring consisitng of thelast LENGTH characters of STRING."
301If OMIT-NULLS, empty lines will be removed from the results." 301If OMIT-NULLS, empty lines will be removed from the results."
302 (split-string string "\n" omit-nulls)) 302 (split-string string "\n" omit-nulls))
303 303
304(defun slice-string (string regexp) 304(defun string-slice (string regexp)
305 "Split STRING at REGEXP boundaries and return a list of slices. 305 "Split STRING at REGEXP boundaries and return a list of slices.
306The boundaries that match REGEXP are not omitted from the results." 306The boundaries that match REGEXP are not omitted from the results."
307 (let ((start-substring 0) 307 (let ((start-substring 0)
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el
index 94ff459869c..6ed06d4ce4f 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -602,11 +602,11 @@
602 (should (equal (string-lines "foo") '("foo"))) 602 (should (equal (string-lines "foo") '("foo")))
603 (should (equal (string-lines "foo \nbar") '("foo " "bar")))) 603 (should (equal (string-lines "foo \nbar") '("foo " "bar"))))
604 604
605(ert-deftest subr-slice-string () 605(ert-deftest subr-string-slice ()
606 (should (equal (slice-string "foo-bar" "-") '("foo" "-bar"))) 606 (should (equal (string-slice "foo-bar" "-") '("foo" "-bar")))
607 (should (equal (slice-string "foo-bar-" "-") '("foo" "-bar" "-"))) 607 (should (equal (string-slice "foo-bar-" "-") '("foo" "-bar" "-")))
608 (should (equal (slice-string "-foo-bar-" "-") '("-foo" "-bar" "-"))) 608 (should (equal (string-slice "-foo-bar-" "-") '("-foo" "-bar" "-")))
609 (should (equal (slice-string "ooo" "lala") '("ooo")))) 609 (should (equal (string-slice "ooo" "lala") '("ooo"))))
610 610
611(ert-deftest subr-string-pad () 611(ert-deftest subr-string-pad ()
612 (should (equal (string-pad "foo" 5) "foo ")) 612 (should (equal (string-pad "foo" 5) "foo "))