1 [[!template id=gitbranch branch=chrismgray/exclusive-hooks author="[[chrismgray]]"]]
3 Sometimes plugins register a function with `hook`, but they only want
4 the function called with the content that they know how to deal with.
5 Normally, this means that they call `pagetype` first thing in the
6 function, determine if they know how to deal with the content, and
7 only do anything if they do.
9 This is a bit wasteful in itself, but for external plugins, it's
10 really bad. For functions like `scan` and `linkify`, where the entire
11 page is sent back and forth over `stdout` and `stdin`, it really slows
14 Thus, I propose that there be a new optional parameter to `hook` that
15 tells it that the function should only be called for files whose type
16 is the same as the id of the plugin calling `hook`. I have called
17 this parameter `exclusive` in my branch, but this might not be the
22 > It's an interesting idea, but it might be more useful if it was more generalized, say, by making it a filter, where the parameter is a regexp.
24 > --[[KathrynAndersen]]
26 >> Would it make more sense as a pagespec? That might be a bit more hard to implement, but would certainly fix the naming issue.