--- 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
- # start a rxvt using it:+ # start a urxvt using it:
- rxvt --perl-lib $HOME -pe grab_test+ urxvt --perl-lib $HOME -pe grab_test
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.
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>
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:
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.
perl:string
action bound to it (see description of the keysym
-resource in the rxvt(1)
manpage).
+resource in the urxvt(1)
manpage).
+keysym
resource in the rxvt(1)
manpage.
+keysym
resource in the urxvt(1)
manpage.
+ $term->vt_emask_add (urxvt::PointerMotionMask);+