--- rxvt-unicode/src/urxvt.pm 2006/01/12 05:37:34 1.87
+++ rxvt-unicode/src/urxvt.pm 2006/01/13 01:09:37 1.91
@@ -50,7 +50,25 @@
A double-click usually selects the word under the cursor, further clicks
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:
=over 4
@@ -88,9 +106,40 @@
additionally stores the first match in the current line into the primary
selection.
-=item digital-clock
+=item 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 C
+operator) that modify C<$_> as resources:
+
+ URxvt.selection-autotransform.0: transform
+ URxvt.selection-autotransform.1: transform
+ ...
+
+For example, the following will transform selections of the form
+C, often seen in compiler messages, into C:
+
+ URxvt.selection-autotransform.0: s/^(\\S+):(\\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/^(S+):(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.
=item mark-urls
@@ -105,6 +154,10 @@
by replacing all line-drawing characters (U+2500 .. U+259F) by a
similar-looking ascii character.
+=item digital-clock
+
+Displays a digital clock using the built-in overlay.
+
=item example-refresh-hooks
Displays a very simple digital clock in the upper right corner of the