That `WINDOWS_INIT_FILENAME` definition is only used in `--help`
output, and it's out of date. I'll fix that.
Use `(find-system-path 'init-file)` to get the actual path, and see the
docs for `path-system-path` for how it's computed. Although `HOMEDRIVE`
and `HOMEPATH` may be eventually consulted, two other mechanisms take
precedence.
Note also that the filename is "racketrc.rktl" with no leading ".".
An error report on the `enter!` problem would be welcome.
At Tue, 20 Mar 2018 21:00:01 -0600, Kieron Hardy wrote:
> Hello all,
>
> On Windows, I noticed that Racket's initialization file is incorrectly set
> to %HOMEDIRVE%\%HOMEPATH%\.racketrc.rktl
>
> $ grep 'WINDOWS_INIT_FILENAME' -r .
> ./racket-master/racket/src/gracket/grmain.c:#define WINDOWS_INIT_FILENAME
> "%%HOMEDIRVE%%\\%%HOMEPATH%%\\gracketrc.rktl"
> ./racket-master/racket/src/racket/main.c:# define WINDOWS_INIT_FILENAME
> "%%HOMEDIRVE%%\\%%HOMEPATH%%\\racketrc.rktl"
> ./racket-master/racket/src/racket/main.c:# define INIT_FILENAME
> WINDOWS_INIT_FILENAME
>
> (The correct location should of course be on %HOMEDRIVE%).
>
> Having never used a Racket initialization file, I set about developing a
> test case to demonstrate the error in code using for inspiration Greg
> Hendershott's answer regarding interactive use of Racket on SO (see
> https://stackoverflow.com/a/19876947/1689714).
>
> I set %HOMEDRIVE%\%HOMEPATH%\.racketrc.rktl to (require xrepl), and was
> surprised to see no issue with actually using definitions from xrepl after
> starting the racket executable. I soon realized that as the "current drive"
> was the same as %HOMEDRIVE% (i.e. 'C:') the failure to evaluate %HOMEDIRVE%
> would not be noticed since %HOMEPATH% alone would be enough to locate the
> file .racketrc.rktl.
>
> So ... I copied the 'foo.rkt' test file, and changed the shell's current
> directory, to 'D:\', launched the racket executable and got:
>
> D:\>racket
> Welcome to Racket v6.12.
> > (enter! "foo.rkt")
> ; error during prompt calculation: path->string: contract violation
> expected: path?
> given: "d:\\foo.rkt"
> [internal-error]>
>
> This seems to be the result of another issue entirely unconnected to the
> problem of locating the initialization file, and one I am not able to chase
> any further at the moment. Should I submit an error report?
>
> Cheers,
>
> Kieron.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.