The patch works! Thank you.

On Sun, Nov 8, 2026 at 3:43 AM Paul Bryan <[email protected]> wrote:

> CONFIRMED.
>
> Here's a patch to fix it.
>
> > Consider this code block:
> >
> > ,#+begin_src emacs-lisp :prologue "(setq foo t)"
> > (if (and (boundp 'foo) foo)
> > "foo is set"
> > "foo is NOT set")
> > ,#+end_src
> >
> > When run it produces:
> >
> > ,#+RESULTS:
> > : foo is NOT set
> >
> > which is odd, because the prologue is supposed to set foo. Now try this
> > one:
> >
> > ,#+begin_src emacs-lisp :prologue "(setq foo t)" :var dummy=()
> > (if (and (boundp 'foo) foo)
> > "foo is set"
> > "foo is NOT set")
> > ,#+end_src
> >
> > This time it produces "foo is set", which is what I expected to happen.
> >
> > I believe this is due to the following code in
> > org-babel-expand-body:emacs-lisp
> > (line 55 of ob-emacs-lisp.el):
> >
> > (if (null vars) body              ; no variables = no use of
> > prologue/epilogue
> > (format "(let (%s)\n%s%s%s\n)"
> > ...
>
> --
> Paul
>

Reply via email to