Index: doc/plugin.txt
===================================================================
--- doc/plugin.txt	(revision 645)
+++ doc/plugin.txt	(working copy)
@@ -190,6 +190,13 @@
 
 .. _`Understanding HTML, XML and XHTML`: http://webkit.org/blog/?p=68
 
+``genshi.loader_callback``
+--------------------------
+The callback function that should be invoked whenever the template loader loads
+a new template. Unlike the other options, this option can **not** be passed as
+a string value, but rather must be a reference to the actual function. That
+means it can not be loaded from non-Python configuration files.
+
 ``genshi.lookup_errors``
 ------------------------
 The error handling style to use in template expressions. Can be either
Index: genshi/template/plugin.py
===================================================================
--- genshi/template/plugin.py	(revision 645)
+++ genshi/template/plugin.py	(working copy)
@@ -58,6 +58,10 @@
             raise ConfigurationError('Invalid value for max_cache_size: "%s"' %
                                      options.get('genshi.max_cache_size'))
 
+        loader_callback = options.get('genshi.loader_callback', None)
+        if loader_callback and not callable(loader_callback):
+            raise ConfigurationError('loader callback must be a function')
+
         lookup_errors = options.get('genshi.lookup_errors', 'lenient')
         if lookup_errors not in ('lenient', 'strict'):
             raise ConfigurationError('Unknown lookup errors mode "%s"' %
@@ -67,7 +71,8 @@
                                      auto_reload=auto_reload,
                                      max_cache_size=max_cache_size,
                                      default_class=self.template_class,
-                                     variable_lookup=lookup_errors)
+                                     variable_lookup=lookup_errors,
+                                     callback=loader_callback)
 
     def load_template(self, templatename, template_string=None):
         """Find a template specified in python 'dot' notation, or load one from
