diff options
| author | Mattias EngdegÄrd | 2019-10-22 15:35:40 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-10-22 15:37:51 +0200 |
| commit | 0e9d92146e3d4e5da597c3d1400cb31f58e19374 (patch) | |
| tree | 7ec8bfa683071701184f56abf8f7cb6df3b28131 | |
| parent | 7f5d92e64326173b9d2d14567739390320403ec8 (diff) | |
| download | emacs-0e9d92146e3d4e5da597c3d1400cb31f58e19374.tar.gz emacs-0e9d92146e3d4e5da597c3d1400cb31f58e19374.zip | |
rx doc string tweaks
* lisp/emacs-lisp/rx.el (rx--translate-seq, rx--translate-or, rx):
Say "zero or more" instead of "one or more" where applicable.
| -rw-r--r-- | lisp/emacs-lisp/rx.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 006a393921a..2370948e81b 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el | |||
| @@ -210,7 +210,8 @@ each on the form (REGEXP . PRECEDENCE), returning (REGEXP . PRECEDENCE)." | |||
| 210 | 'seq))))))) ; seq ++ seq | 210 | 'seq))))))) ; seq ++ seq |
| 211 | 211 | ||
| 212 | (defun rx--translate-seq (body) | 212 | (defun rx--translate-seq (body) |
| 213 | "Translate a sequence of one or more rx items. Return (REGEXP . PRECEDENCE)." | 213 | "Translate a sequence of zero or more rx items. |
| 214 | Return (REGEXP . PRECEDENCE)." | ||
| 214 | (if body | 215 | (if body |
| 215 | (let* ((items (mapcar #'rx--translate body)) | 216 | (let* ((items (mapcar #'rx--translate body)) |
| 216 | (result (car items))) | 217 | (result (car items))) |
| @@ -231,7 +232,7 @@ each on the form (REGEXP . PRECEDENCE), returning (REGEXP . PRECEDENCE)." | |||
| 231 | (null list)) | 232 | (null list)) |
| 232 | 233 | ||
| 233 | (defun rx--translate-or (body) | 234 | (defun rx--translate-or (body) |
| 234 | "Translate an or-pattern of one of more rx items. | 235 | "Translate an or-pattern of zero or more rx items. |
| 235 | Return (REGEXP . PRECEDENCE)." | 236 | Return (REGEXP . PRECEDENCE)." |
| 236 | ;; FIXME: Possible improvements: | 237 | ;; FIXME: Possible improvements: |
| 237 | ;; | 238 | ;; |
| @@ -982,7 +983,7 @@ For extending the `rx' notation in FORM, use `rx-define' or `rx-let-eval'." | |||
| 982 | (defmacro rx (&rest regexps) | 983 | (defmacro rx (&rest regexps) |
| 983 | "Translate regular expressions REGEXPS in sexp form to a regexp string. | 984 | "Translate regular expressions REGEXPS in sexp form to a regexp string. |
| 984 | Each argument is one of the forms below; RX is a subform, and RX... stands | 985 | Each argument is one of the forms below; RX is a subform, and RX... stands |
| 985 | for one or more RXs. For details, see Info node `(elisp) Rx Notation'. | 986 | for zero or more RXs. For details, see Info node `(elisp) Rx Notation'. |
| 986 | See `rx-to-string' for the corresponding function. | 987 | See `rx-to-string' for the corresponding function. |
| 987 | 988 | ||
| 988 | STRING Match a literal string. | 989 | STRING Match a literal string. |