From 46d7c37b3a7a2663a20e19d0d17da68b1ee1dae7 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 2 Jan 2006 21:41:51 +0000 Subject: [PATCH] *** empty log message *** --- doc/rxvt.1.html | 12 +++++++++++- doc/rxvt.1.man.in | 15 ++++++++++++--- doc/rxvt.1.pod | 6 +++--- doc/rxvt.1.txt | 9 ++++++++- doc/rxvt.7.html | 6 +++--- doc/rxvt.7.man.in | 6 +++--- doc/rxvt.7.pod | 6 +++--- doc/rxvtperl.3.html | 21 ++++++++++++++++----- doc/rxvtperl.3.man.in | 26 +++++++++++++++++++------- doc/rxvtperl.3.txt | 20 +++++++++++++------- src/urxvt.pm | 8 +++++++- 11 files changed, 98 insertions(+), 37 deletions(-) diff --git a/doc/rxvt.1.html b/doc/rxvt.1.html index 54778b60..f39e2e38 100644 --- a/doc/rxvt.1.html +++ b/doc/rxvt.1.html @@ -1373,6 +1373,16 @@ when Control-Meta-c is being pressed'':

URxvt.keysym.M-C-c: command:\033]701;zh_CN.GBK\007
+

If string takes the form perl:STRING, then the specified STRING +is passed to the on_keyboard_command perl handler. See the rxvtperl(3) +manpage. For example, the selection extension (activated via +rxvt -pe selection) listens for selection:rot13 events:

+
+
+
+  URxvt.keysym.M-C-c: perl:selection:rot13
+
+

Due the the large number of modifier combinations, a defined key mapping will match if at at least the specified identifiers are being set, and no other key mappings with those and more bits are being defined. That @@ -1437,7 +1447,7 @@ Perl code to be evaluated when all extensions have been registered. See the Colon-separated list of additional directories that hold extension scripts. When looking for extensions specified by the perl resource, rxvt will first look in these directories and then in -/opt/rxvt/lib/urxvt/perl-ext/. +/opt/rxvt/lib/urxvt/perl/.

See the rxvtperl(3) manpage.

diff --git a/doc/rxvt.1.man.in b/doc/rxvt.1.man.in index 4f120826..979dbce9 100644 --- a/doc/rxvt.1.man.in +++ b/doc/rxvt.1.man.in @@ -1043,6 +1043,15 @@ when Control-Meta-c is being pressed": \& URxvt.keysym.M-C-c: command:\e033]701;zh_CN.GBK\e007 .Ve .Sp +If \fIstring\fR takes the form \f(CW\*(C`perl:STRING\*(C'\fR, then the specified \fB\s-1STRING\s0\fR +is passed to the \f(CW\*(C`on_keyboard_command\*(C'\fR perl handler. See the @@RXVT_NAME@@\fIperl\fR\|(3) +manpage. For example, the \fIselection\fR extension (activated via +\&\f(CW\*(C`@@RXVT_NAME@@ \-pe selection\*(C'\fR) listens for \f(CW\*(C`selection:rot13\*(C'\fR events: +.Sp +.Vb 1 +\& URxvt.keysym.M-C-c: perl:selection:rot13 +.Ve +.Sp Due the the large number of modifier combinations, a defined key mapping will match if at \fIat least\fR the specified identifiers are being set, and no other key mappings with those and more bits are being defined. That @@ -1088,15 +1097,15 @@ if necessary, and bound to the current terminal instance; option \fB\-pe\fR. .IP "\fBperl-eval\fR: \fIstring\fR" 4 .IX Item "perl-eval: string" Perl code to be evaluated when all extensions have been registered. See the -\&\fIrxvtperl\fR\|(3) manpage. +@@RXVT_NAME@@\fIperl\fR\|(3) manpage. .IP "\fBperl-lib\fR: \fIpath\fR" 4 .IX Item "perl-lib: path" Colon-separated list of additional directories that hold extension scripts. When looking for extensions specified by the \f(CW\*(C`perl\*(C'\fR resource, @@RXVT_NAME@@ will first look in these directories and then in -\&\fI@@RXVT_LIBDIR@@/urxvt/perl\-ext/\fR. +\&\fI@@RXVT_LIBDIR@@/urxvt/perl/\fR. .Sp -See the \fIrxvtperl\fR\|(3) manpage. +See the @@RXVT_NAME@@\fIperl\fR\|(3) manpage. .SH "THE SCROLLBAR" .IX Header "THE SCROLLBAR" Lines of text that scroll off the top of the \fB@@RXVT_NAME@@\fR window diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod index d8567a2b..82f8687c 100644 --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -1025,7 +1025,7 @@ when Control-Meta-c is being pressed": URxvt.keysym.M-C-c: command:\033]701;zh_CN.GBK\007 If I takes the form C, then the specified B -is passed to the C perl handler. See the rxvtperl(3) +is passed to the C perl handler. See the @@RXVT_NAME@@perl(3) manpage. For example, the F extension (activated via C<@@RXVT_NAME@@ -pe selection>) listens for C events: @@ -1072,7 +1072,7 @@ if necessary, and bound to the current terminal instance; option B<-pe>. =item B: I Perl code to be evaluated when all extensions have been registered. See the -rxvtperl(3) manpage. +@@RXVT_NAME@@perl(3) manpage. =item B: I @@ -1081,7 +1081,7 @@ scripts. When looking for extensions specified by the C resource, @@RXVT_NAME@@ will first look in these directories and then in F<@@RXVT_LIBDIR@@/urxvt/perl/>. -See the rxvtperl(3) manpage. +See the @@RXVT_NAME@@perl(3) manpage. =back diff --git a/doc/rxvt.1.txt b/doc/rxvt.1.txt index 458d2e4b..10a02467 100644 --- a/doc/rxvt.1.txt +++ b/doc/rxvt.1.txt @@ -887,6 +887,13 @@ RESOURCES (available also as long-options) URxvt.keysym.M-C-c: command:\033]701;zh_CN.GBK\007 + If *string* takes the form "perl:STRING", then the specified STRING + is passed to the "on_keyboard_command" perl handler. See the + rxvtperl(3) manpage. For example, the selection extension (activated + via "rxvt -pe selection") listens for "selection:rot13" events: + + URxvt.keysym.M-C-c: perl:selection:rot13 + Due the the large number of modifier combinations, a defined key mapping will match if at *at least* the specified identifiers are being set, and no other key mappings with those and more bits are @@ -933,7 +940,7 @@ RESOURCES (available also as long-options) Colon-separated list of additional directories that hold extension scripts. When looking for extensions specified by the "perl" resource, rxvt will first look in these directories and then in - /opt/rxvt/lib/urxvt/perl-ext/. + /opt/rxvt/lib/urxvt/perl/. See the rxvtperl(3) manpage. diff --git a/doc/rxvt.7.html b/doc/rxvt.7.html index 1db0e95f..6be04898 100644 --- a/doc/rxvt.7.html +++ b/doc/rxvt.7.html @@ -3019,9 +3019,9 @@ Add support to have the pointer disappear when typing or inactive.
--enable-perl (default: off)
-Enable an embedded perl interpreter. See the rxvtperl(3) manpage -(doc/rxvtperl.txt) for more info on this feature, or the files in -src/perl-ext/ for the extensions that are installed by default. +Enable an embedded perl interpreter. See the rxvtperl(3) +manpage (doc/rxvtperl.txt) for more info on this feature, or the files +in src/perl-ext/ for the extensions that are installed by default.

