src/Pure/General/pretty.ML
changeset 23922 707639e9497d
parent 23787 4868d3913961
child 24612 d1b315bdb8d7
equal deleted inserted replaced
23921:947152add153 23922:707639e9497d
    88 
    88 
    89 local
    89 local
    90   val default = {indent = default_indent};
    90   val default = {indent = default_indent};
    91   val modes = ref (Symtab.make [("", default)]);
    91   val modes = ref (Symtab.make [("", default)]);
    92 in
    92 in
    93   fun add_mode name indent =
    93   fun add_mode name indent = CRITICAL (fn () =>
    94     change modes (Symtab.update_new (name, {indent = indent}));
    94     change modes (Symtab.update_new (name, {indent = indent})));
    95   fun get_mode () =
    95   fun get_mode () =
    96     the_default default (Library.get_first (Symtab.lookup (! modes)) (! print_mode));
    96     the_default default (Library.get_first (Symtab.lookup (! modes)) (! print_mode));
    97 end;
    97 end;
    98 
    98 
    99 fun mode_indent x y = #indent (get_mode ()) x y;
    99 fun mode_indent x y = #indent (get_mode ()) x y;