Changeset 2be605a for perl


Ignore:
Timestamp:
Jul 18, 2009, 11:13:30 AM (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:
203dcda
Parents:
96f7b07
Message:
Add BarnOwl commands to @EXPORT_OK.
Location:
perl/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl.pm

    reb6cedc r2be605a  
    33
    44package BarnOwl;
     5
     6use base qw(Exporter);
     7our @EXPORT_OK = qw(command getcurmsg getnumcols getidletime
     8                    zephyr_getsender zephyr_getrealm zephyr_zwrite
     9                    zephyr_stylestrip zephyr_smartstrip_user zephyr_getsubs
     10                    queue_message admin_message
     11                    start_question start_password start_edit_win
     12                    get_data_dir get_config_dir popless_text popless_ztext
     13                    error
     14                    create_style getnumcolors wordwrap
     15                    add_dispath remove_dispatch
     16                    new_command
     17                    new_variable_int new_variable_bool new_variable_string
     18                    quote);
     19our %EXPORT_TAGS = (all => \@EXPORT_OK);
    520
    621BEGIN {
  • perl/lib/BarnOwl/Editwin.pm

    rc6ecf5c r2be605a  
    2020                    point_move replace_region get_region
    2121                    save_excursion current_column point mark);
     22our %EXPORT_TAGS = (all => \@EXPORT_OK);
    2223
    2324sub text_before_point {
  • perl/lib/BarnOwl/Hooks.pm

    reb6cedc r2be605a  
    55
    66use Carp;
     7use List::Util qw(first);
    78
    89=head1 BarnOwl::Hooks
     
    206207            BarnOwl::command($command . " " . join(" ", @_))
    207208          };
    208     }
     209        if(defined(*{"${package}::EXPORT_OK"}{ARRAY})
     210          && !contains(*{"${package}::EXPORT_OK"}{ARRAY}, $symbol)) {
     211            push @{*{"${package}::EXPORT_OK"}{ARRAY}}, $symbol;
     212        }
     213    }
     214}
     215
     216sub contains {
     217    my $list = shift;
     218    my $what = shift;
     219    return defined(first {$_ eq $what} @$list);
    209220}
    210221
Note: See TracChangeset for help on using the changeset viewer.