[Po4a-commits] "po4a/lib/Locale/Po4a TeX.pm,1.94,1.95"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Sun Sep 16 13:32:54 UTC 2007
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory alioth:/tmp/cvs-serv14860/lib/Locale/Po4a
Modified Files:
TeX.pm
Log Message:
Allow customization of the translate_buffer function with an environment
specific function.
Index: TeX.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TeX.pm,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- TeX.pm 7 Aug 2007 21:53:09 -0000 1.94
+++ TeX.pm 16 Sep 2007 13:32:52 -0000 1.95
@@ -77,6 +77,7 @@
$verbatim_environments
%separated_command
%separated_environment
+ %translate_buffer_env
&generic_command
®ister_generic_command
®ister_generic_environment);
@@ -627,10 +628,20 @@
commands (those which should be translated separately) from the
buffer.
+If a function is defined in %translate_buffer_env for the current
+environment, this function will be used to translate the buffer instead of
+translate_buffer().
+
=cut
+our %translate_buffer_env = ();
sub translate_buffer {
my ($self,$buffer, at env) = (shift,shift, at _);
+
+ if (@env and defined $translate_buffer_env{$env[-1]}) {
+ return &{$translate_buffer_env{$env[-1]}}($self,$buffer, @env);
+ }
+
print STDERR "translate_buffer($buffer, at env)="
if ($debug{'translate_buffer'});
my ($command,$variant) = ("","");
More information about the Po4a-commits
mailing list