emacs-buttercup icon indicating copy to clipboard operation
emacs-buttercup copied to clipboard

Auto-loading files fails on Windows

Open howdoicomputer opened this issue 8 years ago • 8 comments

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".

howdoicomputer avatar May 21 '16 05:05 howdoicomputer

Hello! You're not doing anything wrong, that should just work.

Does emacs -L . -Q -batch --eval "(require 'feature)" work?

jorgenschaefer avatar May 22 '16 07:05 jorgenschaefer

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...

howdoicomputer avatar May 22 '16 08:05 howdoicomputer

That means it worked, no need to test further.

jorgenschaefer avatar May 22 '16 08:05 jorgenschaefer

Well, cask exec buttercup -L . just failed on Windows but it passes on OS X. Hm.

howdoicomputer avatar May 22 '16 08:05 howdoicomputer

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.

jorgenschaefer avatar May 22 '16 08:05 jorgenschaefer

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

howdoicomputer avatar May 22 '16 08:05 howdoicomputer

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.

jorgenschaefer avatar May 22 '16 08:05 jorgenschaefer

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.

jcs090218 avatar May 03 '22 08:05 jcs090218