diff --git a/helpers.lisp b/helpers.lisp index bd43aa7c6e697dd0c02c800b7646d0cdc47203d0..58364f487304b446576f061215e430adee1618f0 100644 --- a/helpers.lisp +++ b/helpers.lisp @@ -83,12 +83,13 @@ a `call-next-hook` to its caller as it is the content of the rendered page. " - `(progn - (defun ,name (,@args next-hooks) - (flet ((call-next-hook (content context) - (funcall (pop next-hooks) content context next-hooks))) - ,@body)) - (push (function ,name) *render-hooks*))) + (let ((next-hooks-sym (gensym))) + `(progn + (defun ,name (,@args ,next-hooks-sym) + (flet ((call-next-hook (content context) + (funcall (pop ,next-hooks-sym) content context ,next-hooks-sym))) + ,@body)) + (push (function ,name) *render-hooks*)))) (defun render-page-with-hooks (content context) (let ((hooks (reverse (cons #'(lambda (p c next-processors)