diff --git a/collects/macro-debugger/syntax-browser/display.rkt b/collects/macro-debugger/syntax-browser/display.rkt index ba8b793..a96897e 100644 --- a/collects/macro-debugger/syntax-browser/display.rkt +++ b/collects/macro-debugger/syntax-browser/display.rkt @@ -41,7 +41,8 @@ (length (send/i config config<%> get-colors)) (send/i config config<%> get-suffix-option) (send config get-pretty-styles) - columns)) + columns + (send config get-pretty-abbrev?))) (define output-string (get-output-string output-port)) (define output-length (sub1 (string-length output-string))) ;; skip final newline (fixup-parentheses output-string range) diff --git a/collects/macro-debugger/syntax-browser/prefs.rkt b/collects/macro-debugger/syntax-browser/prefs.rkt index a392882..b16dbec 100644 --- a/collects/macro-debugger/syntax-browser/prefs.rkt +++ b/collects/macro-debugger/syntax-browser/prefs.rkt @@ -30,6 +30,9 @@ ;; suffix-option : SuffixOption (define-notify suffix-option (new notify-box% (value 'over-limit))) + ;; pretty-abbrev? : boolean + (define-notify pretty-abbrev? (new notify-box% (value #t))) + ;; pretty-styles : ImmutableHash[symbol -> symbol] (define-notify pretty-styles (new notify-box% (value (make-immutable-hasheq null)))) diff --git a/collects/macro-debugger/syntax-browser/pretty-printer.rkt b/collects/macro-debugger/syntax-browser/pretty-printer.rkt index e5467f6..7de1c17 100644 --- a/collects/macro-debugger/syntax-browser/pretty-printer.rkt +++ b/collects/macro-debugger/syntax-browser/pretty-printer.rkt @@ -9,9 +9,10 @@ ;; FIXME: Need to disable printing of structs with custom-write property -;; pretty-print-syntax : syntax port partition number SuffixOption hasheq number +;; pretty-print-syntax : syntax port partition number SuffixOption hasheq number bool ;; -> range% -(define (pretty-print-syntax stx port primary-partition colors suffix-option styles columns) +(define (pretty-print-syntax stx port + primary-partition colors suffix-option styles columns abbrev?) (define range-builder (new range-builder%)) (define-values (datum ht:flat=>stx ht:stx=>flat) (syntax->datum/tables stx primary-partition colors suffix-option)) @@ -45,6 +46,7 @@ [pretty-print-size-hook pp-size-hook] [pretty-print-print-hook pp-print-hook] [pretty-print-remap-stylable pp-remap-stylable] + [pretty-print-abbreviate-read-macros abbrev?] [pretty-print-current-style-table (pp-better-style-table styles)] [pretty-print-columns columns]) (pretty-print/defaults datum port) diff --git a/collects/macro-debugger/view/frame.rkt b/collects/macro-debugger/view/frame.rkt index bd622ac..a5aec44 100644 --- a/collects/macro-debugger/view/frame.rkt +++ b/collects/macro-debugger/view/frame.rkt @@ -209,6 +209,9 @@ (menu-option/notify-box extras-menu "Draw binding arrows" (get-field draw-arrows? config)) + (menu-option/notify-box extras-menu + "Enable reader abbreviations" + (get-field pretty-abbrev? config)) (menu-option/notify-box extras-menu "Extra navigation" (get-field extra-navigation? config))) diff --git a/collects/macro-debugger/view/stepper.rkt b/collects/macro-debugger/view/stepper.rkt index ddaa5c2..f35c65c 100644 --- a/collects/macro-debugger/view/stepper.rkt +++ b/collects/macro-debugger/view/stepper.rkt @@ -158,6 +158,8 @@ (send/i sbc sb:controller<%> listen-selected-syntax (lambda (stx) (send/i macro-hiding-prefs hiding-prefs<%> set-syntax stx))) + (send config listen-pretty-abbrev? + (lambda (_) (update/preserve-view))) (send*/i config config<%> (listen-show-hiding-panel? (lambda (show?) (show-macro-hiding-panel show?)))