From cf2e8321850f81d9eb0ebc23a4887f12dc3dbfac Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 21 Dec 2020 20:18:57 +0100 Subject: 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. --- lisp/emacs-lisp/shortdoc.el | 6 +++--- lisp/emacs-lisp/subr-x.el | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp/emacs-lisp') 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." :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 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." 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) -- cgit v1.2.3