zenitani / elisp

15 stars 10 forks source link

Question: How do I get `next-error` to ignore leading whitespace in compilation buffer? #11

Closed gmlewis closed 5 months ago

gmlewis commented 5 months ago

Sorry, I have tried searching for how to fix this, but found nothing, so I'm asking here.

I'm running Emacs version 28.2 (9.0) on a Mac M2 Max and have the latest smart-compile.el. I type Ctrl-x Ctrl-e to run "go test ./..." and the output looks like this:

-*- mode: compilation; default-directory: "~/go/src/github.com/gmlewis/gep/model/" -*-
Compilation started at Fri Jan 26 18:13:01

go test ./...
2024/01/26 18:13:02 Warning: ActionSpace Discrete not handled yet: N=2
2024/01/26 18:13:02 error evaluating gene "d3": index 3 >= d length (0)
--- FAIL: TestNewGymnasiumAgent (0.00s)
    --- FAIL: TestNewGymnasiumAgent/Blackjack (0.00s)
        gymnasium-agent_test.go:64: action type '0x140000a8310' not yet supported
FAIL
FAIL    github.com/gmlewis/gep/v2/model 0.220s
FAIL

Compilation exited abnormally with code 1 at Fri Jan 26 18:13:02

Note the leading whitespace before gymnasium-agent_test.go:64:.

Now, when I type "Ctrl-x `", the bottom buffer says:

Find this error in (default   gymnasium-agent_test.go): ~/go/src/github.com/gmlewis/gep/model/

which also has extra leading whitespace in the filename gymnasium-agent_test.go. When I hit "Enter", it says: Cannot find ' gymnasium-agent_test.go' even though the file exists.

How can I fix this problem? Thank you!

zenitani commented 5 months ago

I have no idea. Do you get a similar error when you type go test ./... in the Terminal.app?

gmlewis commented 5 months ago

Yes, it turns out I do:

glenn@glenn-MacM2Pro ~/go/src/github.com/gmlewis/gep/model (master) $ go test ./...
--- FAIL: TestNewGymnasiumAgents (0.00s)
    --- FAIL: TestNewGymnasiumAgents/Blackjack (0.00s)
        gymnasium-agents_test.go:67: test
FAIL
FAIL    github.com/gmlewis/gep/v2/model 0.162s
FAIL
zenitani commented 5 months ago

Then it's an error in go test. Sorry but there is nothing smart-compile.el can do.

gmlewis commented 5 months ago

OK, thanks. I appreciate your help. Closing.