diff options
| author | Mattias EngdegÄrd | 2019-10-27 09:54:54 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-10-27 09:54:54 +0100 |
| commit | cbd439e785cd1e72c3eae39ed987fda357014bf8 (patch) | |
| tree | 4a10729f3ce701b2d4827259d2bedcb1bcb21cd8 /lisp | |
| parent | 6e66d9a95c49f867da26ca897635f5e57561d0c7 (diff) | |
| download | emacs-cbd439e785cd1e72c3eae39ed987fda357014bf8.tar.gz emacs-cbd439e785cd1e72c3eae39ed987fda357014bf8.zip | |
Expand rx definitions inside (not ...)
* lisp/emacs-lisp/rx.el (rx--translate-not):
* test/lisp/emacs-lisp/rx-tests.el (rx-not, rx-def-in-not):
* doc/lispref/searching.texi (Rx Constructs, Extending Rx):
Allow user-defined rx constructs to be expanded inside (not ...)
forms, for better composability (bug#37849).
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/emacs-lisp/rx.el | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index d7677f14443..52a35ffa2a7 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el | |||
| @@ -477,6 +477,9 @@ If NEGATED, negate the sense (thus making it positive)." | |||
| 477 | ((eq arg 'word-boundary) | 477 | ((eq arg 'word-boundary) |
| 478 | (rx--translate-symbol | 478 | (rx--translate-symbol |
| 479 | (if negated 'word-boundary 'not-word-boundary))) | 479 | (if negated 'word-boundary 'not-word-boundary))) |
| 480 | ((let ((expanded (rx--expand-def arg))) | ||
| 481 | (and expanded | ||
| 482 | (rx--translate-not negated (list expanded))))) | ||
| 480 | (t (error "Illegal argument to rx `not': %S" arg))))) | 483 | (t (error "Illegal argument to rx `not': %S" arg))))) |
| 481 | 484 | ||
| 482 | (defun rx--atomic-regexp (item) | 485 | (defun rx--atomic-regexp (item) |