Closed nverno closed 8 months ago
Huh, I wonder what I was thinking there.
Maybe it's copypasta from racket-shell.el
:
(defun racket--shell-or-terminal (args)
(racket--save-if-changed)
(let* ((exe (shell-quote-argument
(if (file-name-absolute-p racket-program)
(expand-file-name racket-program) ;handle e.g. ~/
racket-program)))
(cmd (concat exe " " args))
(win (selected-window)))
(funcall racket-shell-or-terminal-function cmd)
(select-window win)))
That has a comment about handling things like ~
. OK. However (1) there it's nested in a file-name-absolute-p
test, avoiding the gotcha you mention. And (2) there it's solving a problem (maybe?) that we don't have when using call-process
, which is OK with paths like ~/racket/bin/racket
.
So I'll merge this -- thanks!
Expanding
racket-program
expands the path in whatever the current directory is unlessracket-program
already happens to be an absolute path.