From 997c2bdb63b66491cc9018c8bc9fb2d975199705 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 13 Jan 2006 01:09:37 +0000 Subject: [PATCH] *** empty log message *** --- doc/rxvtperl.3.html | 14 ++++++++++++++ doc/rxvtperl.3.man.in | 14 +++++++++++++- doc/rxvtperl.3.txt | 10 ++++++++++ src/perl/selection-autotransform | 4 ++-- src/urxvt.pm | 10 ++++++++++ 5 files changed, 49 insertions(+), 3 deletions(-) diff --git a/doc/rxvtperl.3.html b/doc/rxvtperl.3.html index 7f56933c..88b9905a 100644 --- a/doc/rxvtperl.3.html +++ b/doc/rxvtperl.3.html @@ -204,6 +204,20 @@ paste directly into your (vi :) editor:

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
diff --git a/doc/rxvtperl.3.man.in b/doc/rxvtperl.3.man.in index ec48bd20..70b1de2e 100644 --- a/doc/rxvtperl.3.man.in +++ b/doc/rxvtperl.3.man.in @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "rxvt 3" -.TH rxvt 3 "2006-01-12" "7.0" "RXVT-UNICODE" +.TH rxvt 3 "2006-01-13" "7.0" "RXVT-UNICODE" .SH "NAME" @@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter .SH "SYNOPSIS" @@ -270,6 +270,18 @@ paste directly into your (vi :) editor: .Ve .Sp Of course, this can be modified to suit your needs and your editor :) +.Sp +To expand the example above to typical perl error messages (\*(L"\s-1XXX\s0 at +\&\s-1FILENAME\s0 line \s-1YYY\s0.\*(R"), you need a slightly more elaborate solution: +.Sp +.Vb 2 +\& URxvt.selection.pattern-0: ( at .*? line \e\ed+\e\e.) +\& URxvt.selection-autotransform.0: s/^ at (.*?) line (\e\ed+)\e\e.$/\ex1b:e \e\eQ$1\eE\e\ex0d:$2\e\ex0d/ +.Ve +.Sp +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. .IP "mark-urls" 4 .IX Item "mark-urls" Uses per-line display filtering (\f(CW\*(C`on_line_update\*(C'\fR) to underline urls and diff --git a/doc/rxvtperl.3.txt b/doc/rxvtperl.3.txt index 93287741..9adc7990 100644 --- a/doc/rxvtperl.3.txt +++ b/doc/rxvtperl.3.txt @@ -115,6 +115,16 @@ PREPACKAGED EXTENSIONS 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 Uses per-line display filtering ("on_line_update") to underline urls and make them clickable. When middle-clicked, the program specified diff --git a/src/perl/selection-autotransform b/src/perl/selection-autotransform index db829d51..6a80b596 100644 --- a/src/perl/selection-autotransform +++ b/src/perl/selection-autotransform @@ -20,6 +20,7 @@ sub on_init { } for (my $idx = 0; defined (my $res = urxvt::untaint $self->x_resource ("selection-autotransform.$idx")); $idx++) { + warn "<<<$idx:$res>>>\n";#d# my $transform = eval "sub { $res }"; if ($transform) { @@ -44,9 +45,8 @@ sub on_sel_grab { $self->selection ($_); s/[\x00-\x1f\x80-\x9f]/·/g; $self->msg ($self->special_encode ("auto-transformed to $_")); + last; } - - last; } () diff --git a/src/urxvt.pm b/src/urxvt.pm index 94dac8ec..f43bbd3a 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -131,6 +131,16 @@ paste directly into your (vi :) editor: 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 Uses per-line display filtering (C) to underline urls and -- 2.34.1