diff --git a/collects/drracket/private/expanding-place.rkt b/collects/drracket/private/expanding-place.rkt index 3bd7682951..729a857a02 100644 --- a/collects/drracket/private/expanding-place.rkt +++ b/collects/drracket/private/expanding-place.rkt @@ -90,8 +90,8 @@ #:use-use-current-security-guard? #t) (log-info "expanding-place.rkt: 04 setting directories") (let ([init-dir (get-init-dir path)]) - (current-directory init-dir) - (current-load-relative-directory init-dir)) + (current-directory init-dir)) + (current-load-relative-directory #f) (define sp (open-input-string program-as-string)) (port-count-lines! sp) (log-info "expanding-place.rkt: 05 installing security guard") diff --git a/collects/drracket/private/interface.rkt b/collects/drracket/private/interface.rkt index c070e4db60..812b1ba166 100644 --- a/collects/drracket/private/interface.rkt +++ b/collects/drracket/private/interface.rkt @@ -105,8 +105,7 @@ remain the same for tools that use them. get-directory ;; (-> (union #f string[existing directory])) ;; returns the directory that should be the default for - ;; the `current-directory' and `current-load-relative-directory' - ;; parameters in the repl. + ;; the `current-directory' parameter in the repl. )) (define unit:tab<%> diff --git a/collects/drracket/private/module-browser.rkt b/collects/drracket/private/module-browser.rkt index 962eef5ca4..25a8463bf5 100644 --- a/collects/drracket/private/module-browser.rkt +++ b/collects/drracket/private/module-browser.rkt @@ -876,7 +876,7 @@ p)))) (current-output-port (swallow-specials original-output-port)) (current-error-port (swallow-specials original-error-port)) - (current-load-relative-directory init-dir) + (current-load-relative-directory #f) (current-directory init-dir) (error-display-handler (λ (str exn) (set! error-str str))) @@ -1041,7 +1041,9 @@ (build-module-filename (if (regexp-match #rx"^," name) (substring name 1 (string-length name)) - (build-path (current-load-relative-directory) name)))]) + (build-path (or (current-load-relative-directory) + (current-directory)) + name)))]) (add-module-code-connections base module-code)))) module-codes))) diff --git a/collects/drracket/private/syncheck/gui.rkt b/collects/drracket/private/syncheck/gui.rkt index 6e57c51e3d..45f84ed7cb 100644 --- a/collects/drracket/private/syncheck/gui.rkt +++ b/collects/drracket/private/syncheck/gui.rkt @@ -1867,6 +1867,7 @@ If the namespace does not, they are colored the unbound color. (λ () ; =user= (send the-tab set-breakables (current-thread) (current-custodian)) (set-directory definitions-text) + (current-load-relative-directory #f) (current-error-port error-port) (current-output-port output-port) (error-display-handler @@ -2016,14 +2017,12 @@ If the namespace does not, they are colored the unbound color. ;; set-directory : text -> void - ;; sets the current-directory and current-load-relative-directory - ;; based on the file saved in the definitions-text + ;; sets the current-directory based on the file saved in the definitions-text (define/private (set-directory definitions-text) (define tmp-b (box #f)) (define fn (send definitions-text get-filename tmp-b)) (define dir (get-init-dir (and (not (unbox tmp-b)) fn))) - (current-directory dir) - (current-load-relative-directory dir)) + (current-directory dir)) ;; with-lock/edit-sequence : text (-> void) -> void ;; sets and restores some state of the definitions text diff --git a/collects/drracket/private/unit.rkt b/collects/drracket/private/unit.rkt index b1a3fb95bc..9343234e9a 100644 --- a/collects/drracket/private/unit.rkt +++ b/collects/drracket/private/unit.rkt @@ -3365,16 +3365,6 @@ module browser threading seems wrong. (send module-browser-name-length-choice enable #t) (close-status-line 'plt:module-browser)))) - ;; set-directory : text -> void - ;; sets the current-directory and current-load-relative-directory - ;; based on the file saved in the definitions-text - (define/private (set-directory definitions-text) - (define tmp-b (box #f)) - (define fn (send definitions-text get-filename tmp-b)) - (define dir (get-init-dir (and (not (unbox tmp-b)) fn))) - (current-directory dir) - (current-load-relative-directory dir)) - ; ; diff --git a/doc/release-notes/drracket/HISTORY.txt b/doc/release-notes/drracket/HISTORY.txt index 2cdba53592..3667e2522c 100644 --- a/doc/release-notes/drracket/HISTORY.txt +++ b/doc/release-notes/drracket/HISTORY.txt @@ -2,10 +2,12 @@ Version 5.2.1 ------------------------------ - . The initial current-directory and current-load-relative-directory - for unsaved programs in DrRacket is now the user's home directory, - instead of whatever the current-directory was for the underlying - OS process. + . The initial current-directory for unsaved programs in DrRacket is + now the user's home directory, instead of whatever the + current-directory was for the underlying OS process. + + . The current-load-relative-directory is now set to #f initially in + DrRacket (to better match what Racket does). . DrRacket no longer shows a stacktrace for syntax errors in the REPL.