From f711f3385ccfd01182ac41cea0c4b0583f5cccb4 Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Mon, 16 Jan 2012 06:09:30 -0700 Subject: [PATCH] macro-stepper: fix relative require bug (set current-directory) related to PR 12486 --- collects/macro-debugger/tool.rkt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/collects/macro-debugger/tool.rkt b/collects/macro-debugger/tool.rkt index 1d392adf3c..ca292e5256 100644 --- a/collects/macro-debugger/tool.rkt +++ b/collects/macro-debugger/tool.rkt @@ -13,7 +13,8 @@ images/compile-time (for-syntax racket/base images/icons/tool) ;; FIXME: - drracket/private/syncheck/local-member-names) + drracket/private/syncheck/local-member-names + drracket/private/eval-helpers) ;; Capability name: 'macro-stepper:enabled @@ -236,7 +237,7 @@ (current-module-name-resolver the-module-name-resolver) (send the-tab set-breakables (current-thread) (current-custodian)) - ;; (set-directory definitions-text) + (set-directory definitions-text) (current-load-relative-directory #f) (current-error-port error-port) (current-output-port output-port) @@ -336,6 +337,14 @@ #t))) (void)) + ;; set-directory : text -> void + ;; 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)) + ;; with-lock/edit-sequence : text (-> void) -> void ;; sets and restores some state of the definitions text ;; so that edits to the definitions text work out.