--- rxvt-unicode/src/urxvt.pm 2006/01/12 12:05:28 1.88 +++ rxvt-unicode/src/urxvt.pm 2006/01/13 01:09:37 1.91 @@ -119,14 +119,27 @@ ... For example, the following will transform selections of the form -C into C: +C, often seen in compiler messages, into C: - URxvt.selection-autotransform.0: s/^(S+):(d+):?$/vi +$2 $1\\x0d/ + 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 directory into your (vi :) editor: +paste directly into your (vi :) editor: - URxvt.selection-autotransform.0: s/^(S+):(d+):?$/\\x1b:e $1\\x0d:$2\\x0d/ + 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