--with-name=NAME (default: urxvt)
diff --git a/doc/rxvt.7.man.in b/doc/rxvt.7.man.in index 79c59b57..d366676a 100644 --- a/doc/rxvt.7.man.in +++ b/doc/rxvt.7.man.in @@ -2537,9 +2537,9 @@ the screen in a fixed position. Add support to have the pointer disappear when typing or inactive. .IP "\-\-enable\-perl (default: off)" 4 .IX Item "--enable-perl (default: off)" -Enable an embedded perl interpreter. See the \fB\f(BIrxvtperl\fB\|(3)\fR manpage -(\fIdoc/rxvtperl.txt\fR) for more info on this feature, or the files in -\&\fIsrc/perl\-ext/\fR for the extensions that are installed by default. +Enable an embedded perl interpreter. See the \fB@@RXVT_NAME@@\f(BIperl\fB\|(3)\fR +manpage (\fIdoc/rxvtperl.txt\fR) for more info on this feature, or the files +in \fIsrc/perl\-ext/\fR for the extensions that are installed by default. .IP "\-\-with\-name=NAME (default: urxvt)" 4 .IX Item "--with-name=NAME (default: urxvt)" Set the basename for the installed binaries, resulting diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod index dd2ad4b8..2f376626 100644 --- a/doc/rxvt.7.pod +++ b/doc/rxvt.7.pod @@ -2568,9 +2568,9 @@ Add support to have the pointer disappear when typing or inactive. =item --enable-perl (default: off) -Enable an embedded perl interpreter. See the B manpage -(F) for more info on this feature, or the files in -F for the extensions that are installed by default. +Enable an embedded perl interpreter. See the B<@@RXVT_NAME@@perl(3)> +manpage (F) for more info on this feature, or the files +in F for the extensions that are installed by default. =item --with-name=NAME (default: urxvt) diff --git a/doc/rxvtperl.3.html b/doc/rxvtperl.3.html index 43606e27..706f9b8e 100644 --- a/doc/rxvtperl.3.html +++ b/doc/rxvtperl.3.html @@ -44,22 +44,25 @@


SYNOPSIS

-

* Put your scripts into /opt/rxvt/lib/urxvt/perl-ext/, they will be loaded automatically.

-

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

+
+   # create a file grab_test in $HOME:
    sub on_sel_grab {
       warn "you selected ", $_[0]->selection;
       ()
    }
-   1
+ # start a rxvt using it: +
+   rxvt --perl-lib $HOME -pe grab_test


DESCRIPTION

Everytime a terminal object gets created, scripts specified via the -perl resource are associated with it.

+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 scripts will be shared (But not enabled) for all terminals.

@@ -184,6 +187,14 @@ code is run after this hook, and takes precedence.

Called just after the screen gets redrawn. See on_refresh_begin.
+

+
on_keyboard_command $term, $string
+
+
+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). +

diff --git a/doc/rxvtperl.3.man.in b/doc/rxvtperl.3.man.in index c00bd974..fedbc93d 100644 --- a/doc/rxvtperl.3.man.in +++ b/doc/rxvtperl.3.man.in @@ -131,13 +131,12 @@ .IX Title "rxvt 3" .TH rxvt 3 "2006-01-02" "6.2" "RXVT-UNICODE" .SH "NAME" -rxvtperl \- rxvt\-unicode's embedded perl interpreter +@@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter .SH "SYNOPSIS" .IX Header "SYNOPSIS" -* Put your scripts into \fI@@RXVT_LIBDIR@@/urxvt/perl\-ext/\fR, they will be loaded automatically. -.PP -* Scripts are evaluated in a 'use strict' and 'use utf8' environment, and -thus must be encoded as \s-1UTF\-8\s0. +.Vb 1 +\& # create a file grab_test in $HOME: +.Ve .PP .Vb 4 \& sub on_sel_grab { @@ -147,12 +146,19 @@ thus must be encoded as \s-1UTF\-8\s0. .Ve .PP .Vb 1 -\& 1 +\& # start a @@RXVT_NAME@@ using it: +.Ve +.PP +.Vb 1 +\& @@RXVT_NAME@@ --perl-lib $HOME -pe grab_test .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Everytime a terminal object gets created, scripts specified via the -\&\f(CW\*(C`perl\*(C'\fR resource are associated with it. +\&\f(CW\*(C`perl\*(C'\fR resource are loaded and associated with it. +.PP +Scripts are compiled in a 'use strict' and 'use utf8' environment, and +thus must be encoded as \s-1UTF\-8\s0. .PP Each script will only ever be loaded once, even in @@RXVT_NAME@@d, where scripts will be shared (But not enabled) for all terminals. @@ -252,6 +258,12 @@ code is run after this hook, and takes precedence. .el .IP "on_refresh_end \f(CW$term\fR" 4 .IX Item "on_refresh_end $term" Called just after the screen gets redrawn. See \f(CW\*(C`on_refresh_begin\*(C'\fR. +.ie n .IP "on_keyboard_command $term\fR, \f(CW$string" 4 +.el .IP "on_keyboard_command \f(CW$term\fR, \f(CW$string\fR" 4 +.IX Item "on_keyboard_command $term, $string" +Called whenever the user presses a key combination that has a +\&\f(CW\*(C`perl:string\*(C'\fR action bound to it (see description of the \fBkeysym\fR +resource in the @@RXVT_NAME@@(1) manpage). .ie n .Sh "Functions in the ""urxvt"" Package" .el .Sh "Functions in the \f(CWurxvt\fP Package" .IX Subsection "Functions in the urxvt Package" diff --git a/doc/rxvtperl.3.txt b/doc/rxvtperl.3.txt index 0a26d667..b90ba3a5 100644 --- a/doc/rxvtperl.3.txt +++ b/doc/rxvtperl.3.txt @@ -2,22 +2,23 @@ NAME rxvtperl - rxvt-unicode's embedded perl interpreter SYNOPSIS - * Put your scripts into /opt/rxvt/lib/urxvt/perl-ext/, they will be - loaded automatically. - - * Scripts are evaluated in a 'use strict' and 'use utf8' environment, - and thus must be encoded as UTF-8. + # create a file grab_test in $HOME: sub on_sel_grab { warn "you selected ", $_[0]->selection; () } - 1 + # start a rxvt using it: + + rxvt --perl-lib $HOME -pe grab_test DESCRIPTION Everytime a terminal object gets created, scripts specified via the - "perl" resource are associated with it. + "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 scripts will be shared (But not enabled) for all terminals. @@ -110,6 +111,11 @@ DESCRIPTION on_refresh_end $term Called just after the screen gets redrawn. See "on_refresh_begin". + on_keyboard_command $term, $string + 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). + Functions in the "urxvt" Package urxvt::fatal $errormessage Fatally aborts execution with the given error message. Avoid at all diff --git a/src/urxvt.pm b/src/urxvt.pm index 34f7d5ae..a66212b5 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -1,6 +1,6 @@ =head1 NAME -rxvtperl - rxvt-unicode's embedded perl interpreter +@@RXVT_NAME@@perl - rxvt-unicode's embedded perl interpreter =head1 SYNOPSIS @@ -126,6 +126,12 @@ code is run after this hook, and takes precedence. Called just after the screen gets redrawn. See C. +=item on_keyboard_command $term, $string + +Called whenever the user presses a key combination that has a +C action bound to it (see description of the B +resource in the @@RXVT_NAME@@(1) manpage). + =back =head2 Functions in the C Package -- 2.34.1