emacs-eldev / eldev

Elisp development tool
https://emacs-eldev.github.io/eldev/
GNU General Public License v3.0
226 stars 17 forks source link

Setting custom variables inside a function that is being tested #77

Closed ZelenyeShtany closed 1 year ago

ZelenyeShtany commented 1 year ago

Hello.

I have a function in which I call org-export-to-file function. Right before that call, I set some custom variables (that affect export results) from ox-icalendar package, and then set them back to initial values after the call. Everything works fine in a usual Emacs session, but when I run a test for the function, Emacs complains that those custom variables are void variables, and org-export-to-file function uses default values for these custom vars.

Is there something I can do about it?

doublep commented 1 year ago

Probably yes, but I need the project to see this myself, doesn't strike me as some problem that I immediately recognize.

ZelenyeShtany commented 1 year ago

I'm sorry, it happened because in my usual Emacs configuration I use orgmode on master branch, but Eldev was using builtin orgmode version.

Obviously, this is not an issue with Eldev.

doublep commented 1 year ago

Yes, see the section on project isolation. You can probably set some variables in file Eldev, always or in response to some hook, or in with-eval-after-load.