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.80 by root, Thu Jan 12 00:11:59 2006 UTC vs.
Revision 1.86 by root, Thu Jan 12 05:22:47 2006 UTC

85Displays a digital clock using the built-in overlay. 85Displays a digital clock using the built-in overlay.
86 86
87=item mark-urls 87=item mark-urls
88 88
89Uses per-line display filtering (C<on_line_update>) to underline urls and 89Uses per-line display filtering (C<on_line_update>) to underline urls and
90make them clickable. When clicked, the program specified in the resource 90make them clickable. When middle-clicked, the program specified in the
91C<urlLauncher> (default C<x-www-browser>) will be started. 91resource C<urlLauncher> (default C<x-www-browser>) will be started.
92 92
93=item block-graphics-to-ascii 93=item block-graphics-to-ascii
94 94
95A not very useful example of filtering all text output to the terminal, 95A not very useful example of filtering all text output to the terminal,
96by replacing all line-drawing characters (U+2500 .. U+259F) by a 96by replacing all line-drawing characters (U+2500 .. U+259F) by a
230=item on_sel_extend $term 230=item on_sel_extend $term
231 231
232Called whenever the user tries to extend the selection (e.g. with a double 232Called whenever the user tries to extend the selection (e.g. with a double
233click) and is either supposed to return false (normal operation), or 233click) and is either supposed to return false (normal operation), or
234should extend the selection itelf and return true to suppress the built-in 234should extend the selection itelf and return true to suppress the built-in
235processing. 235processing. This can happen multiple times, as long as the callback
236returns true, it will be called on every further click by the user and is
237supposed to enlarge the selection more and more, if possible.
236 238
237See the F<selection> example extension. 239See the F<selection> example extension.
238 240
239=item on_view_change $term, $offset 241=item on_view_change $term, $offset
240 242
496 $msg .= "\n" 498 $msg .= "\n"
497 unless $msg =~ /\n$/; 499 unless $msg =~ /\n$/;
498 urxvt::warn ($msg); 500 urxvt::warn ($msg);
499 }; 501 };
500 502
503 # %ENV is the original startup environment
501# delete $ENV{IFS}; 504 delete $ENV{IFS};
502# delete $ENV{CDPATH}; 505 delete $ENV{CDPATH};
503# delete $ENV{BASH_ENV}; 506 delete $ENV{BASH_ENV};
504# $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin"; 507 $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin";
505} 508}
506 509
507my @hook_count; 510my @hook_count;
508my $verbosity = $ENV{URXVT_PERL_VERBOSITY}; 511my $verbosity = $ENV{URXVT_PERL_VERBOSITY};
509 512
594 if ($@) { 597 if ($@) {
595 $TERM->ungrab; # better to lose the grab than the session 598 $TERM->ungrab; # better to lose the grab than the session
596 warn $@; 599 warn $@;
597 } 600 }
598 } 601 }
602
603 verbose 11, "$HOOKNAME[$htype] returning <$retval>"
604 if $verbosity >= 11;
599 } 605 }
600 606
601 if ($htype == 1) { # DESTROY 607 if ($htype == 1) { # DESTROY
602 if (my $hook = delete $TERM->{_hook}) { 608 if (my $hook = delete $TERM->{_hook}) {
603 for my $htype (0..$#$hook) { 609 for my $htype (0..$#$hook) {
612 # clear package 618 # clear package
613 %$TERM = (); 619 %$TERM = ();
614 } 620 }
615 621
616 $retval 622 $retval
623}
624
625sub exec_async(@) {
626 my $pid = fork;
627
628 return
629 if !defined $pid or $pid;
630
631 %ENV = %{ $TERM->env };
632
633 exec @_;
634 _exit 255;
617} 635}
618 636
619# urxvt::term::extension 637# urxvt::term::extension
620 638
621package urxvt::term::extension; 639package urxvt::term::extension;
897=item ($row, $col) = $term->selection_end ([$row, $col]) 915=item ($row, $col) = $term->selection_end ([$row, $col])
898 916
899Return the current values of the selection mark, begin or end positions, 917Return the current values of the selection mark, begin or end positions,
900and optionally set them to new values. 918and optionally set them to new values.
901 919
920=item $term->selection_make ($eventtime[, $rectangular])
921
922Tries to make a selection as set by C<selection_beg> and
923C<selection_end>. If C<$rectangular> is true (default: false), a
924rectangular selection will be made. This is the prefered function to make
925a selection.
926
902=item $success = $term->selection_grab ($eventtime) 927=item $success = $term->selection_grab ($eventtime)
903 928
904Try to request the primary selection from the server (for example, as set 929Try to request the primary selection text from the server (for example, as
905by the next method). 930set by the next method). No visual feedback will be given. This function
931is mostly useful from within C<on_sel_grab> hooks.
906 932
907=item $oldtext = $term->selection ([$newtext]) 933=item $oldtext = $term->selection ([$newtext])
908 934
909Return the current selection text and optionally replace it by C<$newtext>. 935Return the current selection text and optionally replace it by C<$newtext>.
910 936
1003Convert the given locale-encoded octets into a perl string. 1029Convert the given locale-encoded octets into a perl string.
1004 1030
1005=item $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) 1031=item $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle])
1006 1032
1007XORs the rendition values in the given span with the provided value 1033XORs the rendition values in the given span with the provided value
1008(default: C<RS_RVid>). Useful in refresh hooks to provide effects similar 1034(default: C<RS_RVid>), which I<MUST NOT> contain font styles. Useful in
1009to the selection. 1035refresh hooks to provide effects similar to the selection.
1010 1036
1011=item $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]]) 1037=item $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]])
1012 1038
1013Similar to C<scr_xor_span>, but xors a rectangle instead. Trailing 1039Similar to C<scr_xor_span>, but xors a rectangle instead. Trailing
1014whitespace will additionally be xored with the C<$rstyle2>, which defaults 1040whitespace will additionally be xored with the C<$rstyle2>, which defaults
1015to C<RS_RVid | RS_Uline>, which removes reverse video again and underlines 1041to C<RS_RVid | RS_Uline>, which removes reverse video again and underlines
1016it instead. 1042it instead. Both styles I<MUST NOT> contain font styles.
1017 1043
1018=item $term->scr_bell 1044=item $term->scr_bell
1019 1045
1020Ring the bell! 1046Ring the bell!
1021 1047
1205Return the row number of the first/last row of the line, respectively. 1231Return the row number of the first/last row of the line, respectively.
1206 1232
1207=item $offset = $line->offset_of ($row, $col) 1233=item $offset = $line->offset_of ($row, $col)
1208 1234
1209Returns the character offset of the given row|col pair within the logical 1235Returns the character offset of the given row|col pair within the logical
1210line. 1236line. Works for rows outside the line, too, and returns corresponding
1237offsets outside the string.
1211 1238
1212=item ($row, $col) = $line->coord_of ($offset) 1239=item ($row, $col) = $line->coord_of ($offset)
1213 1240
1214Translates a string offset into terminal coordinates again. 1241Translates a string offset into terminal coordinates again.
1215 1242
1570 1597
1571=item == 0 - fatal messages 1598=item == 0 - fatal messages
1572 1599
1573=item >= 3 - script loading and management 1600=item >= 3 - script loading and management
1574 1601
1575=item >=10 - all events received 1602=item >=10 - all called hooks
1603
1604=item >=11 - hook reutrn values
1576 1605
1577=back 1606=back
1578 1607
1579=head1 AUTHOR 1608=head1 AUTHOR
1580 1609

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines