Photos
Blog
Projects
vanrenterghem.biz
projects
/
git.ikiwiki.info.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
po(delete): added hook, and function skeleton
[git.ikiwiki.info.git]
/
IkiWiki
/
Plugin
/
external.pm
diff --git
a/IkiWiki/Plugin/external.pm
b/IkiWiki/Plugin/external.pm
index ff3b2d8ed97d06c53402cb04b8921b3761136673..4ce9c8babb62d45bacb3bb76a4773bd27cb09b5c 100644
(file)
--- a/
IkiWiki/Plugin/external.pm
+++ b/
IkiWiki/Plugin/external.pm
@@
-202,8
+202,16
@@
sub inject ($@) { #{{{
my $sub = sub {
IkiWiki::Plugin::external::rpc_call($plugin, $params{call}, @_)
};
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};
eval qq{*$params{name}=\$sub};
- memoize($params{name}) if $params{memoize};
+ use warnings;
+
+ # This will ensure that everywhere it was exported to sees
+ # the injected version.
+ IkiWiki::inject(name => $params{name}, call => $sub);
return 1;
} #}}}
return 1;
} #}}}
@@
-217,8
+225,7
@@
sub hook ($@) { #{{{
delete $params{call};
IkiWiki::hook(%params, call => sub {
delete $params{call};
IkiWiki::hook(%params, call => sub {
- my $ret=IkiWiki::Plugin::external::rpc_call($plugin, $callback, @_);
- return $ret;
+ IkiWiki::Plugin::external::rpc_call($plugin, $callback, @_);
});
} #}}}
});
} #}}}