--- rxvt-unicode/src/urxvt.pm 2014/12/26 21:01:46 1.248 +++ rxvt-unicode/src/urxvt.pm 2015/01/16 20:13:01 1.253 @@ -47,11 +47,10 @@ Extensions may add additional resources and C, i.e., methods which can be bound to a key and invoked by the user. An extension can -define the resources it support and also default bindings for one or -more actions it provides using so called META comments, described -below. Similarly to builtin resources, extension resources can also be -specified on the command line as long options (with C<.> replaced by -C<->), in which case the corresponding extension is loaded +define the resources it support using so called META comments, +described below. Similarly to builtin resources, extension resources +can also be specified on the command line as long options (with C<.> +replaced by C<->), in which case the corresponding extension is loaded automatically. For this to work the extension B define META comments for its resources. @@ -120,7 +119,7 @@ Rxvt-unicode recognizes special meta comments in extensions that define different types of metadata. -Currently, it recxognises only one such comment: +Currently, it recognises only one such comment: =over 4 @@ -1136,20 +1135,30 @@ return if exists $self->{meta}; - my @libdirs = perl_libdirs $self; + my @urxvtdirs = perl_libdirs $self; +# my @cpandirs = grep -d, map "$_/URxvt/Ext", @INC; -# return if $self->{meta_libdirs} eq join "\x00", @libdirs;#d# - -# $self->{meta_libdirs} = join "\x00", @libdirs;#d# $self->{meta} = \my %meta; # first gather extensions - for my $dir (reverse @libdirs) { + + my $gather = sub { + my ($dir, $core) = @_; + opendir my $fh, $dir - or next; + or return; + for my $ext (readdir $fh) { $ext !~ /^\./ - and open my $fh, "<", "$dir/$ext" + or next; + + open my $fh, "<", "$dir/$ext" + or next; + + -f $fh + or next; + + $ext =~ s/\.uext$// or $core or next; my %ext = (dir => $dir); @@ -1172,12 +1181,18 @@ $meta{ext}{$ext} = \%ext; } - } + }; + +# $gather->($_, 0) for @cpandirs; + $gather->($_, 1) for @urxvtdirs; # and now merge resources + + $meta{resource} = \my %resource; + while (my ($k, $v) = each %{ $meta{ext} }) { #TODO: should check for extensions overriding each other - %{ $meta{resource} } = (%{ $meta{resource} }, %{ $v->{resource} }); + %resource = (%resource, %{ $v->{resource} }); } } @@ -1338,9 +1353,9 @@ Adds a key binding exactly as specified via a C resource. See the C resource in the urxvt(1) manpage. -To add default bindings for an extension, the extension should call C<< -->bind_action >> on it's C hook for every such binding. Doing it -in the C hook allows users the override or remove the the binding +To add default bindings for actions, an extension should call C<< +->bind_action >> in its C hook for every such binding. Doing it +in the C hook allows users to override or remove the binding again. Example: the C by default binds itself @@ -1684,6 +1699,10 @@ Used after changing terminal contents to display them. +=item $term->refresh_check + +Checks if a refresh has been requested and, if so, schedules one. + =item $text = $term->ROW_t ($row_number[, $new_text[, $start_col]]) Returns the text of the entire row with number C<$row_number>. Row C<< $term->top_row >>