> It looks great but it introduces a test failure, however. > > `org-export-expand-include-keyword' is called from within > `org-export-with-buffer-copy'. > > At the very beginning of `org-export-expand-include-keyword', there is > > (buffer-file-name (buffer-base-buffer)) > > Before the patch, it returned the source file name. After the patch it > returns nil. > > Actually I'm a bit surprised it used to work, since we're evaluating > this from a new buffer, not an existing one. But hey, it worked!
That's because the "buffer copy" also copies the local vars, and indeed that's where I made a typo. > Do you know what could cause this? Yes: (push (cons var val) varvals)))) varvals))) should be (push (cons var val) varvals))))) varvals)) so that the final `varvals` is outside the `dolist` (it's the thing we want to return to store it in the outer `varvals` variable). Sorry 'bout that, Stefan