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.89 by root, Thu Jan 12 12:10:06 2006 UTC vs.
Revision 1.92 by root, Fri Jan 13 04:59:04 2006 UTC

127And this example matches the same,but replaces it with vi-commands you can 127And this example matches the same,but replaces it with vi-commands you can
128paste directly into your (vi :) editor: 128paste directly into your (vi :) editor:
129 129
130 URxvt.selection-autotransform.0: s/^(S+):(d+):?$/\\x1b:e \\Q$1\\E\\x0d:$2\\x0d/ 130 URxvt.selection-autotransform.0: s/^(S+):(d+):?$/\\x1b:e \\Q$1\\E\\x0d:$2\\x0d/
131 131
132Of course, this can be modified to suit your needs and your editor :)
133
134To expand the example above to typical perl error messages ("XXX at
135FILENAME line YYY."), you need a slightly more elaborate solution:
136
137 URxvt.selection.pattern-0: ( at .*? line \\d+\\.)
138 URxvt.selection-autotransform.0: s/^ at (.*?) line (\\d+)\\.$/\x1b:e \\Q$1\E\\x0d:$2\\x0d/
139
140The first line tells the selection code to treat the unchanging part of
141every error message as a selection pattern, and the second line transforms
142the message into vi commands to load the file.
143
132=item mark-urls 144=item mark-urls
133 145
134Uses per-line display filtering (C<on_line_update>) to underline urls and 146Uses per-line display filtering (C<on_line_update>) to underline urls and
135make them clickable. When middle-clicked, the program specified in the 147make them clickable. When middle-clicked, the program specified in the
136resource C<urlLauncher> (default C<x-www-browser>) will be started with 148resource C<urlLauncher> (default C<x-www-browser>) will be started with
359 371
360Called whenever the user presses a key combination that has a 372Called whenever the user presses a key combination that has a
361C<perl:string> action bound to it (see description of the B<keysym> 373C<perl:string> action bound to it (see description of the B<keysym>
362resource in the @@RXVT_NAME@@(1) manpage). 374resource in the @@RXVT_NAME@@(1) manpage).
363 375
376=item on_x_event $term, $event
377
378Called on every X event received on the vt window (and possibly other
379windows). Should only be used as a last resort. Most event structure
380members are not passed.
381
364=item on_focus_in $term 382=item on_focus_in $term
365 383
366Called whenever the window gets the keyboard focus, before rxvt-unicode 384Called whenever the window gets the keyboard focus, before rxvt-unicode
367does focus in processing. 385does focus in processing.
368 386
478=item urxvt::CurrentTime 496=item urxvt::CurrentTime
479 497
480=item urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, 498=item urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask,
481Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, 499Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask,
482Button4Mask, Button5Mask, AnyModifier 500Button4Mask, Button5Mask, AnyModifier
501
502=item urxvt::NoEventMask, KeyPressMask, KeyReleaseMask,
503ButtonPressMask, ButtonReleaseMask, EnterWindowMask, LeaveWindowMask,
504PointerMotionMask, PointerMotionHintMask, Button1MotionMask, Button2MotionMask,
505Button3MotionMask, Button4MotionMask, Button5MotionMask, ButtonMotionMask,
506KeymapStateMask, ExposureMask, VisibilityChangeMask, StructureNotifyMask,
507ResizeRedirectMask, SubstructureNotifyMask, SubstructureRedirectMask,
508FocusChangeMask, PropertyChangeMask, ColormapChangeMask, OwnerGrabButtonMask
509
510=item urxvt::KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify,
511EnterNotify, LeaveNotify, FocusIn, FocusOut, KeymapNotify, Expose,
512GraphicsExpose, NoExpose, VisibilityNotify, CreateNotify, DestroyNotify,
513UnmapNotify, MapNotify, MapRequest, ReparentNotify, ConfigureNotify,
514ConfigureRequest, GravityNotify, ResizeRequest, CirculateNotify,
515CirculateRequest, PropertyNotify, SelectionClear, SelectionRequest,
516SelectionNotify, ColormapNotify, ClientMessage, MappingNotify
483 517
484Various constants for use in X calls and event processing. 518Various constants for use in X calls and event processing.
485 519
486=back 520=back
487 521
555 delete $ENV{CDPATH}; 589 delete $ENV{CDPATH};
556 delete $ENV{BASH_ENV}; 590 delete $ENV{BASH_ENV};
557 $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin"; 591 $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin";
558} 592}
559 593
560my @hook_count;
561my $verbosity = $ENV{URXVT_PERL_VERBOSITY}; 594my $verbosity = $ENV{URXVT_PERL_VERBOSITY};
562 595
563sub verbose { 596sub verbose {
564 my ($level, $msg) = @_; 597 my ($level, $msg) = @_;
565 warn "$msg\n" if $level <= $verbosity; 598 warn "$msg\n" if $level <= $verbosity;
653 verbose 11, "$HOOKNAME[$htype] returning <$retval>" 686 verbose 11, "$HOOKNAME[$htype] returning <$retval>"
654 if $verbosity >= 11; 687 if $verbosity >= 11;
655 } 688 }
656 689
657 if ($htype == 1) { # DESTROY 690 if ($htype == 1) { # DESTROY
658 if (my $hook = delete $TERM->{_hook}) {
659 for my $htype (0..$#$hook) {
660 $hook_count[$htype] -= scalar keys %{ $hook->[$htype] || {} }
661 or set_should_invoke $htype, 0;
662 }
663 }
664
665 # clear package objects 691 # clear package objects
666 %$_ = () for values %{ $TERM->{_pkg} }; 692 %$_ = () for values %{ $TERM->{_pkg} };
667 693
668 # clear package 694 # clear package
669 %$TERM = (); 695 %$TERM = ();
695 while (my ($name, $cb) = each %hook) { 721 while (my ($name, $cb) = each %hook) {
696 my $htype = $HOOKTYPE{uc $name}; 722 my $htype = $HOOKTYPE{uc $name};
697 defined $htype 723 defined $htype
698 or Carp::croak "unsupported hook type '$name'"; 724 or Carp::croak "unsupported hook type '$name'";
699 725
726 $self->set_should_invoke ($htype, +1)
700 unless (exists $self->{term}{_hook}[$htype]{$pkg}) { 727 unless exists $self->{term}{_hook}[$htype]{$pkg};
701 $hook_count[$htype]++
702 or urxvt::set_should_invoke $htype, 1;
703 }
704 728
705 $self->{term}{_hook}[$htype]{$pkg} = $cb; 729 $self->{term}{_hook}[$htype]{$pkg} = $cb;
706 } 730 }
707} 731}
708 732
713 for my $name (@hook) { 737 for my $name (@hook) {
714 my $htype = $HOOKTYPE{uc $name}; 738 my $htype = $HOOKTYPE{uc $name};
715 defined $htype 739 defined $htype
716 or Carp::croak "unsupported hook type '$name'"; 740 or Carp::croak "unsupported hook type '$name'";
717 741
742 $self->set_should_invoke ($htype, -1)
718 if (delete $self->{term}{_hook}[$htype]{$pkg}) { 743 if delete $self->{term}{_hook}[$htype]{$pkg};
719 --$hook_count[$htype]
720 or urxvt::set_should_invoke $htype, 0;
721 }
722 } 744 }
723} 745}
724 746
725our $AUTOLOAD; 747our $AUTOLOAD;
726 748
1131 1153
1132=item $windowid = $term->vt 1154=item $windowid = $term->vt
1133 1155
1134Return the window id of the terminal window. 1156Return the window id of the terminal window.
1135 1157
1158=item $term->vt_emask_add ($x_event_mask)
1159
1160Adds the specified events to the vt event mask. Useful e.g. when you want
1161to receive pointer events all the times:
1162
1163 $term->vt_emask_add (urxvt::PointerMotionMask);
1164
1136=item $window_width = $term->width 1165=item $window_width = $term->width
1137 1166
1138=item $window_height = $term->height 1167=item $window_height = $term->height
1139 1168
1140=item $font_width = $term->fwidth 1169=item $font_width = $term->fwidth

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines