diff --git a/collects/macro-debugger/util/mpi.rkt b/collects/macro-debugger/util/mpi.rkt index 6f627aaf63..c4f832c553 100644 --- a/collects/macro-debugger/util/mpi.rkt +++ b/collects/macro-debugger/util/mpi.rkt @@ -1,9 +1,12 @@ #lang scheme/base -(require scheme/match) +(require scheme/match + scheme/string) (provide mpi->list - mpi->string) + mpi->string + self-mpi?) +;; mpi->list : module-path-index -> list (define (mpi->list mpi) (cond [(module-path-index? mpi) (let-values ([(path relto) (module-path-index-split mpi)]) @@ -18,12 +21,16 @@ (if (module-path-index? mpi) (let ([mps (mpi->list mpi)]) (cond [(pair? mps) - (apply string-append - (format "~s" (car mps)) - (map (lambda (x) (format " <= ~s" x)) (cdr mps)))] + (string-join (map (lambda (x) (format "~s" x)) mps) + " <= ")] [(null? mps) "this module"])) (format "~s" mpi))) +;; self-mpi? : module-path-index -> bool +(define (self-mpi? mpi) + (let-values ([(path relto) (module-path-index-split mpi)]) + (eq? path #f))) + ;; -- (provide mpi->mpi-sexpr diff --git a/collects/macro-debugger/view/hiding-panel.rkt b/collects/macro-debugger/view/hiding-panel.rkt index 6522fcd23b..0b1d692216 100644 --- a/collects/macro-debugger/view/hiding-panel.rkt +++ b/collects/macro-debugger/view/hiding-panel.rkt @@ -16,6 +16,15 @@ (define mode:standard "Standard") (define mode:custom "Custom ...") +#| + +TODO + + - allow entry of more policies + - visual feedback on rules applying to selected identifier + (need to switch from list to editor) + +|# ;; macro-hiding-prefs-widget% (define macro-hiding-prefs-widget% @@ -255,11 +264,13 @@ (match condition [`(free=? ,id) (let ([b (identifier-binding id)]) - (or #;(identifier->string id) + (or #| (identifier->string id) |# (cond [(list? b) (let ([mod (caddr b)] [name (cadddr b)]) - (format "'~s' from ~a" name (mpi->string mod)))] + (if (self-mpi? mod) + (format "'~a' defined in this module" name) + (format "'~s' imported from ~a" name (mpi->string mod))))] [else (symbol->string (syntax-e id))])))] [_