summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/rx.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2019-10-07 18:07:16 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2019-10-18 14:45:47 +0200
commite5a446b0a706ddd4bedf973baeaf54f105198b09 (patch)
tree64c299b5c279b8acd257c0a964a4d183c68e8315 /lisp/emacs-lisp/rx.el
parent2d13a3f68d4724af52e47675bedf60709c7b5171 (diff)
downloademacs-e5a446b0a706ddd4bedf973baeaf54f105198b09.tar.gz
Add `anychar' as alias to `anything' in rx (bug#37659)
* lisp/emacs-lisp/rx.el (rx--translate-symbol, rx--builtin-symbols, rx): * test/lisp/emacs-lisp/rx-tests.el (rx-atoms): * doc/lispref/searching.texi (Rx Constructs): * etc/NEWS: Add `anychar', an alias for `anything'. Since `anychar' is more descriptive (and slightly shorter), treat it as the preferred name.
Diffstat (limited to 'lisp/emacs-lisp/rx.el')
-rw-r--r--lisp/emacs-lisp/rx.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 45fec796cc3..6c0b2069302 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -126,7 +126,6 @@ Each entry is:
(get name 'rx-definition)))
;; TODO: Additions to consider:
-;; - A better name for `anything', like `any-char' or `anychar'.
;; - A name for (or), maybe `unmatchable'.
;; - A construct like `or' but without the match order guarantee,
;; maybe `unordered-or'. Useful for composition or generation of
@@ -138,7 +137,7 @@ Each entry is:
;; Use `list' instead of a quoted list to wrap the strings here,
;; since the return value may be mutated.
((or 'nonl 'not-newline 'any) (cons (list ".") t))
- ('anything (rx--translate-form '(or nonl "\n")))
+ ((or 'anychar 'anything) (rx--translate-form '(or nonl "\n")))
((or 'bol 'line-start) (cons (list "^") 'lseq))
((or 'eol 'line-end) (cons (list "$") 'rseq))
((or 'bos 'string-start 'bot 'buffer-start) (cons (list "\\`") t))
@@ -913,7 +912,7 @@ can expand to any number of values."
"List of built-in rx function-like symbols.")
(defconst rx--builtin-symbols
- (append '(nonl not-newline any anything
+ (append '(nonl not-newline any anychar anything
bol eol line-start line-end
bos eos string-start string-end
bow eow word-start word-end
@@ -1016,7 +1015,7 @@ CHAR Match a literal character.
can be (any ...), (syntax ...), (category ...),
or a character class.
not-newline Match any character except a newline. Alias: nonl.
-anything Match any character.
+anychar Match any character. Alias: anything.
CHARCLASS Match a character from a character class. One of:
alpha, alphabetic, letter Alphabetic characters (defined by Unicode).