ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/urxvt.pm
(Generate patch)

Comparing rxvt-unicode/src/urxvt.pm (file contents):
Revision 1.229 by root, Sat Apr 26 18:53:51 2014 UTC vs.
Revision 1.230 by root, Sat Apr 26 20:51:12 2014 UTC

667# called by the rxvt core 667# called by the rxvt core
668sub invoke { 668sub invoke {
669 local $TERM = shift; 669 local $TERM = shift;
670 my $htype = shift; 670 my $htype = shift;
671 671
672 if ($htype == 0) { # INIT 672 if ($htype == HOOK_INIT) {
673 my @dirs = $TERM->perl_libdirs; 673 my @dirs = $TERM->perl_libdirs;
674 674
675 my %ext_arg; 675 my %ext_arg;
676 676
677 { 677 {
716 716
717 if (my $cb = $TERM->{_hook}[$htype]) { 717 if (my $cb = $TERM->{_hook}[$htype]) {
718 verbose 10, "$HOOKNAME[$htype] (" . (join ", ", $TERM, @_) . ")" 718 verbose 10, "$HOOKNAME[$htype] (" . (join ", ", $TERM, @_) . ")"
719 if $verbosity >= 10; 719 if $verbosity >= 10;
720 720
721 for my $pkg (keys %$cb) { 721 for my $pkg (
722 # this hook is only sent to the extension with the name
723 # matching the first arg
724 $htype == HOOK_KEYBOARD_DISPATCH
725 ? exists $cb->{"urxvt::ext::$_[0]"} ? "urxvt::ext::" . shift : return undef
726 : keys %$cb
727 ) {
722 my $retval_ = eval { $cb->{$pkg}->($TERM->{_pkg}{$pkg} || $TERM, @_) }; 728 my $retval_ = eval { $cb->{$pkg}->($TERM->{_pkg}{$pkg} || $TERM, @_) };
723 $retval ||= $retval_; 729 $retval ||= $retval_;
724 730
725 if ($@) { 731 if ($@) {
726 $TERM->ungrab; # better to lose the grab than the session 732 $TERM->ungrab; # better to lose the grab than the session
730 736
731 verbose 11, "$HOOKNAME[$htype] returning <$retval>" 737 verbose 11, "$HOOKNAME[$htype] returning <$retval>"
732 if $verbosity >= 11; 738 if $verbosity >= 11;
733 } 739 }
734 740
735 if ($htype == 1) { # DESTROY 741 if ($htype == HOOK_DESTROY) {
736 # clear package objects 742 # clear package objects
737 %$_ = () for values %{ $TERM->{_pkg} }; 743 %$_ = () for values %{ $TERM->{_pkg} };
738 744
739 # clear package 745 # clear package
740 %$TERM = (); 746 %$TERM = ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines