Changeset cff58b4 for perl/lib


Ignore:
Timestamp:
Aug 10, 2009, 9:12:10 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
7565f8f, 3b42640
Parents:
0509efc
Message:
Fix the filter<foo> commands.

Registering commands from the top-level in BarnOwl.pm doesn't work,
because the command dictionary isn't set up yet, so delay the
registration until the startup hook.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl.pm

    rd7bcff8 rcff58b4  
    314314=cut
    315315
    316 BarnOwl::new_command("filterappend",
    317     sub { filter_append_helper('appending', '', @_); },
    318     {
    319         summary => "append '<text>' to filter",
    320         usage => "filterappend <filter> <text>",
    321     });
    322 
    323 BarnOwl::new_command("filterand",
    324     sub { filter_append_helper('and-ing', 'and', @_); },
    325     {
    326         summary => "append 'and <text>' to filter",
    327         usage => "filterand <filter> <text>",
    328     });
    329 
    330 BarnOwl::new_command("filteror",
    331     sub { filter_append_helper('or-ing', 'or', @_); },
    332     {
    333         summary => "append 'or <text>' to filter",
    334         usage => "filteror <filter> <text>",
    335     });
     316sub register_builtin_commands {
     317    BarnOwl::new_command("filterappend",
     318                         sub { filter_append_helper('appending', '', @_); },
     319                       {
     320                           summary => "append '<text>' to filter",
     321                           usage => "filterappend <filter> <text>",
     322                       });
     323
     324    BarnOwl::new_command("filterand",
     325                         sub { filter_append_helper('and-ing', 'and', @_); },
     326                       {
     327                           summary => "append 'and <text>' to filter",
     328                           usage => "filterand <filter> <text>",
     329                       });
     330
     331    BarnOwl::new_command("filteror",
     332                         sub { filter_append_helper('or-ing', 'or', @_); },
     333                       {
     334                           summary => "append 'or <text>' to filter",
     335                           usage => "filteror <filter> <text>",
     336                       });
     337
     338}
     339
     340$BarnOwl::Hooks::startup->add("BarnOwl::register_builtin_commands");
    336341
    337342=head3 filter_append_helper ACTION SEP FUNC FILTER APPEND_TEXT
Note: See TracChangeset for help on using the changeset viewer.