bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52954: Rename split-string to string-split


From: Stefan Kangas
Subject: bug#52954: Rename split-string to string-split
Date: Sun, 2 Jan 2022 11:46:37 -0500

Severity: wishlist

The function `split-string' does not follow use the `string-' prefix
that we use for many other string functions.  How about renaming it and
introducing an alias for the old name?

IOW, basically the below and the necessary documentation fixes and so
on:

diff --git a/lisp/subr.el b/lisp/subr.el
index 11105c4aa6..a9bd406b63 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4890,7 +4890,7 @@ split-string-default-separators
 ;; defaulted, OMIT-NULLS should be treated as t.  Simplifying the logical
 ;; expression leads to the equivalent implementation that if SEPARATORS
 ;; is defaulted, OMIT-NULLS is treated as t.
-(defun split-string (string &optional separators omit-nulls trim)
+(defun string-split (string &optional separators omit-nulls trim)
   "Split STRING into substrings bounded by matches for SEPARATORS.

 The beginning and end of STRING, and each match for SEPARATORS, are
@@ -4969,6 +4969,7 @@ split-string
     (funcall push-one)

     (nreverse list)))
+(defalias 'split-string #'string-split) ; renamed in 29.1

 (defun combine-and-quote-strings (strings &optional separator)
   "Concatenate the STRINGS, adding the SEPARATOR (default \" \").





reply via email to

[Prev in Thread] Current Thread [Next in Thread]