Closed bhrgunatha closed 1 year ago
After some debugging I think the culprit is perhaps nim--fmt
at least for the path my use takes.
Initially nim-compile--get-compile-command
doesn't find a saved command so it assigns file using
(when buffer-file-name
(shell-quote-argument buffer-file-name))
It's using shell-quote-argument
already.
Later nim--fmt
gets called with:
nim--fmt (c -r --verbosity:0 --hint[Processing]:off --excessiveStackTrace:on) /mnt/data/src/example\ repos/nim/advent-of-code/2021.lscrd/Day\ 01/p01.nim
The file path is correctly quoted already by shell-quote-argument
.
It then maps shell-quote-argument
again over the arguments and the file - which is why I think the spaces are getting handled as "\\\ " in the file path.
I don't know enough about the other things nim-compile
has to deal with so can't suggest a good fix but I think I've found the issue at least.
.
Conforming Bugs
Please tell us below:
choosenim stable
choosenim stable
*Messages*
buffer? "nim-compile exited abnormally with code 1"This is my configuration of
nim-mode
I'm new to Nim and thought I'd look at how people solved the recent advent of code puzzles to get a feel for the language. and the first one I tried was https://github.com/lscrd/AdventOfCode2021
When I try to compile a program -
C-c C-c
- that has spaces in the path I get the following error.If I move the file to a path without spaces it compiles successfully.
Directly on the command line:
fails
fails and
succeeds.
That escaping of the spaces "\\\ " looks strange to me and it seems like
nim-compile
is callingshell-quote-argument
but that's as far as I got.
If I edit the minibuffer before the command is executed to use a single \ it works fine
but surrounding the path with quotes doesn't