Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

nverno
Copy link
Contributor

@nverno nverno commented Mar 16, 2024

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

@greghendershott
Copy link
Owner

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!

@greghendershott greghendershott merged commit daf70fd into greghendershott:master Mar 17, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants