Index: PerlTidy.pm
===================================================================
--- PerlTidy.pm	(revision 13708)
+++ PerlTidy.pm	(working copy)
@@ -182,7 +182,9 @@
 
 	while (1) {
 		my $dialog = Wx::FileDialog->new(
-			$main, Wx::gettext("Save file as..."),
+			$main, Wx::gettext("Save file as..."),\
+#XXX
+			before_hooks;
 			$default_dir, ( $current or $doc->get_title ) . '.html',
 			"*.*", Wx::wxFD_SAVE,
 		);
@@ -340,7 +342,9 @@
 	Class::Unload->unload('Perl::Tidy');
 	return;
 }
-
+sub before_hooks {
+	tidy_document;
+} 
 1;
 
 =pod
