+(defmacro gnus--let-eval (bindings evalsym &rest body)
+ "Build an environment in which to evaluate expressions.
+BINDINGS is a `let'-style list of bindings to use for the environment.
+EVALSYM is then bound in BODY to a function that takes a sexp and evaluates
+it in the environment specified by BINDINGS."
+ (declare (indent 2) (debug ((&rest (sym form)) sym body)))
+ (if (eval '(ignore-errors (let ((x 3)) (eq (eval '(- x 1) '((x . 4))) x))))
+ ;; Use lexical vars if possible.
+ `(let* ((env (list ,@(mapcar (lambda (binding)
+ `(cons ',(car binding) ,(cadr binding)))
+ bindings)))
+ (,evalsym (lambda (exp) (eval exp env))))
+ ,@body)
+ `(let (,@bindings (,evalsym #'eval)) ,@body)))
+