diff options
| author | Mattias EngdegÄrd | 2019-05-15 22:44:00 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-05-20 11:39:46 +0200 |
| commit | b552fc05c231ca6800330a318d3a74ddd0f5a13c (patch) | |
| tree | 5e030d1bcd878517891180a58d8ba2cec62c1899 /etc | |
| parent | e9f9827eb01a382bead6c180f6703322167e6f89 (diff) | |
| download | emacs-b552fc05c231ca6800330a318d3a74ddd0f5a13c.tar.gz emacs-b552fc05c231ca6800330a318d3a74ddd0f5a13c.zip | |
Allow zero-argument rx `or' and `seq' forms
Make the rx `or' and `seq' forms accept zero arguments to produce a
never-matching regexp and an empty string, respectively.
* lisp/emacs-lisp/rx.el (rx-constituents, rx-or): Permit zero args.
(rx): Amend doc string for `or' and `seq'.
* test/lisp/emacs-lisp/rx-tests.el (rx-or, rx-seq): Test the change.
* etc/NEWS (Changes in Specialized Modes and Packages): Mention the change.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/NEWS | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -1321,6 +1321,12 @@ when given in a string. Previously, '(any "\x80-\xff")' would match | |||
| 1321 | characters U+0080...U+00FF. Now the expression matches raw bytes in | 1321 | characters U+0080...U+00FF. Now the expression matches raw bytes in |
| 1322 | the 128...255 range, as expected. | 1322 | the 128...255 range, as expected. |
| 1323 | 1323 | ||
| 1324 | *** The rx 'or' and 'seq' forms no longer require any arguments. | ||
| 1325 | (or) produces a regexp that never matches anything, while (seq) | ||
| 1326 | matches the empty string, each being an identity for the operation. | ||
| 1327 | This also works for their aliases: '|' for 'or'; ':', 'and' and | ||
| 1328 | 'sequence' for 'seq'. | ||
| 1329 | |||
| 1324 | ** Frames | 1330 | ** Frames |
| 1325 | 1331 | ||
| 1326 | +++ | 1332 | +++ |