The following works:
(rx-let ((headers (? (or "From" "To" "Cc") ":"))) (list "mail.amazon" (rx bol headers anything "amazon" anything) ;; ("mail.amazon" "^\\(?:\\(?:Cc\\|From\\|To\\):\\)?[^z-a]amazon[^z-a]") )) But the following fails:
(rx-let ((headers (bol (or "From" "To" "Cc") ":"))) (list "mail.amazon" (rx headers anything "amazon" anything) ;; rx--translate-form: Unknown rx form ‘bol’ )) Why is rx-let having issues with rx forms like bol? I've also tried its alias, line-start, but the result was the same.
rx-letbinds a singlerxform to a name.(? ...)is a single form (?takes any number ofrxforms as arguments), but(bol ...)is not a validrxform (bolis anrxform of its own, without taking an argument list). Try(: bol ...),(seq bol ...), or similar instead.