--- rxvt-unicode/doc/rxvtperl.3.html 2006/01/12 05:37:34 1.25 +++ rxvt-unicode/doc/rxvtperl.3.html 2006/01/13 12:40:46 1.29 @@ -1,7 +1,7 @@ -rxvtperl - rxvt-unicode's embedded perl interpreter +urxvtperl - rxvt-unicode's embedded perl interpreter @@ -47,7 +47,7 @@


NAME

-

rxvtperl - rxvt-unicode's embedded perl interpreter

+

urxvtperl - rxvt-unicode's embedded perl interpreter


@@ -60,9 +60,9 @@ () }
-   # start a rxvt using it:
+ # start a urxvt using it:
-   rxvt --perl-lib $HOME -pe grab_test
+ urxvt --perl-lib $HOME -pe grab_test


@@ -71,17 +71,17 @@ the perl resource are loaded and associated with it.

Scripts are compiled in a 'use strict' and 'use utf8' environment, and thus must be encoded as UTF-8.

-

Each script will only ever be loaded once, even in rxvtd, where +

Each script will only ever be loaded once, even in urxvtd, where scripts will be shared (but not enabled) for all terminals.


PREPACKAGED EXTENSIONS

This section describes the extensions delivered with this release. You can -find them in /opt/rxvt/lib/urxvt/perl/.

+find them in /usr/local/lib/urxvt/perl/.

You can activate them like this:

-  rxvt -pe <extensionname>
+ urxvt -pe <extensionname>
selection (enabled by default)
@@ -97,7 +97,32 @@ will enlarge the selection.

-

It also offers the following bindable keyboard command:

+

The selection works by trying to match a number of regexes and displaying +them in increasing order of length. You can add your own regexes by +specifying resources of the form:

+
+
+
+   URxvt.selection.pattern-0: perl-regex
+   URxvt.selection.pattern-1: perl-regex
+   ...
+
+
+

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 +between two vertical bars:

+
+
+
+   URxvt.selection.pattern-0: \\|([^|]+)\\|
+
+
+

You can look at the source of the selection extension to see more +interesting uses, such as parsing a line from beginning to end.

+
+
+

This extension also offers the following bindable keyboard command:

rot13
@@ -143,10 +168,55 @@ selection.

-
digital-clock
+
selection-autotransform
-Displays a digital clock using the built-in overlay. +This selection allows you to do automatic transforms on a selection +whenever a selection is made. +
+
+

It works by specifying perl snippets (most useful is a single s/// +operator) that modify $_ as resources:

+
+
+
+   URxvt.selection-autotransform.0: transform
+   URxvt.selection-autotransform.1: transform
+   ...
+
+
+

For example, the following will transform selections of the form +filename:number, often seen in compiler messages, into vi +$filename +$word:

+
+
+
+   URxvt.selection-autotransform.0: s/^([^:[:space:]]+):(\\d+):?$/vi +$2 \\Q$1\\E\\x0d/
+
+
+

And this example matches the same,but replaces it with vi-commands you can +paste directly into your (vi :) editor:

+
+
+
+   URxvt.selection-autotransform.0: s/^([^:[:space:]]+(\\d+):?$/\\x1b:e \\Q$1\\E\\x0d:$2\\x0d/
+
+
+

Of course, this can be modified to suit your needs and your editor :)

+
+
+

To expand the example above to typical perl error messages (``XXX at +FILENAME line YYY.''), you need a slightly more elaborate solution:

+
+
+
+   URxvt.selection.pattern-0: ( at .*? line \\d+\\.)
+   URxvt.selection-autotransform.0: s/^ at (.*?) line (\\d+)\\.$/\x1b:e \\Q$1\E\\x0d:$2\\x0d/
+
+
+

The first line tells the selection code to treat the unchanging part of +every error message as a selection pattern, and the second line transforms +the message into vi commands to load the file.

mark-urls
@@ -166,6 +236,12 @@ similar-looking ascii character.

+
digital-clock
+
+
+Displays a digital clock using the built-in overlay. +
+

example-refresh-hooks
@@ -415,7 +491,15 @@
Called whenever the user presses a key combination that has a perl:string action bound to it (see description of the keysym -resource in the rxvt(1) manpage). +resource in the urxvt(1) manpage). +
+

+
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.

on_focus_in $term
@@ -540,6 +624,22 @@ Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask, AnyModifier
+
urxvt::NoEventMask, KeyPressMask, KeyReleaseMask, +ButtonPressMask, ButtonReleaseMask, EnterWindowMask, LeaveWindowMask, +PointerMotionMask, PointerMotionHintMask, Button1MotionMask, Button2MotionMask, +Button3MotionMask, Button4MotionMask, Button5MotionMask, ButtonMotionMask, +KeymapStateMask, ExposureMask, VisibilityChangeMask, StructureNotifyMask, +ResizeRedirectMask, SubstructureNotifyMask, SubstructureRedirectMask, +FocusChangeMask, PropertyChangeMask, ColormapChangeMask, OwnerGrabButtonMask
+
+
urxvt::KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify, +EnterNotify, LeaveNotify, FocusIn, FocusOut, KeymapNotify, Expose, +GraphicsExpose, NoExpose, VisibilityNotify, CreateNotify, DestroyNotify, +UnmapNotify, MapNotify, MapRequest, ReparentNotify, ConfigureNotify, +ConfigureRequest, GravityNotify, ResizeRequest, CirculateNotify, +CirculateRequest, PropertyNotify, SelectionClear, SelectionRequest, +SelectionNotify, ColormapNotify, ClientMessage, MappingNotify
+
Various constants for use in X calls and event processing.
@@ -637,7 +737,7 @@
Destroy the terminal object (close the window, free resources -etc.). Please note that rxvt will not exit as long as any event +etc.). Please note that urxvt will not exit as long as any event watchers (timers, io watchers) are still active.

@@ -722,7 +822,7 @@
Adds a keymap translation exactly as specified via a resource. See the -keysym resource in the rxvt(1) manpage. +keysym resource in the urxvt(1) manpage.

$rend = $term->rstyle ([$new_rstyle])
@@ -923,6 +1023,17 @@ Return the window id of the terminal window.

+
$term->vt_emask_add ($x_event_mask)
+
+
+Adds the specified events to the vt event mask. Useful e.g. when you want +to receive pointer events all the times: +
+
+
+   $term->vt_emask_add (urxvt::PointerMotionMask);
+
+

$window_width = $term->width
$window_height = $term->height