--- rxvt-unicode/src/urxvt.pm 2006/01/24 19:14:36 1.126 +++ rxvt-unicode/src/urxvt.pm 2008/05/10 22:36:46 1.165 @@ -19,7 +19,7 @@ =head1 DESCRIPTION -Everytime a terminal object gets created, extension scripts specified via +Every time a terminal object gets created, extension scripts specified via the C resource are loaded and associated with it. Scripts are compiled in a 'use strict' and 'use utf8' environment, and @@ -28,6 +28,9 @@ Each script will only ever be loaded once, even in @@RXVT_NAME@@d, where scripts will be shared (but not enabled) for all terminals. +You can disable the embedded perl interpreter by setting both "perl-ext" +and "perl-ext-common" resources to the empty string. + =head1 PREPACKAGED EXTENSIONS This section describes the extensions delivered with this release. You can @@ -39,7 +42,7 @@ Or by adding them to the resource for extensions loaded by default: - URxvt.perl-ext-common: default,automove-background,selection-autotransform + URxvt.perl-ext-common: default,selection-autotransform =over 4 @@ -64,7 +67,7 @@ The index number (0, 1...) must not have any holes, and each regex must contain at least one pair of capturing parentheses, which will be used for -the match. For example, the followign adds a regex that matches everything +the match. For example, the following adds a regex that matches everything between two vertical bars: URxvt.selection.pattern-0: \\|([^|]+)\\| @@ -96,6 +99,23 @@ Binds a popup menu to Ctrl-Button2 that lets you toggle (some) options at runtime. +Other extensions can extend this popup menu by pushing a code reference +onto C<@{ $term->{option_popup_hook} }>, which gets called whenever the +popup is being displayed. + +Its sole argument is the popup menu, which can be modified. It should +either return nothing or a string, the initial boolean value and a code +reference. The string will be used as button text and the code reference +will be called when the toggle changes, with the new boolean value as +first argument. + +The following will add an entry C that changes +C<$self->{myoption}>: + + push @{ $self->{term}{option_popup_hook} }, sub { + ("my option" => $myoption, sub { $self->{myoption} = $_[0] }) + }; + =item selection-popup (enabled by default) Binds a popup menu to Ctrl-Button3 that lets you convert the selection @@ -103,11 +123,11 @@ evaluation, web-browser starting etc.), depending on content. Other extensions can extend this popup menu by pushing a code reference -onto C<@{ $term->{selection_popup_hook} }>, that is called whenever the -popup is displayed. +onto C<@{ $term->{selection_popup_hook} }>, which gets called whenever the +popup is being displayed. -It's sole argument is the popup menu, which can be modified. The selection -is in C<$_>, which can be used to decide wether to add something or not. +Its sole argument is the popup menu, which can be modified. The selection +is in C<$_>, which can be used to decide whether to add something or not. It should either return nothing or a string and a code reference. The string will be used as button text and the code reference will be called when the button gets activated and should transform C<$_>. @@ -117,7 +137,7 @@ Cs: push @{ $self->{term}{selection_popup_hook} }, sub { - /a/ ? ("a to be" => sub { s/a/b/g } + /a/ ? ("a to b" => sub { s/a/b/g } : () }; @@ -134,14 +154,20 @@ bottom. C leaves search mode and returns to the point where search was started, while C or C stay at the current position and additionally stores the first match in the current line into the primary -selection. +selection if the C modifier is active. + +The regex defaults to "(?i)", resulting in a case-insensitive search. To +get a case-sensitive search you can delete this prefix using C +or simply use an uppercase character which removes the "(?i)" prefix. + +See L for more info about perl regular expression syntax. =item readline (enabled by default) -A support package that tries to make editing with readline easier. At the -moment, it reacts to clicking with the left mouse button by trying to +A support package that tries to make editing with readline easier. At +the moment, it reacts to clicking shift-left mouse button by trying to move the text cursor to this position. It does so by generating as many -cursor-left or cursor-right keypresses as required (the this only works +cursor-left or cursor-right keypresses as required (this only works for programs that correctly support wide characters). To avoid too many false positives, this is only done when: @@ -199,7 +225,7 @@ =item tabbed This transforms the terminal into a tabbar with additional terminals, that -is, it implements what is commonly refered to as "tabbed terminal". The topmost line +is, it implements what is commonly referred to as "tabbed terminal". The topmost line displays a "[NEW]" button, which, when clicked, will add a new tab, followed by one button per tab. @@ -207,24 +233,81 @@ B will switch to the tab left or right of the current one, while B creates a new tab. -=item mark-urls +The tabbar itself can be configured similarly to a normal terminal, but +with a resource class of C. In addition, it supports the +following four resources (shown with defaults): + + URxvt.tabbed.tabbar-fg: + URxvt.tabbed.tabbar-bg: + URxvt.tabbed.tab-fg: + URxvt.tabbed.tab-bg: + +See I in the @@RXVT_NAME@@(1) manpage for valid +indices. + +=item matcher + +Uses per-line display filtering (C) to underline text +matching a certain pattern and make it clickable. When clicked with the +mouse button specified in the C resource (default 2, or +middle), the program specified in the C resource +(default, the C resource, C) will be started +with the matched text as first argument. The default configuration is +suitable for matching URLs and launching a web browser, like the +former "mark-urls" extension. + +The default pattern to match URLs can be overridden with the +C resource, and additional patterns can be specified +with numbered patterns, in a manner similar to the "selection" extension. +The launcher can also be overridden on a per-pattern basis. + +It is possible to activate the most recently seen match from the keyboard. +Simply bind a keysym to "perl:matcher" as seen in the example below. + +Example configuration: + + URxvt.perl-ext: default,matcher + URxvt.urlLauncher: sensible-browser + URxvt.keysym.C-Delete: perl:matcher + URxvt.matcher.button: 1 + URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] + URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) + URxvt.matcher.launcher.2: gvim +$2 $1 + +=item xim-onthespot + +This (experimental) perl extension implements OnTheSpot editing. It does +not work perfectly, and some input methods don't seem to work well with +OnTheSpot editing in general, but it seems to work at least for SCIM and +kinput2. + +You enable it by specifying this extension and a preedit style of +C, i.e.: + + @@RXVT_NAME@@ -pt OnTheSpot -pe xim-onthespot -Uses per-line display filtering (C) to underline urls and -make them clickable. When middle-clicked, the program specified in the -resource C (default C) will be started with -the URL as first argument. +=item kuake -=item automove-background +A very primitive quake-console-like extension. It was inspired by a +description of how the programs C and C work: Whenever the +user presses a global accelerator key (by default C), the terminal +will show or hide itself. Another press of the accelerator key will hide +or show it again. -This is basically a one-line extension that dynamically changes the background pixmap offset -to the window position, in effect creating the same effect as pseudo transparency with -a custom pixmap. No scaling is supported in this mode. Exmaple: +Initially, the window will not be shown when using this extension. - @@RXVT_NAME@@ -pixmap background.xpm -pe automove-background +This is useful if you need a single terminal that is not using any desktop +space most of the time but is quickly available at the press of a key. + +The accelerator key is grabbed regardless of any modifiers, so this +extension will actually grab a physical key just for this function. + +If you want a quake-like animation, tell your window manager to do so +(fvwm can do it). =item block-graphics-to-ascii -A not very useful example of filtering all text output to the terminal, +A not very useful example of filtering all text output to the terminal by replacing all line-drawing characters (U+2500 .. U+259F) by a similar-looking ascii character. @@ -232,11 +315,25 @@ Displays a digital clock using the built-in overlay. -=item example-refresh-hooks +=item remote-clipboard -Displays a very simple digital clock in the upper right corner of the -window. Illustrates overwriting the refresh callbacks to create your own -overlays or changes. +Somewhat of a misnomer, this extension adds two menu entries to the +selection popup that allows one to run external commands to store the +selection somewhere and fetch it again. + +We use it to implement a "distributed selection mechanism", which just +means that one command uploads the file to a remote server, and another +reads it. + +The commands can be set using the C and +C resources. The first should read the +selection to store from STDIN (always in UTF-8), the second should provide +the selection data on STDOUT (also in UTF-8). + +The defaults (which are likely useless to you) use rsh and cat: + + URxvt.remote-selection.store: rsh ruth 'cat >/tmp/distributed-selection' + URxvt.remote-selection.fetch: rsh ruth 'cat /tmp/distributed-selection' =item selection-pastebin @@ -267,6 +364,17 @@ URxvt.selection-pastebin.url: http://www.ta-sa.org/files/txt/% +I xrdb uses the C preprocessor, which might interpret +the double C characters as comment start. Use C<\057\057> instead, +which works regardless of wether xrdb is used to parse the resource file +or not. + +=item example-refresh-hooks + +Displays a very simple digital clock in the upper right corner of the +window. Illustrates overwriting the refresh callbacks to create your own +overlays or changes. + =back =head1 API DOCUMENTATION @@ -309,12 +417,13 @@ =head2 Extension Objects -Very perl extension is a perl class. A separate perl object is created -for each terminal and each extension and passed as the first parameter to -hooks. So extensions can use their C<$self> object without having to think -about other extensions, with the exception of methods and members that -begin with an underscore character C<_>: these are reserved for internal -use. +Every perl extension is a perl class. A separate perl object is created +for each terminal, and each terminal has its own set of extenion objects, +which are passed as the first parameter to hooks. So extensions can use +their C<$self> object without having to think about clashes with other +extensions or other terminals, with the exception of methods and members +that begin with an underscore character C<_>: these are reserved for +internal use. Although it isn't a C object, you can call all methods of the C class on this object. @@ -345,7 +454,7 @@ The following subroutines can be declared in extension files, and will be called whenever the relevant event happens. -The first argument passed to them is an extension oject as described in +The first argument passed to them is an extension object as described in the in the C section. B of these hooks must return a boolean value. If any of the called @@ -368,13 +477,12 @@ =item on_start $term Called at the very end of initialisation of a new terminal, just before -trying to map (display) the toplevel and returning to the mainloop. +trying to map (display) the toplevel and returning to the main loop. =item on_destroy $term -Called whenever something tries to destroy terminal, before doing anything -yet. If this hook returns true, then destruction is skipped, but this is -rarely a good idea. +Called whenever something tries to destroy terminal, when the terminal is +still fully functional (not for long, though). =item on_reset $term @@ -406,13 +514,13 @@ requested from the server. The selection text can be queried and changed by calling C<< $term->selection >>. -Returning a true value aborts selection grabbing. It will still be hilighted. +Returning a true value aborts selection grabbing. It will still be highlighted. =item on_sel_extend $term Called whenever the user tries to extend the selection (e.g. with a double click) and is either supposed to return false (normal operation), or -should extend the selection itelf and return true to suppress the built-in +should extend the selection itself and return true to suppress the built-in processing. This can happen multiple times, as long as the callback returns true, it will be called on every further click by the user and is supposed to enlarge the selection more and more, if possible. @@ -421,7 +529,7 @@ =item on_view_change $term, $offset -Called whenever the view offset changes, i..e the user or program +Called whenever the view offset changes, i.e. the user or program scrolls. Offset C<0> means display the normal terminal, positive values show this many lines of scrollback. @@ -435,7 +543,17 @@ $nrow - 1) represent the lines to be scrolled out). C<$saved> is the total number of lines that will be in the scrollback buffer. -=item on_osc_seq $term, $string +=item on_osc_seq $term, $op, $args + +Called on every OSC sequence and can be used to suppress it or modify its +behaviour. The default should be to return an empty list. A true value +suppresses execution of the request completely. Make sure you don't get +confused by recursive invocations when you output an osc sequence within +this callback. + +C should be used for new behaviour. + +=item on_osc_seq_perl $term, $string Called whenever the B command sequence (OSC = operating system command) is processed. Cursor position and other state @@ -445,7 +563,7 @@ future. Be careful not ever to trust (in a security sense) the data you receive, -as its source can not easily be controleld (e-mail content, messages from +as its source can not easily be controlled (e-mail content, messages from other users on the same system etc.). =item on_add_lines $term, $string @@ -486,18 +604,31 @@ Called just after the screen gets redrawn. See C. -=item on_keyboard_command $term, $string +=item on_user_command $term, $string -Called whenever the user presses a key combination that has a -C action bound to it (see description of the B +Called whenever a user-configured event is being activated (e.g. via +a C action bound to a key, see description of the B resource in the @@RXVT_NAME@@(1) manpage). +The event is simply the action string. This interface is assumed to change +slightly in the future. + +=item on_resize_all_windows $tern, $new_width, $new_height + +Called just after the new window size has been calculated, but before +windows are actually being resized or hints are being set. If this hook +returns TRUE, setting of the window hints is being skipped. + =item on_x_event $term, $event Called on every X event received on the vt window (and possibly other windows). Should only be used as a last resort. Most event structure members are not passed. +=item on_root_event $term, $event + +Like C, but is called for events on the root window. + =item on_focus_in $term Called whenever the window gets the keyboard focus, before rxvt-unicode @@ -505,7 +636,7 @@ =item on_focus_out $term -Called wheneever the window loses keyboard focus, before rxvt-unicode does +Called whenever the window loses keyboard focus, before rxvt-unicode does focus out processing. =item on_configure_notify $term, $event @@ -598,12 +729,12 @@ =item @urxvt::TERM_INIT -All coderefs in this array will be called as methods of the next newly +All code references in this array will be called as methods of the next newly created C object (during the C phase). The array -gets cleared before the codereferences that were in it are being executed, -so coderefs can push themselves onto it again if they so desire. +gets cleared before the code references that were in it are being executed, +so references can push themselves onto it again if they so desire. -This complements to the perl-eval commandline option, but gets executed +This complements to the perl-eval command line option, but gets executed first. =item @urxvt::TERM_EXT @@ -635,6 +766,13 @@ Messages have a size limit of 1023 bytes currently. +=item @terms = urxvt::termlist + +Returns all urxvt::term objects that exist in this process, regardless of +whether they are started, being destroyed etc., so be careful. Only term +objects that have perl extensions attached will be returned (because there +is no urxvt::term objet associated with others). + =item $time = urxvt::NOW Returns the "current time" (as per the event loop). @@ -702,6 +840,8 @@ =item $rend = urxvt::SET_BGCOLOR $rend, $new_colour +=item $rend = urxvt::SET_COLOR $rend, $new_fg, $new_bg + Replace the foreground/background colour in the rendition mask with the specified one. @@ -777,7 +917,7 @@ if ($htype == 0) { # INIT my @dirs = ((split /:/, $TERM->resource ("perl_lib")), "$LIBDIR/perl"); - + my %ext_arg; { @@ -801,11 +941,11 @@ } } - while (my ($ext, $argv) = each %ext_arg) { + for my $ext (sort keys %ext_arg) { my @files = grep -f $_, map "$_/$ext", @dirs; if (@files) { - $TERM->register_package (extension_package $files[0], $argv); + $TERM->register_package (extension_package $files[0], $ext_arg{$ext}); } else { warn "perl extension '$ext' not found in perl library search path\n"; } @@ -821,10 +961,8 @@ verbose 10, "$HOOKNAME[$htype] (" . (join ", ", $TERM, @_) . ")" if $verbosity >= 10; - keys %$cb; - - while (my ($pkg, $cb) = each %$cb) { - my $retval_ = eval { $cb->($TERM->{_pkg}{$pkg}, @_) }; + for my $pkg (keys %$cb) { + my $retval_ = eval { $cb->{$pkg}->($TERM->{_pkg}{$pkg}, @_) }; $retval ||= $retval_; if ($@) { @@ -848,6 +986,35 @@ $retval } +sub SET_COLOR($$$) { + SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) +} + +sub rend2mask { + no strict 'refs'; + my ($str, $mask) = (@_, 0); + my %color = ( fg => undef, bg => undef ); + my @failed; + for my $spec ( split /\s+/, $str ) { + if ( $spec =~ /^([fb]g)[_:-]?(\d+)/i ) { + $color{lc($1)} = $2; + } else { + my $neg = $spec =~ s/^[-^]//; + unless ( exists &{"RS_$spec"} ) { + push @failed, $spec; + next; + } + my $cur = &{"RS_$spec"}; + if ( $neg ) { + $mask &= ~$cur; + } else { + $mask |= $cur; + } + } + } + ($mask, @color{qw(fg bg)}, \@failed) +} + # urxvt::term::extension package urxvt::term::extension; @@ -926,7 +1093,7 @@ =cut -our $VERSION = 1; +our $VERSION = '3.4'; $INC{"urxvt/anyevent.pm"} = 1; # mark us as there push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::]; @@ -967,18 +1134,8 @@ $_[0][1]->stop; } -sub condvar { - bless \my $flag, urxvt::anyevent::condvar:: -} - -sub urxvt::anyevent::condvar::broadcast { - ${$_[0]}++; -} - -sub urxvt::anyevent::condvar::wait { - unless (${$_[0]}) { - Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API"; - } +sub one_event { + Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API"; } package urxvt::term; @@ -1024,14 +1181,18 @@ Croaks (and probably outputs an error message) if the new instance couldn't be created. Returns C if the new instance didn't initialise perl, and the terminal object otherwise. The C and -C hooks will be called during this call. +C hooks will be called before this call returns, and are free to +refer to global data (which is race free). =cut sub new { my ($class, $env, @args) = @_; - _new ([ map "$_=$env->{$_}", keys %$env ], @args); + $env or Carp::croak "environment hash missing in call to urxvt::term->new"; + @args or Carp::croak "name argument missing in call to urxvt::term->new"; + + _new ([ map "$_=$env->{$_}", keys %$env ], \@args); } =item $term->destroy @@ -1071,7 +1232,7 @@ optionally change it. All option values are stored by name in the hash C<%urxvt::OPTION>. Options not enabled in this binary are not in the hash. -Here is a a likely non-exhaustive list of option names, please see the +Here is a likely non-exhaustive list of option names, please see the source file F to see the actual list: borderLess console cursorBlink cursorUnderline hold iconic insecure @@ -1098,7 +1259,7 @@ Please note that resource strings will currently only be freed when the terminal is destroyed, so changing options frequently will eat memory. -Here is a a likely non-exhaustive list of resource names, not all of which +Here is a likely non-exhaustive list of resource names, not all of which are supported in every build, please see the source file F to see the actual list: @@ -1112,7 +1273,7 @@ preeditType print_pipe pty_fd reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle - secondaryScreen secondaryScroll selectstyle shade term_name title + secondaryScreen secondaryScroll shade term_name title transient_for transparent transparent_all tripleclickwords utmpInhibit visualBell @@ -1341,6 +1502,16 @@ $term->vt_emask_add (urxvt::PointerMotionMask); +=item $term->focus_in + +=item $term->focus_out + +=item $term->key_press ($state, $keycode[, $time]) + +=item $term->key_release ($state, $keycode[, $time]) + +Deliver various fake events to to terminal. + =item $window_width = $term->width =item $window_height = $term->height @@ -1380,14 +1551,19 @@ Returns a copy of the environment in effect for the terminal as a hashref similar to C<\%ENV>. +=item @envv = $term->envv + +Returns the environment as array of strings of the form C. + +=item @argv = $term->argv + +Return the argument vector as this terminal, similar to @ARGV, but +includes the program name as first element. + =cut sub env { - if (my $env = $_[0]->_env) { - +{ map /^([^=]+)(?:=(.*))?$/s && ($1 => $2), @$env } - } else { - +{ %ENV } - } + +{ map /^([^=]+)(?:=(.*))?$/s && ($1 => $2), $_[0]->envv } } =item $modifiermask = $term->ModLevel3Mask @@ -1405,7 +1581,7 @@ =item $cursor_is_hidden = $term->hidden_cursor -Returns wether the cursor is currently hidden or not. +Returns whether the cursor is currently hidden or not. =item $view_start = $term->view_start ([$newvalue]) @@ -1437,7 +1613,7 @@ C<$text> is in a special encoding: tabs and wide characters that use more than one cell when displayed are padded with C<$urxvt::NOCHAR> (chr 65535) characters. Characters with combining characters and other characters that -do not fit into the normal tetx encoding will be replaced with characters +do not fit into the normal text encoding will be replaced with characters in the private use area. You have to obey this encoding when changing text. The advantage is @@ -1592,17 +1768,20 @@ =item $string = $term->special_decode $text -Converts rxvt-unicodes text reprsentation into a perl string. See +Converts rxvt-unicodes text representation into a perl string. See C<< $term->ROW_t >> for details. -=item $success = $term->grab_button ($button, $modifiermask) +=item $success = $term->grab_button ($button, $modifiermask[, $window = $term->vt]) + +=item $term->ungrab_button ($button, $modifiermask[, $window = $term->vt]) -Registers a synchronous button grab. See the XGrabButton manpage. +Register/unregister a synchronous button grab. See the XGrabButton +manpage. =item $success = $term->grab ($eventtime[, $sync]) Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or -synchronous (C<$sync> is true). Also remembers the grab timestampe. +synchronous (C<$sync> is true). Also remembers the grab timestamp. =item $term->allow_events_async @@ -1725,16 +1904,16 @@ $self->add_item ({ type => "button", text => $text, activate => $cb}); } -=item $popup->add_toggle ($text, $cb, $initial_value) +=item $popup->add_toggle ($text, $initial_value, $cb) -Adds a toggle/checkbox item to the popup. Teh callback gets called -whenever it gets toggled, with a boolean indicating its value as its first -argument. +Adds a toggle/checkbox item to the popup. The callback gets called +whenever it gets toggled, with a boolean indicating its new value as its +first argument. =cut sub add_toggle { - my ($self, $text, $cb, $value) = @_; + my ($self, $text, $value, $cb) = @_; my $item; $item = { type => "button", @@ -1763,14 +1942,21 @@ delete $env->{LC_ALL}; $env->{LC_CTYPE} = $self->{term}->locale; - urxvt::term->new ($env, "popup", - "--perl-lib" => "", "--perl-ext-common" => "", - "-pty-fd" => -1, "-sl" => 0, - "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect", - "--transient-for" => $self->{term}->parent, - "-display" => $self->{term}->display_id, - "-pe" => "urxvt-popup") - or die "unable to create popup window\n"; + my $term = urxvt::term->new ( + $env, "popup", + "--perl-lib" => "", "--perl-ext-common" => "", + "-pty-fd" => -1, "-sl" => 0, + "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect", + "--transient-for" => $self->{term}->parent, + "-display" => $self->{term}->display_id, + "-pe" => "urxvt-popup", + ) or die "unable to create popup window\n"; + + unless (delete $term->{urxvt_popup_init_done}) { + $term->ungrab; + $term->destroy; + die "unable to initialise popup window\n"; + } } sub DESTROY { @@ -1786,11 +1972,6 @@ package urxvt::watcher; -@urxvt::timer::ISA = __PACKAGE__; -@urxvt::iow::ISA = __PACKAGE__; -@urxvt::pw::ISA = __PACKAGE__; -@urxvt::iw::ISA = __PACKAGE__; - =head2 The C Class This class implements timer watchers/events. Time is represented as a @@ -1803,7 +1984,7 @@ ->cb (sub { $term->{overlay}->set (0, 0, sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]); - }); + }); =over 4 @@ -1856,7 +2037,7 @@ $term->{iow} = urxvt::iow ->new ->fd (fileno $term->{socket}) - ->events (urxvt::EVENT_READ) + ->events (urxvt::EV_READ) ->start ->cb (sub { my ($iow, $revents) = @_; @@ -1879,13 +2060,13 @@ =item $iow = $iow->fd ($fd) -Set the filedescriptor (not handle) to watch. +Set the file descriptor (not handle) to watch. =item $iow = $iow->events ($eventmask) Set the event mask to watch. The only allowed values are -C and C, which might be ORed -together, or C. +C and C, which might be ORed +together, or C. =item $iow = $iow->start @@ -1893,7 +2074,7 @@ =item $iow = $iow->stop -Stop watching for events on the given filehandle. +Stop watching for events on the given file handle. =back @@ -1936,7 +2117,7 @@ ->cb (sub { my ($pw, $exit_status) = @_; ... - }); + }); =over 4 @@ -1950,7 +2131,7 @@ =item $pw = $timer->start ($pid) -Tells the wqtcher to start watching for process C<$pid>. +Tells the watcher to start watching for process C<$pid>. =item $pw = $pw->stop @@ -1973,7 +2154,7 @@ =item >=10 - all called hooks -=item >=11 - hook reutrn values +=item >=11 - hook return values =back @@ -1985,3 +2166,5 @@ =cut 1 + +# vim: sw=3: