--- rxvt-unicode/src/urxvt.pm 2006/01/02 15:35:43 1.1 +++ rxvt-unicode/src/urxvt.pm 2006/01/02 17:17:02 1.4 @@ -1,19 +1,20 @@ =head1 NAME -urxvt - rxvt-unicode's embedded perl interpreter +rxvtperl - rxvt-unicode's embedded perl interpreter =head1 SYNOPSIS -Put your scripts into $LIBDIR/perl-init/, they will be loaded automatically. +* Put your scripts into F<@@RXVT_LIBDIR@@/urxvt/perl-ext/>, they will be loaded automatically. -Each script will only be loaded once, even in urxvtd, and will be valid +* Each script will only be loaded once, even in urxvtd, and will be valid globally. -Scripts are evaluated in a 'use strict' and 'use utf8' environment, and -thus must be written in utf-8. +* Scripts are evaluated in a 'use strict' and 'use utf8' environment, and +thus must be encoded as UTF-8. sub on_sel_grab { warn "you selected ", $_[0]->selection; + () } 1 @@ -226,8 +227,7 @@ }; } -load_script $_ for grep -f $_, <$LIBDIR/perl-init/*>; - +load_script $_ for grep -f $_, <$LIBDIR/perl-ext/*>; =back @@ -235,6 +235,31 @@ =over 4 +=item $value = $term->resource ($name[, $newval]) + +Returns the current resource value associated with a given name and +optionally sets a new value. Setting values is most useful in the C +hook. Unset resources are returned and accepted as C. + +The new value must be properly encoded to a suitable character encoding +before passing it to this method. Similarly, the returned value may need +to be converted from the used encoding to text. + +Resource names are as defined in F. Colours can be specified +as resource names of the form C<< color+ >>, e.g. C. (will +likely change). + +Please note that resource strings will currently only be freed when the +terminal is destroyed, so changing options frequently will eat memory. + +=cut + +sub urxvt::term::resource($$;$) { + my ($self, $name) = (shift, shift); + unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0); + goto &urxvt::term::_resource; +} + =item ($row, $col) = $term->selection_mark ([$row, $col]) =item ($row, $col) = $term->selection_beg ([$row, $col]) @@ -392,6 +417,23 @@ =back +=head1 ENVIRONMENT + +=head2 URXVT_PERL_VERBOSITY + +This variable controls the verbosity level of the perl extension. Higher +numbers indicate more verbose output. + +=over 4 + +=item 0 - only fatal messages + +=item 3 - script loading and management + +=item 10 - all events received + +=back + =head1 AUTHOR Marc Lehmann