[518] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r638 - in trunk: . owl

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:07:00 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Thu,  1 Mar 2007 01:52:22 -0500 (EST)

Author: nelhage
Date: 2007-03-01 01:52:22 -0500 (Thu, 01 Mar 2007)
New Revision: 638

Modified:
   trunk/
   trunk/owl/owl.c
   trunk/owl/perlwrap.pm
Log:
 r19164@phanatique:  nelhage | 2007-03-01 01:51:51 -0500
 Move handling of the legacy owl::format_msg into perl. It now works
 again.



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - bb873fd7-8e23-0410-944a-99ec44c633eb:/branches/owl/filter-rewrite:15925
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h/trunk:19162
   + bb873fd7-8e23-0410-944a-99ec44c633eb:/branches/owl/filter-rewrite:15925
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h/trunk:19164

Modified: trunk/owl/owl.c
===================================================================
--- trunk/owl/owl.c	2007-03-01 03:38:48 UTC (rev 637)
+++ trunk/owl/owl.c	2007-03-01 06:52:22 UTC (rev 638)
@@ -315,17 +315,6 @@
   owl_function_debugmsg("startup: doing AIM initialization");
   owl_aim_init();
 
-  /* if the config defines a formatting function, add 'perl' as a style */
-  if (owl_global_is_config_format(&g)) {
-    owl_function_debugmsg("Found perl formatting");
-    s=owl_malloc(sizeof(owl_style));
-    owl_style_create_perl(s, "perl", "BarnOwl::_format_msg_legacy_wrap",
-			  "User-defined perl style that calls BarnOwl::format_msg"
-			  "with legacy global variable support");
-    owl_global_add_style(&g, s);
-    owl_global_set_default_style(&g, "perl");
-  }
-
   /* execute the startup function in the configfile */
   owl_function_debugmsg("startup: executing perl startup, if applicable");
   perlout = owl_perlconfig_execute("BarnOwl::Hooks::startup();");
@@ -406,7 +395,7 @@
     owl_zephyr_zlog_in();
   }
 
-  owl_function_debugmsg("startup: set style for the view");
+  owl_function_debugmsg("startup: set style for the view: %s", owl_global_get_default_style(&g));
   owl_view_set_style(owl_global_get_current_view(&g), 
 		     owl_global_get_style_by_name(&g, owl_global_get_default_style(&g)));   
 

Modified: trunk/owl/perlwrap.pm
===================================================================
--- trunk/owl/perlwrap.pm	2007-03-01 03:38:48 UTC (rev 637)
+++ trunk/owl/perlwrap.pm	2007-03-01 06:52:22 UTC (rev 638)
@@ -440,6 +440,13 @@
         do $BarnOwl::configfile;
         die $@ if $@;
         package BarnOwl;
+        if(*BarnOwl::format_msg{CODE}) {
+            # if the config defines a legacy formatting function, add 'perl' as a style 
+            BarnOwl::_create_style("perl", "BarnOwl::_format_msg_legacy_wrap",
+                                   "User-defined perl style that calls BarnOwl::format_msg"
+                                   . " with legacy global variable support");
+            BarnOwl::set("-q default_style perl");
+        }
     }
 }
 


home help back first fref pref prev next nref lref last post