diff options
| author | Xue Fuqiao | 2013-12-23 15:55:08 +0800 |
|---|---|---|
| committer | Xue Fuqiao | 2013-12-23 15:55:08 +0800 |
| commit | 46291d111fe5c915099ab38cc54b07ebc82bcea0 (patch) | |
| tree | 8276a069562c5b126c14870da639b5435ef05070 | |
| parent | 7510b0219cb36b49032393c5295f14efd0c8df2f (diff) | |
| download | emacs-46291d111fe5c915099ab38cc54b07ebc82bcea0.tar.gz emacs-46291d111fe5c915099ab38cc54b07ebc82bcea0.zip | |
Document TRIM in `split-string'.
* doc/lispref/strings.texi (Creating Strings): Document TRIM in
`split-string'.
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 7 | ||||
| -rw-r--r-- | etc/NEWS | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index aae5a1a6cc2..c598cf0f5aa 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-12-23 Xue Fuqiao <xfq.free@gmail.com> | ||
| 2 | |||
| 3 | * strings.texi (Creating Strings): Document TRIM in `split-string'. | ||
| 4 | |||
| 1 | 2013-12-23 Chong Yidong <cyd@gnu.org> | 5 | 2013-12-23 Chong Yidong <cyd@gnu.org> |
| 2 | 6 | ||
| 3 | * keymaps.texi (Controlling Active Maps): Renamed | 7 | * keymaps.texi (Controlling Active Maps): Renamed |
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 340115062f9..0fe319d97fb 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -268,7 +268,7 @@ string to be used as a shell command, see @ref{Shell Arguments, | |||
| 268 | combine-and-quote-strings}. | 268 | combine-and-quote-strings}. |
| 269 | @end defun | 269 | @end defun |
| 270 | 270 | ||
| 271 | @defun split-string string &optional separators omit-nulls | 271 | @defun split-string string &optional separators omit-nulls trim |
| 272 | This function splits @var{string} into substrings based on the regular | 272 | This function splits @var{string} into substrings based on the regular |
| 273 | expression @var{separators} (@pxref{Regular Expressions}). Each match | 273 | expression @var{separators} (@pxref{Regular Expressions}). Each match |
| 274 | for @var{separators} defines a splitting point; the substrings between | 274 | for @var{separators} defines a splitting point; the substrings between |
| @@ -350,6 +350,11 @@ practice: | |||
| 350 | @result{} ("o" "o" "o") | 350 | @result{} ("o" "o" "o") |
| 351 | @end example | 351 | @end example |
| 352 | 352 | ||
| 353 | If the optional argument @var{trim} is non-@code{nil}, it should be a | ||
| 354 | regular expression to match text to trim from the beginning and end of | ||
| 355 | each substring. If trimming makes the substring empty, it is treated | ||
| 356 | as null. | ||
| 357 | |||
| 353 | If you need to split a string into a list of individual command-line | 358 | If you need to split a string into a list of individual command-line |
| 354 | arguments suitable for @code{call-process} or @code{start-process}, | 359 | arguments suitable for @code{call-process} or @code{start-process}, |
| 355 | see @ref{Shell Arguments, split-string-and-unquote}. | 360 | see @ref{Shell Arguments, split-string-and-unquote}. |
| @@ -983,6 +983,7 @@ The few hooks that used with-wrapper-hook are replaced as follows: | |||
| 983 | ** `byte-compile-interactive-only-functions' is now obsolete. | 983 | ** `byte-compile-interactive-only-functions' is now obsolete. |
| 984 | It has been replaced by the symbol property 'interactive-only. | 984 | It has been replaced by the symbol property 'interactive-only. |
| 985 | 985 | ||
| 986 | +++ | ||
| 986 | ** `split-string' now takes an optional argument TRIM. | 987 | ** `split-string' now takes an optional argument TRIM. |
| 987 | The value, if non-nil, is a regexp that specifies what to trim from | 988 | The value, if non-nil, is a regexp that specifies what to trim from |
| 988 | the start and end of each substring. | 989 | the start and end of each substring. |