emacs-buttercup
emacs-buttercup copied to clipboard
Auto-loading files fails on Windows
I'm not sure if I'm doing this correctly.
My directory structure is:
emacs-habitica\
tests\
test-feature.el
feature.el
Except when I run buttercup:
drfra@spacecat ~Users\drfra\workspace\emacs-habitica master $ cask exec buttercup -L .
Cannot open load file: no such file or directory, feature
I was following the wiki... am I doing something incorrectly?
I was able to get around this by using the load-relative
library.
(require 'load-relative)
(require-relative "../feature")
That made it work but it doesn't feel "right".
Hello! You're not doing anything wrong, that should just work.
Does emacs -L . -Q -batch --eval "(require 'feature)"
work?
Hm, I don't get anything but I am on Windows.
drfra@spacecat ~Users\drfra\workspace\emacs-habitica master # emacs -L . -Q -batch --eval "(require 'feature)"
drfra@spacecat ~Users\drfra\workspace\emacs-habitica master #
Just a returned newline. Lemme' grab my mac...
That means it worked, no need to test further.
Well, cask exec buttercup -L .
just failed on Windows but it passes on OS X. Hm.
Well,
cask exec buttercup -L .
just failed on Windows but it passes on OS X. Hm.
Aha! … I just set up a test directory structure here, and it works fine, but I do not have a Windows system available to test this, sadly :-(
If you find out what's wrong there and if buttercup can do anything to support Windows better, please do let me know.
Yeah, no problem. I did add the batch script. I am just learning Emacs Lisp so it'll take me a while to fix this.
I wonder if this block of code has trouble with Windows based paths?
https://github.com/jorgenschaefer/emacs-buttercup/blob/master/buttercup.el#L684-L687
Edit 20200916 by @snogge The link should probably refer to these lines https://github.com/jorgenschaefer/emacs-buttercup/blob/abf2abecc527b393336f22802865666dde8eaba6/buttercup.el#L684-L687
Hm. You can add (message "Loading %s" file)
in front of the (load ...)
line and see if that runs at all, and what file it tries to load.
I am also getting this issue, this is what works for me.
In function buttercup-run-discover
:
- (dolist (dir (or dirs '(".")))
+ (dolist (dir (or dirs `(,default-directory)))
I think the "."
isn't safe enough; use default-directory
should be safer IMO.