diff options
| author | Lars Ingebrigtsen | 2021-03-24 09:22:40 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-03-24 09:22:44 +0100 |
| commit | a4ececf004e5442fc245ccff910000fe407f7212 (patch) | |
| tree | 2e7a3a7e9c290db7382dd5c6093a15db74f47310 /doc/lispref/strings.texi | |
| parent | c0d24d5316626a3d5e76f99a0f418463cb355459 (diff) | |
| download | emacs-a4ececf004e5442fc245ccff910000fe407f7212.tar.gz emacs-a4ececf004e5442fc245ccff910000fe407f7212.zip | |
Move string-trim functions to subr.el
* doc/lispref/strings.texi (Creating Strings): Document them.
* lisp/faces.el: Don't require subr-x, because that leads to build
errors.
* lisp/subr.el (string-trim, string-trim-right)
(string-trim-left): Move here from subr-x.el.
* lisp/emacs-lisp/shortdoc.el (string): Adjust.
Diffstat (limited to 'doc/lispref/strings.texi')
| -rw-r--r-- | doc/lispref/strings.texi | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 5cae939b7bf..b4d7bc729f5 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -390,6 +390,22 @@ whitespace to a single space character, as well as removing all | |||
| 390 | whitespace from the start and the end of @var{string}. | 390 | whitespace from the start and the end of @var{string}. |
| 391 | @end defun | 391 | @end defun |
| 392 | 392 | ||
| 393 | @defun string-trim-left string &optional regexp | ||
| 394 | Remove the leading text that matches @var{regexp} from @var{string}. | ||
| 395 | @var{regexp} defaults to @samp{[ \t\n\r]+}. | ||
| 396 | @end defun | ||
| 397 | |||
| 398 | @defun string-trim-right string &optional regexp | ||
| 399 | Remove the trailing text that matches @var{regexp} from @var{string}. | ||
| 400 | @var{regexp} defaults to @samp{[ \t\n\r]+}. | ||
| 401 | @end defun | ||
| 402 | |||
| 403 | @defun string-trim string &optional trim-left trim-right | ||
| 404 | Remove the leading text that matches @var{trim-left} and trailing text | ||
| 405 | that matches @var{trim-right} from from @var{string}. Both regexps | ||
| 406 | default to @samp{[ \t\n\r]+}. | ||
| 407 | @end defun | ||
| 408 | |||
| 393 | @defun string-fill string length | 409 | @defun string-fill string length |
| 394 | Attempt to Word-wrap @var{string} so that no lines are longer than | 410 | Attempt to Word-wrap @var{string} so that no lines are longer than |
| 395 | @var{length}. Filling is done on whitespace boundaries only. If | 411 | @var{length}. Filling is done on whitespace boundaries only. If |