ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/selection-autotransform
(Generate patch)

Comparing rxvt-unicode/src/perl/selection-autotransform (file contents):
Revision 1.4 by root, Sun Jan 15 05:14:12 2006 UTC vs.
Revision 1.6 by root, Wed Jan 18 11:05:09 2006 UTC

3sub msg { 3sub msg {
4 my ($self, $msg) = @_; 4 my ($self, $msg) = @_;
5 5
6 my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1); 6 my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1);
7 $overlay->set (0, 0, $msg); 7 $overlay->set (0, 0, $msg);
8 my $iow; $iow = urxvt::timer->new->start (urxvt::NOW + 2)->cb (sub { 8 my $iow; $iow = urxvt::timer->new->after (2)->cb (sub {
9 undef $overlay; 9 undef $overlay;
10 undef $iow; 10 undef $iow;
11 }); 11 });
12} 12}
13 13
14sub on_init { 14sub on_init {
15 my ($self) = @_; 15 my ($self) = @_;
16 16
17 unless (urxvt::safe) {
18 warn "running with elevated privileges, ignoring selection-autotransform patterns";
19 return;
20 }
21
22 for (my $idx = 0; defined (my $res = urxvt::untaint $self->x_resource ("selection-autotransform.$idx")); $idx++) { 17 for (my $idx = 0; defined (my $res = $self->x_resource ("selection-autotransform.$idx")); $idx++) {
23 $res = $self->locale_decode ($res); 18 $res = $self->locale_decode ($res);
24 my $transform = eval "sub { $res }"; 19 my $transform = eval "sub { $res }";
25 20
26 if ($transform) { 21 if ($transform) {
27 push @{ $self->{transforms} }, $transform; 22 push @{ $self->{transforms} }, $transform;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines