macro-stepper: fix relative require bug (set current-directory)

related to PR 12486
This commit is contained in:
Ryan Culpepper 2012-01-16 06:09:30 -07:00
parent f173b9977c
commit f711f3385c

View File

@ -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.