]> git.eshelyaron.com Git - emacs.git/commitdiff
Document TRIM in `split-string'.
authorXue Fuqiao <xfq.free@gmail.com>
Mon, 23 Dec 2013 07:55:08 +0000 (15:55 +0800)
committerXue Fuqiao <xfq.free@gmail.com>
Mon, 23 Dec 2013 07:55:08 +0000 (15:55 +0800)
* doc/lispref/strings.texi (Creating Strings): Document TRIM in
`split-string'.

doc/lispref/ChangeLog
doc/lispref/strings.texi
etc/NEWS

index aae5a1a6cc216f215ccbe63ab91d8305e7f95762..c598cf0f5aa5e25efb7d9e08dc10d3ffd2fc5c50 100644 (file)
@@ -1,3 +1,7 @@
+2013-12-23  Xue Fuqiao  <xfq.free@gmail.com>
+
+       * strings.texi (Creating Strings): Document TRIM in `split-string'.
+
 2013-12-23  Chong Yidong  <cyd@gnu.org>
 
        * keymaps.texi (Controlling Active Maps): Renamed
index 340115062f92a676d12b7b01b2e98b0e0697ce9d..0fe319d97fbacee9a4a3b81c5755a72e7c3c2ab4 100644 (file)
@@ -268,7 +268,7 @@ string to be used as a shell command, see @ref{Shell Arguments,
 combine-and-quote-strings}.
 @end defun
 
-@defun split-string string &optional separators omit-nulls
+@defun split-string string &optional separators omit-nulls trim
 This function splits @var{string} into substrings based on the regular
 expression @var{separators} (@pxref{Regular Expressions}).  Each match
 for @var{separators} defines a splitting point; the substrings between
@@ -350,6 +350,11 @@ practice:
      @result{} ("o" "o" "o")
 @end example
 
+If the optional argument @var{trim} is non-@code{nil}, it should be a
+regular expression to match text to trim from the beginning and end of
+each substring.  If trimming makes the substring empty, it is treated
+as null.
+
 If you need to split a string into a list of individual command-line
 arguments suitable for @code{call-process} or @code{start-process},
 see @ref{Shell Arguments, split-string-and-unquote}.
index 0496e0d87780a0fae04f267f9c5e9af26dcaded8..2b5644a2827f4bde0d11bcf14538ae8b2d4dba81 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -983,6 +983,7 @@ The few hooks that used with-wrapper-hook are replaced as follows:
 ** `byte-compile-interactive-only-functions' is now obsolete.
 It has been replaced by the symbol property 'interactive-only.
 
++++
 ** `split-string' now takes an optional argument TRIM.
 The value, if non-nil, is a regexp that specifies what to trim from
 the start and end of each substring.