• Mattias Engdegård's avatar
    rx: Improve 'or' compositionality (bug#37659) · 49d3cd90
    Mattias Engdegård authored
    Perform 'regexp-opt' on nested 'or' forms, and after expansion of
    user-defined and 'eval' forms.  Characters are now turned into strings
    for wider 'regexp-opt' scope.  This preserves the longest-match
    semantics for string in 'or' forms over composition.
    * doc/lispref/searching.texi (Rx Constructs): Document.
    * lisp/emacs-lisp/rx.el (rx--normalise-or-arg)
    (rx--all-string-or-args): New.
    (rx--translate-or): Normalise arguments first, and check for strings
    in subforms.
    (rx--expand-eval): Extracted from rx--translate-eval.
    (rx--translate-eval): Call rx--expand-eval.
    * test/lisp/emacs-lisp/rx-tests.el (rx-or, rx-def-in-or): Add tests.
    * etc/NEWS: Announce.
searching.texi 106 KB