greghendershott / racket-mode

Emacs major and minor modes for Racket: edit, REPL, check-syntax, debug, profile, packages, and more.
https://www.racket-mode.com/
GNU General Public License v3.0
682 stars 93 forks source link

racket-doc: Dont try to expand racket-program as directory #704

Closed nverno closed 8 months ago

nverno commented 8 months ago

Expanding racket-program expands the path in whatever the current directory is unless racket-program already happens to be an absolute path.

greghendershott commented 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!