*** empty log message ***
authorroot <root>
Mon, 2 Jan 2006 20:35:39 +0000 (20:35 +0000)
committerroot <root>
Mon, 2 Jan 2006 20:35:39 +0000 (20:35 +0000)
13 files changed:
doc/rxvt.1.html
doc/rxvt.1.man.in
doc/rxvt.1.pod
doc/rxvt.1.txt
doc/rxvtperl.3.html
doc/rxvtperl.3.man.in
doc/rxvtperl.3.txt
src/Makefile.in
src/rsinc.h
src/rxvtperl.h
src/rxvtperl.xs
src/urxvt.pm
src/xdefaults.C

index 2ca7efd..54778b6 100644 (file)
@@ -628,10 +628,10 @@ longer example is in <em>doc/pty-fd</em>):</p>
    while (&lt;$slave&gt;) { print $slave &quot;got &lt;$_&gt;\n&quot; }</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>
@@ -1416,27 +1416,28 @@ info):</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>
index ec409ea..4f12082 100644 (file)
@@ -534,9 +534,9 @@ longer example is in \fIdoc/pty\-fd\fR):
 \&   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
@@ -1080,20 +1080,21 @@ info):
 \&  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"
index fabac38..e30d35b 100644 (file)
@@ -1072,7 +1072,7 @@ rxvtperl(3) manpage.
 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.
 
index 342ff5c..458d2e4 100644 (file)
@@ -392,8 +392,9 @@ OPTIONS
            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)
@@ -918,19 +919,21 @@ RESOURCES (available also as 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.
 
index 007335b..43606e2 100644 (file)
@@ -58,14 +58,10 @@ thus must be encoded as UTF-8.</p>
 </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>
@@ -255,8 +251,8 @@ list:</p>
   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
index c926210..c00bd97 100644 (file)
@@ -151,16 +151,11 @@ thus must be encoded as \s-1UTF\-8\s0.
 .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
@@ -308,8 +303,8 @@ list:
 \&  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
index 075e7b1..0a26d66 100644 (file)
@@ -16,15 +16,11 @@ SYNOPSIS
        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
@@ -157,8 +153,8 @@ DESCRIPTION
           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
index 1a8d725..893163e 100644 (file)
@@ -96,9 +96,9 @@ distclean: realclean
 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)
index efeb52e..bb6ede0 100644 (file)
   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
index 7f49cb7..27e75ca 100644 (file)
@@ -18,12 +18,10 @@ enum data_type {
 };
 
 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,
index f04ce40..7f040a2 100644 (file)
@@ -210,9 +210,8 @@ rxvt_perl_interp::init ()
 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
@@ -291,7 +290,6 @@ BOOT:
 {
 # 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);
index a051c12..656e257 100644 (file)
@@ -4,7 +4,7 @@ rxvtperl - rxvt-unicode's embedded perl interpreter
 
 =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.
@@ -228,7 +228,7 @@ sub invoke {
    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;
index 8e46827..54ca3dc 100644 (file)
@@ -263,7 +263,7 @@ optList[] = {
 #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)