-
-
Notifications
You must be signed in to change notification settings - Fork 123
Closed
Labels
Description
In order to support this the functions consult--compile-regexp and consult--convert-regexp must be replaced by Orderless/Pcre2el or an alternative more powerful converter.
Lines 593 to 611 in d9e7a6b
| (defun consult--emacs-to-extended-regexp (regexp) | |
| "Convert Emacs REGEXP to extended regexp syntax (ERE). | |
| This function only changes the escaping of parentheses, braces and pipes." | |
| (replace-regexp-in-string | |
| "\\\\\\\\\\|\\\\?[(){}|]" | |
| (lambda (x) | |
| (cond | |
| ((equal x "\\\\") x) | |
| ((= 1 (length x)) (concat "\\\\" x)) | |
| (t (substring x 1)))) | |
| regexp)) | |
| (defun consult--compile-regexp (str type) | |
| "Compile STR to a list of regexps of TYPE." | |
| (setq str (split-string str nil 'omit-nulls)) | |
| (pcase-exhaustive type | |
| ((or 'basic 'emacs) str) | |
| ((or 'lookahead 'extended) | |
| (mapcar #'consult--emacs-to-extended-regexp str)))) |
See also the discussion in #380.