Skip to content

Commit

Permalink
Hack btred to load default macros after tredmacro cleanup
Browse files Browse the repository at this point in the history
This should make ntred work again after all these years.
  • Loading branch information
choroba committed May 22, 2024
1 parent 149fc17 commit 48948d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 1 addition & 4 deletions tred_refactored/btred
Original file line number Diff line number Diff line change
Expand Up @@ -2621,6 +2621,7 @@ EOF
_msg($@) if $@;
}
}
delete @INC{qw{ TrEd/MacroAPI/Default.pm TrEd/MacroAPI/Extended.pm }};
$TrEd::Macros::safeCompartment = undef;
}

Expand Down Expand Up @@ -2782,10 +2783,6 @@ sub loadMacros {
require TrEd::MacroAPI::Default;#this loads TredMacro API
# not sure why, we don't need it here...


# BUG: This prevents tred.def to be prepended to @macros, so ntred
# can't reload macros properly.

#TredMacro->import;
#TredMacro::init_tredmacro_bindings();

Expand Down
5 changes: 4 additions & 1 deletion tred_refactored/tredlib/TrEd/Macros.pm
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,10 @@ sub initialize_macros {
# which should in this way be made visible
# to macros
my $result = 2; #hm? strange init, return value never actually used
no warnings;

# Needed to load default macros after cleanup.
require TrEd::MacroAPI::Default;

if ( not $macrosEvaluated ) {
my $utf = ($useEncoding) ? "use utf8;\n" : q{};
my $macros = q{};
Expand Down

0 comments on commit 48948d2

Please sign in to comment.