[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master cf2e832: Rename slice-string to string-slice
From: |
Lars Ingebrigtsen |
Subject: |
master cf2e832: Rename slice-string to string-slice |
Date: |
Mon, 21 Dec 2020 14:19:07 -0500 (EST) |
branch: master
commit cf2e8321850f81d9eb0ebc23a4887f12dc3dbfac
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Rename slice-string to string-slice
* lisp/emacs-lisp/subr-x.el (string-slice): Rename from slice-string.
* doc/lispref/strings.texi (Creating Strings): Ditto.
---
doc/lispref/strings.texi | 4 ++--
etc/NEWS | 2 +-
lisp/emacs-lisp/shortdoc.el | 6 +++---
lisp/emacs-lisp/subr-x.el | 2 +-
test/lisp/emacs-lisp/subr-x-tests.el | 10 +++++-----
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 958ae4c..c65d839 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
usual value is @w{@code{"[ \f\t\n\r\v]+"}}.
@end defvar
-@defun slice-string string regexp
+@defun string-slice string regexp
Split @var{string} into a list of strings on @var{regexp} boundaries.
As opposed to @code{split-string}, the boundaries are included in the
result set:
@example
-(slice-string " two words " " +")
+(string-slice " two words " " +")
@result{} (" two" " words" " ")
@end example
@end defun
diff --git a/etc/NEWS b/etc/NEWS
index 9b4fcd9..1d50555 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1443,7 +1443,7 @@ that makes it a valid button.
+++
*** A number of new string manipulation functions have been added.
'string-clean-whitespace', 'string-fill', 'string-limit',
-'string-limit', 'string-pad' and 'slice-string'.
+'string-limit', 'string-pad' and 'string-slice'.
+++
*** New variable 'current-minibuffer-command'.
diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index 3e1476a..df31b0a 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."
:eval (split-string "foo bar")
:eval (split-string "|foo|bar|" "|")
:eval (split-string "|foo|bar|" "|" t))
- (slice-string
- :eval (slice-string "foo-bar" "-")
- :eval (slice-string "foo-bar--zot-" "-+"))
+ (string-slice
+ :eval (string-slice "foo-bar" "-")
+ :eval (string-slice "foo-bar--zot-" "-+"))
(string-lines
:eval (string-lines "foo\n\nbar")
:eval (string-lines "foo\n\nbar" t))
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 250ba6e..db7e75d 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."
If OMIT-NULLS, empty lines will be removed from the results."
(split-string string "\n" omit-nulls))
-(defun slice-string (string regexp)
+(defun string-slice (string regexp)
"Split STRING at REGEXP boundaries and return a list of slices.
The boundaries that match REGEXP are not omitted from the results."
(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 94ff459..6ed06d4 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -602,11 +602,11 @@
(should (equal (string-lines "foo") '("foo")))
(should (equal (string-lines "foo \nbar") '("foo " "bar"))))
-(ert-deftest subr-slice-string ()
- (should (equal (slice-string "foo-bar" "-") '("foo" "-bar")))
- (should (equal (slice-string "foo-bar-" "-") '("foo" "-bar" "-")))
- (should (equal (slice-string "-foo-bar-" "-") '("-foo" "-bar" "-")))
- (should (equal (slice-string "ooo" "lala") '("ooo"))))
+(ert-deftest subr-string-slice ()
+ (should (equal (string-slice "foo-bar" "-") '("foo" "-bar")))
+ (should (equal (string-slice "foo-bar-" "-") '("foo" "-bar" "-")))
+ (should (equal (string-slice "-foo-bar-" "-") '("-foo" "-bar" "-")))
+ (should (equal (string-slice "ooo" "lala") '("ooo"))))
(ert-deftest subr-string-pad ()
(should (equal (string-pad "foo" 5) "foo "))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master cf2e832: Rename slice-string to string-slice,
Lars Ingebrigtsen <=