Closed aadcg closed 6 months ago
Regarding sly-list-implementation
, I've noticed that adding the element (test ("nix-shell" "-p" "sbcl" "--run" "sbcl --dynamic-space-size 2345"))
does work which, in retrospective, makes sense.
It is still a mystery why C-u M-x sly RET nix-shell -p sbcl --run 'sbcl --dynamic-space-size 3072'
doesn't work, but I can live with that.
It is still a mystery why C-u M-x sly RET nix-shell -p sbcl --run 'sbcl --dynamic-space-size 3072' doesn't work, but I can live with that.
You could edebug it and see what eventually makes it to the make-process
C function...
There's some (not idea exactly how much) magic in Eglot, another extension that executes extgernal processes, to handle that. I'm fairly sure I cargo culted from somewhere. Maybe split-string-and-unquote
? Maybe it can be retrofitted in SLY? But is it the same use case? Also I think that helper only understands double quotes, not single.
There's some (not idea exactly how much) magic in Eglot, another extension that executes extgernal processes, to handle that. I'm fairly sure I cargo culted from somewhere. Maybe
split-string-and-unquote
? Maybe it can be retrofitted in SLY? But is it the same use case? Also I think that helper only understands double quotes, not single.
[ Sorry, I haven't really tried to understand the more global context of the question/problem, so just a "drive-by shooting": ]
split-string-and-unquote
does not try to handle the usual Bourne shell
syntax. Instead it uses the ELisp syntax of strings, so indeed it only
accepts double-quotes and is thus not appropriate if the intention is to
try and mimic sh-style parsing.
You're 100% percent right Stefan, probably not a good idea at all. The only way to get perfect shell-quoting behaviour is just making processes via the shell, and I find it's not needed often.
The following commands are valid ways to start lisp:
nix-shell -p sbcl --run "sbcl --dynamic-space-size 3072"
nix-shell -p sbcl --run 'sbcl --dynamic-space-size 3072'
However:
C-u M-x sly RET nix-shell -p sbcl --run "sbcl --dynamic-space-size 3072" => OK
C-u M-x sly RET nix-shell -p sbcl --run 'sbcl --dynamic-space-size 3072' => error: unrecognised flag '--dynamic-space-size'
If these are elements of
sly-lisp-implementations
:(test1 ("nix-shell" "-p" "sbcl" "--run" "'sbcl --dynamic-space-size 3072'"))
(test2 ("nix-shell" "-p" "sbcl" "--run" "\"sbcl --dynamic-space-size 3072\""))
M--- M-x sly RET test1 => /tmp/nix-shell-9574-0/rc: line 3: sbcl --dynamic-space-size 3072: command not found
M--- M-x sly RET test2 => /tmp/nix-shell-10951-0/rc: line 3: sbcl --dynamic-space-size 3072: command not found
At the heart of these bugs lies:
I wonder if there's a way for
start-process
to handle the quotes.