aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/external.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/external.pm')
-rw-r--r--IkiWiki/Plugin/external.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/external.pm b/IkiWiki/Plugin/external.pm
index 287e118f1..4ce9c8bab 100644
--- a/IkiWiki/Plugin/external.pm
+++ b/IkiWiki/Plugin/external.pm
@@ -202,10 +202,16 @@ sub inject ($@) { #{{{
my $sub = sub {
IkiWiki::Plugin::external::rpc_call($plugin, $params{call}, @_)
};
+ $sub=memoize($sub) if $params{memoize};
+
+ # This will add it to the symbol table even if not present.
no warnings;
eval qq{*$params{name}=\$sub};
use warnings;
- memoize($params{name}) if $params{memoize};
+
+ # This will ensure that everywhere it was exported to sees
+ # the injected version.
+ IkiWiki::inject(name => $params{name}, call => $sub);
return 1;
} #}}}