rx is a macro so it doesn't see runtime bindings, using let-when-compile (new in Emacs 25) works: (let-when-compile ((page-name "the page")) (rx "[[" (eval page-name) "]]")) Not sure if the plain let case can/should be fixed.