while (<$slave>) { print $slave "got <$_>\n" }</pre>
</dd>
<p></p>
-<dt><strong><a name="item__2dperl_string"><strong>-perl</strong> <em>string</em></a></strong><br />
+<dt><strong><a name="item__2dpe_string"><strong>-pe</strong> <em>string</em></a></strong><br />
</dt>
<dd>
-Used by perl extension. See resource <strong>perl</strong>.
+Colon-separated list of perl extension scripts to use in this terminal instance. See resource <strong>perl-ext</strong>.
</dd>
<p></p></dl>
<p>
URxvt.keysym.M-C-4: command:\033[8;48;110t</pre>
</dd>
<p></p>
-<dt><strong><a name="item_perl_3a_string"><strong>perl</strong>: <em>string</em></a></strong><br />
+<dt><strong><a name="item_perl_2dext_3a_string"><strong>perl-ext</strong>: <em>string</em></a></strong><br />
</dt>
<dd>
-Used by perl extension and is free for any use, as it is not interpreted
-by rxvt-unicode itself; option <strong>perl</strong>.
+Colon-separated list of perl extension scripts to use in this terminal
+instance. Each extension is looked up in the library directories, loaded
+if necessary, and bound to the current terminal instance; option <strong>-pe</strong>.
</dd>
<p></p>
<dt><strong><a name="item_perl_2deval_3a_string"><strong>perl-eval</strong>: <em>string</em></a></strong><br />
</dt>
<dd>
-Perl code to be evaluated when all extensions have been loaded. See the
+Perl code to be evaluated when all extensions have been registered. See the
<code>rxvtperl(3)</code> manpage.
</dd>
<p></p>
<dt><strong><a name="item_perl_2dlib_3a_path"><strong>perl-lib</strong>: <em>path</em></a></strong><br />
</dt>
<dd>
-Additional directory that holds extension scripts that are loaded and
-enabled for this terminal instance, in addition to scripts stored in
-<em>/opt/rxvt/lib/urxvt/perl-ext/</em>, which are global to all terminal
-instances.
+Colon-separated list of additional directories that hold extension
+scripts. When looking for extensions specified by the <code>perl</code> resource,
+rxvt will first look in these directories and then in
+<em>/opt/rxvt/lib/urxvt/perl-ext/</em>.
</dd>
<dd>
<p>See the <code>rxvtperl(3)</code> manpage.</p>
\& my $slave = $pty->slave;
\& while (<$slave>) { print $slave "got <$_>\en" }
.Ve
-.IP "\fB\-perl\fR \fIstring\fR" 4
-.IX Item "-perl string"
-Used by perl extension. See resource \fBperl\fR.
+.IP "\fB\-pe\fR \fIstring\fR" 4
+.IX Item "-pe string"
+Colon-separated list of perl extension scripts to use in this terminal instance. See resource \fBperl-ext\fR.
.SH "RESOURCES (available also as long\-options)"
.IX Header "RESOURCES (available also as long-options)"
Note: `@@RXVT_NAME@@ \-\-help' gives a list of all resources (long
\& URxvt.keysym.M-C-3: command:\e033[8;25;80t
\& URxvt.keysym.M-C-4: command:\e033[8;48;110t
.Ve
-.IP "\fBperl\fR: \fIstring\fR" 4
-.IX Item "perl: string"
-Used by perl extension and is free for any use, as it is not interpreted
-by rxvt-unicode itself; option \fBperl\fR.
+.IP "\fBperl-ext\fR: \fIstring\fR" 4
+.IX Item "perl-ext: string"
+Colon-separated list of perl extension scripts to use in this terminal
+instance. Each extension is looked up in the library directories, loaded
+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 loaded. See the
+Perl code to be evaluated when all extensions have been registered. See the
\&\fIrxvtperl\fR\|(3) manpage.
.IP "\fBperl-lib\fR: \fIpath\fR" 4
.IX Item "perl-lib: path"
-Additional directory that holds extension scripts that are loaded and
-enabled for this terminal instance, in addition to scripts stored in
-\&\fI@@RXVT_LIBDIR@@/urxvt/perl\-ext/\fR, which are global to all terminal
-instances.
+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.
.Sp
See the \fIrxvtperl\fR\|(3) manpage.
.SH "THE SCROLLBAR"
Colon-separated list of additional directories that hold extension
scripts. When looking for extensions specified by the C<perl> resource,
@@RXVT_NAME@@ will first look in these directories and then in
-F<@@RXVT_LIBDIR@@/urxvt/perl-ext/>.
+F<@@RXVT_LIBDIR@@/urxvt/perl/>.
See the rxvtperl(3) manpage.
my $slave = $pty->slave;
while (<$slave>) { print $slave "got <$_>\n" }
- -perl *string*
- Used by perl extension. See resource perl.
+ -pe *string*
+ Colon-separated list of perl extension scripts to use in this
+ terminal instance. See resource perl-ext.
RESOURCES (available also as long-options)
Note: `rxvt --help' gives a list of all resources (long options)
URxvt.keysym.M-C-3: command:\033[8;25;80t
URxvt.keysym.M-C-4: command:\033[8;48;110t
- perl: *string*
- Used by perl extension and is free for any use, as it is not
- interpreted by rxvt-unicode itself; option perl.
+ perl-ext: *string*
+ Colon-separated list of perl extension scripts to use in this
+ terminal instance. Each extension is looked up in the library
+ directories, loaded if necessary, and bound to the current terminal
+ instance; option -pe.
perl-eval: *string*
- Perl code to be evaluated when all extensions have been loaded. See
- the rxvtperl(3) manpage.
+ Perl code to be evaluated when all extensions have been registered.
+ See the rxvtperl(3) manpage.
perl-lib: *path*
- Additional directory that holds extension scripts that are loaded
- and enabled for this terminal instance, in addition to scripts
- stored in /opt/rxvt/lib/urxvt/perl-ext/, which are global to all
- terminal instances.
+ 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/.
See the rxvtperl(3) manpage.
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
-<p>On startup, rxvt will scan <em>/opt/rxvt/lib/urxvt/perl-ext/</em>
-for files and will load them. Everytime a terminal object gets created,
-the directory specified by the <code>perl-lib</code> resource will be additionally
-scanned.</p>
+<p>Everytime a terminal object gets created, scripts specified via the
+<code>perl</code> resource are associated with it.</p>
<p>Each script will only ever be loaded once, even in rxvtd, where
-scripts will be shared for all terminals.</p>
-<p>Hooks in scripts specified by <code>perl-lib</code> will only be called for the
-terminals created with that specific option value.</p>
+scripts will be shared (But not enabled) for all terminals.</p>
<p>
</p>
<h2><a name="general_api_considerations">General API Considerations</a></h2>
borderLess color cursorBlink cursorUnderline cutchars delete_key
display_name embed ext_bwidth fade font geometry hold iconName
imFont imLocale inputMethod insecure int_bwidth intensityStyles
- italicFont jumpScroll lineSpace loginShell mapAlert menu meta8
- modifier mouseWheelScrollPage name pastableTabs path perl perl_eval
+ italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier
+ mouseWheelScrollPage name pastableTabs path perl_eval perl_ext
perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd
reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating
scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
-On startup, @@RXVT_NAME@@ will scan \fI@@RXVT_LIBDIR@@/urxvt/perl\-ext/\fR
-for files and will load them. Everytime a terminal object gets created,
-the directory specified by the \f(CW\*(C`perl\-lib\*(C'\fR resource will be additionally
-scanned.
+Everytime a terminal object gets created, scripts specified via the
+\&\f(CW\*(C`perl\*(C'\fR resource are associated with it.
.PP
Each script will only ever be loaded once, even in @@RXVT_NAME@@d, where
-scripts will be shared for all terminals.
-.PP
-Hooks in scripts specified by \f(CW\*(C`perl\-lib\*(C'\fR will only be called for the
-terminals created with that specific option value.
+scripts will be shared (But not enabled) for all terminals.
.Sh "General \s-1API\s0 Considerations"
.IX Subsection "General API Considerations"
All objects (such as terminals, time watchers etc.) are typical
\& borderLess color cursorBlink cursorUnderline cutchars delete_key
\& display_name embed ext_bwidth fade font geometry hold iconName
\& imFont imLocale inputMethod insecure int_bwidth intensityStyles
-\& italicFont jumpScroll lineSpace loginShell mapAlert menu meta8
-\& modifier mouseWheelScrollPage name pastableTabs path perl perl_eval
+\& italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier
+\& mouseWheelScrollPage name pastableTabs path perl_eval perl_ext
\& perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd
\& reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating
\& scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput
1
DESCRIPTION
- On startup, rxvt will scan /opt/rxvt/lib/urxvt/perl-ext/ for files and
- will load them. Everytime a terminal object gets created, the directory
- specified by the "perl-lib" resource will be additionally scanned.
+ Everytime a terminal object gets created, scripts specified via the
+ "perl" resource are associated with it.
Each script will only ever be loaded once, even in rxvtd, where scripts
- will be shared for all terminals.
-
- Hooks in scripts specified by "perl-lib" will only be called for the
- terminals created with that specific option value.
+ will be shared (But not enabled) for all terminals.
General API Considerations
All objects (such as terminals, time watchers etc.) are typical
borderLess color cursorBlink cursorUnderline cutchars delete_key
display_name embed ext_bwidth fade font geometry hold iconName
imFont imLocale inputMethod insecure int_bwidth intensityStyles
- italicFont jumpScroll lineSpace loginShell mapAlert menu meta8
- modifier mouseWheelScrollPage name pastableTabs path perl perl_eval
+ italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier
+ mouseWheelScrollPage name pastableTabs path perl_eval perl_ext
perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd
reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating
scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput
install-perl:
@IF_PERL@ $(INSTALL) -d $(DESTDIR)$(libdir)
@IF_PERL@ $(INSTALL) -d $(DESTDIR)$(libdir)/urxvt
-@IF_PERL@ $(INSTALL) -d $(DESTDIR)$(libdir)/urxvt/perl-ext
+@IF_PERL@ $(INSTALL) -d $(DESTDIR)$(libdir)/urxvt/perl
@IF_PERL@ $(INSTALL_DATA) urxvt.pm $(DESTDIR)$(libdir)/urxvt/urxvt.pm
-@IF_PERL@ for ext in perl-ext/*; do test -f "$$ext" && $(INSTALL_DATA) "$$ext" $(DESTDIR)$(libdir)/urxvt/"$$ext"; done
+@IF_PERL@ for ext in perl/*; do test -f "$$ext" && $(INSTALL_DATA) "$$ext" $(DESTDIR)$(libdir)/urxvt/"$$ext"; done
install: allbin alldoc install-perl
$(INSTALL) -d $(DESTDIR)$(bindir)
Rs_def(shade)
#endif
#if ENABLE_PERL
- Rs_def(perl_lib)
Rs_def(perl_eval)
- Rs_def(perl)
+ Rs_def(perl_ext)
+ Rs_def(perl_lib)
#endif
};
enum hook_type {
- HOOK_LOAD,
-
- HOOK_INIT,
+ HOOK_INIT = 0, // special, hardcoded
+ HOOK_DESTROY = 1, // values in urxvt.pm
HOOK_RESET,
HOOK_START,
- HOOK_DESTROY,
HOOK_SEL_BEGIN,
HOOK_SEL_EXTEND,
bool
rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...)
{
- // INIT and DESTROY must be requested by the runtime
-
- if (!perl || !should_invoke [htype])
+ if (!perl
+ || (!should_invoke [htype] && htype != HOOK_INIT && htype != HOOK_DESTROY))
return false;
if (htype == HOOK_INIT) // first hook ever called
{
# define set_hookname(sym) av_store (hookname, PP_CONCAT(HOOK_, sym), newSVpv (PP_STRINGIFY(sym), 0))
AV *hookname = get_av ("urxvt::HOOKNAME", 1);
- set_hookname (LOAD);
set_hookname (INIT);
set_hookname (RESET);
set_hookname (START);
=head1 SYNOPSIS
-* Put your scripts into F<@@RXVT_LIBDIR@@/urxvt/perl-ext/>, they will be loaded automatically.
+* Put your scripts into F<@@RXVT_LIBDIR@@/urxvt/perl/>, they will be loaded automatically.
* Scripts are evaluated in a 'use strict' and 'use utf8' environment, and
thus must be encoded as UTF-8.
my $htype = shift;
if ($htype == 0) { # INIT
- my @dirs = ((split /:/, $term->resource ("perl_lib")), $LIBDIR);
+ my @dirs = ((split /:/, $term->resource ("perl_lib")), "$LIBDIR/perl");
for my $ext (split /:/, $term->resource ("perl_ext")) {
my @files = grep -f $_, map "$_/$ext", @dirs;
#if ENABLE_PERL
STRG (Rs_perl_lib, "perl-lib", 0, "string", "colon-separated directories with extension scripts"),
STRG (Rs_perl_eval, "perl-eval", 0, "string", "code to be evaluated after all extensions have been loaded"),
- STRG (Rs_perl_ext, "perl-ext", "pe", "string", "colon-sepaated list of perl extensions to enable"),
+ STRG (Rs_perl_ext, "perl-ext", "pe", "string", "colon-separated list of perl extensions to enable"),
#endif
#if 0 && TODO
#if !defined(NO_RESOURCES) && defined(USE_XGETDEFAULT)