*** empty log message ***
authorroot <root>
Wed, 11 Jan 2006 02:13:55 +0000 (02:13 +0000)
committerroot <root>
Wed, 11 Jan 2006 02:13:55 +0000 (02:13 +0000)
18 files changed:
Changes
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/command.C
src/feature.h
src/perl/mark-urls
src/perl/searchable-scrollback
src/perl/selection-popup
src/rxvt.h
src/rxvtperl.xs
src/screen.C
src/urxvt.pm
src/xdefaults.C

diff --git a/Changes b/Changes
index 512a59250e6470dbcfd26c4b9bf2a24e6d26dc7b..6a924f41e8c0c675b32325446c7bdaf6a1ace4d0 100644 (file)
--- a/Changes
+++ b/Changes
@@ -5,13 +5,11 @@ TODO: after requesting the selection and getting a timeout, no further requests
 TODO: "slow" rendering mode for bidi and scripts
 TODO: read property sequence is broken with respect to utf-8 etc.
 TODO: http://www120.pair.com/mccarthy/nextstep/intro.htmld/Workspace.html is the correct nextstep look.
+TODO: clarify and get rid of SMOOTH_REFRESH etc.
 WISH: OnTheSpot editing, or maybe switch to miiiiiiif
 WISH: just for fun, do shade and tint with XRender.
 WISH: support tex fonts
 
-TODO: resources! resources! resources!
-TODO: better environment handling in rxvt/xim etc. and urxvt::term->new
-TODO: selection-extending with rmb does not work?
        - added sections for DISTRIBUTION MAINTAINERS and about
           SETUID/SETGID to the FAQ.
         - selection, searchable-scrollback, selection-popup and
index 08ca34713484b3a84c0fad3d8423de02ab08288a..6c4ac4b045a2a890a42c6141d9dc907351a94c04 100644 (file)
@@ -1504,6 +1504,13 @@ will be ignored when running setuid/setgid.
 <p>See the <code>rxvtperl(3)</code> manpage.</p>
 </dd>
 <p></p>
+<dt><strong><a name="item_urllauncher_3a_string"><strong>urlLauncher</strong>: <em>string</em></a></strong><br />
+</dt>
+<dd>
+Specifies the program to be started with a URL argument. Used by the
+<code>selection-popup</code> and <code>mark-urls</code> perl extensions.
+</dd>
+<p></p>
 <dt><strong><a name="item_transient_2dfor_3a_windowid"><strong>transient-for</strong>: <em>windowid</em></a></strong><br />
 </dt>
 <dd>
index b94e7204bc02c9c419ec9cb5cea5d32cc94eccca..c727954a2da2812ea1e3be7b4633ea3d70150492 100644 (file)
 .\" ========================================================================
 .\"
 .IX Title "rxvt 1"
-.TH rxvt 1 "2006-01-10" "6.3" "RXVT-UNICODE"
+.TH rxvt 1 "2006-01-11" "6.3" "RXVT-UNICODE"
 .SH "NAME"
 rxvt\-unicode (ouR XVT, unicode) \- (a VT102 emulator for the X window system)
 .SH "SYNOPSIS"
@@ -1148,6 +1148,10 @@ scripts. When looking for extensions specified by the \f(CW\*(C`perl\*(C'\fR res
 will be ignored when running setuid/setgid.
 .Sp
 See the @@RXVT_NAME@@\fIperl\fR\|(3) manpage.
+.IP "\fBurlLauncher\fR: \fIstring\fR" 4
+.IX Item "urlLauncher: string"
+Specifies the program to be started with a \s-1URL\s0 argument. Used by the
+\&\f(CW\*(C`selection\-popup\*(C'\fR and \f(CW\*(C`mark\-urls\*(C'\fR perl extensions.
 .IP "\fBtransient-for\fR: \fIwindowid\fR" 4
 .IX Item "transient-for: windowid"
 Sets the \s-1WM_TRANSIENT_FOR\s0 property to the given window iw.
index 250d873676ddbb1d15f0265ce8a806cfbc231d62..f89560fd08f88ac4addddf816ef353c4f884e1df 100644 (file)
@@ -1125,6 +1125,11 @@ will be ignored when running setuid/setgid.
 
 See the @@RXVT_NAME@@perl(3) manpage.
 
+=item B<urlLauncher>: I<string>
+
+Specifies the program to be started with a URL argument. Used by the
+C<selection-popup> and C<mark-urls> perl extensions.
+
 =item B<transient-for>: I<windowid>
 
 Sets the WM_TRANSIENT_FOR property to the given window iw.
index 82f3fe2cfdd4db0774ef5d3cebf614b12f321801..d21bca73d7a31da563f0ddb1a62aff0d75f274c9 100644 (file)
@@ -981,6 +981,10 @@ RESOURCES (available also as long-options)
 
         See the rxvtperl(3) manpage.
 
+    urlLauncher: *string*
+        Specifies the program to be started with a URL argument. Used by the
+        "selection-popup" and "mark-urls" perl extensions.
+
     transient-for: *windowid*
         Sets the WM_TRANSIENT_FOR property to the given window iw.
 
index ec9d00b1bb46f26aeb5ae3952bc69168db8731a8..6dbda25bb645702982b4e44a6b76a72e6c7398de 100644 (file)
@@ -143,7 +143,9 @@ Displays a digital clock using the built-in overlay.
 <dt><strong><a name="item_mark_2durls">mark-urls</a></strong><br />
 </dt>
 <dd>
-Uses per-line display filtering (<code>on_line_update</code>) to underline urls.
+Uses per-line display filtering (<code>on_line_update</code>) to underline urls and
+make them clickable. When clicked, the program specified in the resource
+<code>urlLauncher</code> (default <code>x-www-browser</code>) will be started.
 </dd>
 <p></p>
 <dt><strong><a name="item_block_2dgraphics_2dto_2dascii">block-graphics-to-ascii</a></strong><br />
@@ -185,7 +187,7 @@ hints on what they mean:</p>
 </dt>
 <dd>
 Rxvt-unicodes special way of encoding text, where one ``unicode'' character
-always represents one screen cell. See <em>row_t</em> for a discussion of this format.
+always represents one screen cell. See <a href="#item_row_t">ROW_t</a> for a discussion of this format.
 </dd>
 <p></p>
 <dt><strong><a name="item__24string">$string</a></strong><br />
@@ -478,9 +480,7 @@ The basename of the installed binaries, usually <code>urxvt</code>.
 The current terminal. This variable stores the current <code>urxvt::term</code>
 object, whenever a callback/hook is executing.
 </dd>
-<p></p>
-<dt></dt>
-</dl>
+<p></p></dl>
 <p>
 </p>
 <h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2>
@@ -611,11 +611,11 @@ work.</p>
 </dt>
 <dd>
 Creates a new terminal, very similar as if you had started it with system
-<code>$rxvtname, arg...</code>. <code>$envhashref</code> must be a reference to a %ENV&gt;-like
-<code></code>hash which defines the environment of the new terminal.
+<code>$rxvtname, arg...</code>. <code>$envhashref</code> must be a reference to a <code>%ENV</code>-like
+hash which defines the environment of the new terminal.
 </dd>
 <dd>
-<p>&gt;Croaks (and probably outputs an error message) if the new instance
+<p>Croaks (and probably outputs an error message) if the new instance
 couldn't be created.  Returns <code>undef</code> if the new instance didn't
 initialise perl, and the terminal object otherwise. The <code>init</code> and
 <a href="#item_start"><code>start</code></a> hooks will be called during this call.</p>
@@ -692,6 +692,20 @@ to see the actual list:</p>
   utmpInhibit visualBell</pre>
 </dd>
 <p></p>
+<dt><strong><a name="item_x_resource">$value = $term-&gt;x_resource ($pattern)</a></strong><br />
+</dt>
+<dd>
+Returns the X-Resource for the given pattern, excluding the program or
+class name, i.e.  <a href="#item_x_resource"><code>$term-&gt;x_resource (&quot;boldFont&quot;)</code></a> should return the
+same value as used by this instance of rxvt-unicode. Returns <code>undef</code> if no
+resource with that pattern exists.
+</dd>
+<dd>
+<p>This method should only be called during the <code>on_start</code> hook, as there is
+only one resource database per display, and later invocations might return
+the wrong resources.</p>
+</dd>
+<p></p>
 <dt><strong><a name="item_parse_keysym">$success = $term-&gt;parse_keysym ($keysym_spec, $command_string)</a></strong><br />
 </dt>
 <dd>
index 7cec27357e5d4ac0803bd3df4e472994019d6462..fc0d7d27af36e0c814dc5c3700a27162ae590e41 100644 (file)
@@ -215,7 +215,9 @@ returns to the original position.
 Displays a digital clock using the built-in overlay.
 .IP "mark-urls" 4
 .IX Item "mark-urls"
-Uses per-line display filtering (\f(CW\*(C`on_line_update\*(C'\fR) to underline urls.
+Uses per-line display filtering (\f(CW\*(C`on_line_update\*(C'\fR) to underline urls and
+make them clickable. When clicked, the program specified in the resource
+\&\f(CW\*(C`urlLauncher\*(C'\fR (default \f(CW\*(C`x\-www\-browser\*(C'\fR) will be started.
 .IP "block-graphics-to-ascii" 4
 .IX Item "block-graphics-to-ascii"
 A not very useful example of filtering all text output to the terminal,
@@ -246,7 +248,7 @@ hints on what they mean:
 .IP "$text" 4
 .IX Item "$text"
 Rxvt-unicodes special way of encoding text, where one \*(L"unicode\*(R" character
-always represents one screen cell. See row_t for a discussion of this format.
+always represents one screen cell. See ROW_t for a discussion of this format.
 .IP "$string" 4
 .IX Item "$string"
 A perl text string, with an emphasis on \fItext\fR. It can store all unicode
@@ -477,15 +479,12 @@ The basename of the installed binaries, usually \f(CW\*(C`urxvt\*(C'\fR.
 .IX Item "$urxvt::TERM"
 The current terminal. This variable stores the current \f(CW\*(C`urxvt::term\*(C'\fR
 object, whenever a callback/hook is executing.
-.IP "*" 4
 .ie n .Sh "Functions in the ""urxvt"" Package"
 .el .Sh "Functions in the \f(CWurxvt\fP Package"
 .IX Subsection "Functions in the urxvt Package"
-.PD 0
 .ie n .IP "urxvt::fatal $errormessage" 4
 .el .IP "urxvt::fatal \f(CW$errormessage\fR" 4
 .IX Item "urxvt::fatal $errormessage"
-.PD
 Fatally aborts execution with the given error message. Avoid at all
 costs! The only time this is acceptable is when the terminal process
 starts up.
@@ -581,11 +580,10 @@ work.
 .el .IP "$term = new urxvt::term \f(CW$envhashref\fR, \f(CW$rxvtname\fR, [arg...]" 4
 .IX Item "$term = new urxvt::term $envhashref, $rxvtname, [arg...]"
 Creates a new terminal, very similar as if you had started it with system
-\&\f(CW\*(C`$rxvtname, arg...\*(C'\fR. \f(CW$envhashref\fR must be a reference to a \f(CW%ENV\fR>\-like
-\&\f(CW\*(C`hash which defines the environment of the new terminal.
-
-\&\*(C'\fR.Sp
->Croaks (and probably outputs an error message) if the new instance
+\&\f(CW\*(C`$rxvtname, arg...\*(C'\fR. \f(CW$envhashref\fR must be a reference to a \f(CW%ENV\fR\-like
+hash which defines the environment of the new terminal.
+.Sp
+Croaks (and probably outputs an error message) if the new instance
 couldn't be created.  Returns \f(CW\*(C`undef\*(C'\fR if the new instance didn't
 initialise perl, and the terminal object otherwise. The \f(CW\*(C`init\*(C'\fR and
 \&\f(CW\*(C`start\*(C'\fR hooks will be called during this call.
@@ -648,6 +646,17 @@ to see the actual list:
 \&  shade term_name title transparent transparent_all tripleclickwords
 \&  utmpInhibit visualBell
 .Ve
+.ie n .IP "$value = $term\->x_resource ($pattern)" 4
+.el .IP "$value = \f(CW$term\fR\->x_resource ($pattern)" 4
+.IX Item "$value = $term->x_resource ($pattern)"
+Returns the X\-Resource for the given pattern, excluding the program or
+class name, i.e.  \f(CW\*(C`$term\->x_resource ("boldFont")\*(C'\fR should return the
+same value as used by this instance of rxvt\-unicode. Returns \f(CW\*(C`undef\*(C'\fR if no
+resource with that pattern exists.
+.Sp
+This method should only be called during the \f(CW\*(C`on_start\*(C'\fR hook, as there is
+only one resource database per display, and later invocations might return
+the wrong resources.
 .ie n .IP "$success = $term\fR\->parse_keysym ($keysym_spec, \f(CW$command_string)" 4
 .el .IP "$success = \f(CW$term\fR\->parse_keysym ($keysym_spec, \f(CW$command_string\fR)" 4
 .IX Item "$success = $term->parse_keysym ($keysym_spec, $command_string)"
@@ -1022,7 +1031,7 @@ Displays the popup (which is initially hidden).
 .IX Subsection "The urxvt::timer Class"
 This class implements timer watchers/events. Time is represented as a
 fractional number of seconds since the epoch. Example:
-.Sp
+.PP
 .Vb 8
 \&   $term->{overlay} = $term->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0);
 \&   $term->{timer} = urxvt::timer
@@ -1033,7 +1042,6 @@ fractional number of seconds since the epoch. Example:
 \&                          sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]);
 \&                    });
 .Ve
-.RS 4
 .IP "$timer = new urxvt::timer" 4
 .IX Item "$timer = new urxvt::timer"
 Create a new timer object in started state. It is scheduled to fire
@@ -1068,13 +1076,11 @@ Set the event trigger time to \f(CW$tstamp\fR and start the timer.
 .el .IP "$timer = \f(CW$timer\fR\->stop" 4
 .IX Item "$timer = $timer->stop"
 Stop the timer.
-.RE
-.RS 4
 .ie n .Sh "The ""urxvt::iow"" Class"
 .el .Sh "The \f(CWurxvt::iow\fP Class"
 .IX Subsection "The urxvt::iow Class"
 This class implements io watchers/events. Example:
-.Sp
+.PP
 .Vb 12
 \&  $term->{socket} = ...
 \&  $term->{iow} = urxvt::iow
@@ -1115,8 +1121,6 @@ Start watching for requested events on the given handle.
 .el .IP "$iow = \f(CW$iow\fR\->stop" 4
 .IX Item "$iow = $iow->stop"
 Stop watching for events on the given filehandle.
-.RE
-.RS 4
 .SH "ENVIRONMENT"
 .IX Header "ENVIRONMENT"
 .Sh "\s-1URXVT_PERL_VERBOSITY\s0"
@@ -1130,8 +1134,6 @@ numbers indicate more verbose output.
 .IX Item ">= 3 - script loading and management"
 .IP ">=10 \- all events received" 4
 .IX Item ">=10 - all events received"
-.RE
-.RS 4
 .PD
 .SH "AUTHOR"
 .IX Header "AUTHOR"
index 1246f021fa0a82fa24555d22fa370a916211fa17..e33777a8d4fb689e82a5213f2926805b0d3c0589 100644 (file)
@@ -69,8 +69,9 @@ PREPACKAGED EXTENSIONS
         Displays a digital clock using the built-in overlay.
 
     mark-urls
-        Uses per-line display filtering ("on_line_update") to underline
-        urls.
+        Uses per-line display filtering ("on_line_update") to underline urls
+        and make them clickable. When clicked, the program specified in the
+        resource "urlLauncher" (default "x-www-browser") will be started.
 
     block-graphics-to-ascii
         A not very useful example of filtering all text output to the
@@ -100,7 +101,7 @@ API DOCUMENTATION
 
     $text
         Rxvt-unicodes special way of encoding text, where one "unicode"
-        character always represents one screen cell. See row_t for a
+        character always represents one screen cell. See ROW_t for a
         discussion of this format.
 
     $string
@@ -301,8 +302,6 @@ API DOCUMENTATION
         The current terminal. This variable stores the current "urxvt::term"
         object, whenever a callback/hook is executing.
 
-    *
-
   Functions in the "urxvt" Package
     urxvt::fatal $errormessage
         Fatally aborts execution with the given error message. Avoid at all
@@ -384,10 +383,9 @@ API DOCUMENTATION
     $term = new urxvt::term $envhashref, $rxvtname, [arg...]
         Creates a new terminal, very similar as if you had started it with
         system "$rxvtname, arg...". $envhashref must be a reference to a
-        %ENV>-like "hash which defines the environment of the new terminal.
-        "
+        %ENV-like hash which defines the environment of the new terminal.
 
-        >Croaks (and probably outputs an error message) if the new instance
+        Croaks (and probably outputs an error message) if the new instance
         couldn't be created. Returns "undef" if the new instance didn't
         initialise perl, and the terminal object otherwise. The "init" and
         "start" hooks will be called during this call.
@@ -447,6 +445,16 @@ API DOCUMENTATION
           shade term_name title transparent transparent_all tripleclickwords
           utmpInhibit visualBell
 
+    $value = $term->x_resource ($pattern)
+        Returns the X-Resource for the given pattern, excluding the program
+        or class name, i.e. "$term->x_resource ("boldFont")" should return
+        the same value as used by this instance of rxvt-unicode. Returns
+        "undef" if no resource with that pattern exists.
+
+        This method should only be called during the "on_start" hook, as
+        there is only one resource database per display, and later
+        invocations might return the wrong resources.
+
     $success = $term->parse_keysym ($keysym_spec, $command_string)
         Adds a keymap translation exactly as specified via a resource. See
         the "keysym" resource in the rxvt(1) manpage.
@@ -738,92 +746,92 @@ API DOCUMENTATION
         Displays the popup (which is initially hidden).
 
   The "urxvt::timer" Class
-        This class implements timer watchers/events. Time is represented as
-        a fractional number of seconds since the epoch. Example:
+    This class implements timer watchers/events. Time is represented as a
+    fractional number of seconds since the epoch. Example:
 
-           $term->{overlay} = $term->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0);
-           $term->{timer} = urxvt::timer
-                            ->new
-                            ->interval (1)
-                            ->cb (sub {
-                               $term->{overlay}->set (0, 0,
-                                  sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]);
-                            });                                                                                                                                      
+       $term->{overlay} = $term->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0);
+       $term->{timer} = urxvt::timer
+                        ->new
+                        ->interval (1)
+                        ->cb (sub {
+                           $term->{overlay}->set (0, 0,
+                              sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]);
+                        });                                                                                                                                      
 
-        $timer = new urxvt::timer
-            Create a new timer object in started state. It is scheduled to
-            fire immediately.
+    $timer = new urxvt::timer
+        Create a new timer object in started state. It is scheduled to fire
+        immediately.
 
-        $timer = $timer->cb (sub { my ($timer) = @_; ... })
-            Set the callback to be called when the timer triggers.
+    $timer = $timer->cb (sub { my ($timer) = @_; ... })
+        Set the callback to be called when the timer triggers.
 
-        $tstamp = $timer->at
-            Return the time this watcher will fire next.
+    $tstamp = $timer->at
+        Return the time this watcher will fire next.
 
-        $timer = $timer->set ($tstamp)
-            Set the time the event is generated to $tstamp.
+    $timer = $timer->set ($tstamp)
+        Set the time the event is generated to $tstamp.
 
-        $timer = $timer->interval ($interval)
-            Normally (and when $interval is 0), the timer will automatically
-            stop after it has fired once. If $interval is non-zero, then the
-            timer is automatically rescheduled at the given intervals.
+    $timer = $timer->interval ($interval)
+        Normally (and when $interval is 0), the timer will automatically
+        stop after it has fired once. If $interval is non-zero, then the
+        timer is automatically rescheduled at the given intervals.
 
-        $timer = $timer->start
-            Start the timer.
+    $timer = $timer->start
+        Start the timer.
 
-        $timer = $timer->start ($tstamp)
-            Set the event trigger time to $tstamp and start the timer.
+    $timer = $timer->start ($tstamp)
+        Set the event trigger time to $tstamp and start the timer.
 
-        $timer = $timer->stop
-            Stop the timer.
+    $timer = $timer->stop
+        Stop the timer.
 
   The "urxvt::iow" Class
-        This class implements io watchers/events. Example:
-
-          $term->{socket} = ...
-          $term->{iow} = urxvt::iow
-                         ->new
-                         ->fd (fileno $term->{socket})
-                         ->events (urxvt::EVENT_READ)
-                         ->start
-                         ->cb (sub {
-                           my ($iow, $revents) = @_;
-                           # $revents must be 1 here, no need to check
-                           sysread $term->{socket}, my $buf, 8192
-                              or end-of-file;
-                         });
-
-        $iow = new urxvt::iow
-            Create a new io watcher object in stopped state.
-
-        $iow = $iow->cb (sub { my ($iow, $reventmask) = @_; ... })
-            Set the callback to be called when io events are triggered.
-            $reventmask is a bitset as described in the "events" method.
-
-        $iow = $iow->fd ($fd)
-            Set the filedescriptor (not handle) to watch.
-
-        $iow = $iow->events ($eventmask)
-            Set the event mask to watch. The only allowed values are
-            "urxvt::EVENT_READ" and "urxvt::EVENT_WRITE", which might be
-            ORed together, or "urxvt::EVENT_NONE".
-
-        $iow = $iow->start
-            Start watching for requested events on the given handle.
-
-        $iow = $iow->stop
-            Stop watching for events on the given filehandle.
+    This class implements io watchers/events. Example:
+
+      $term->{socket} = ...
+      $term->{iow} = urxvt::iow
+                     ->new
+                     ->fd (fileno $term->{socket})
+                     ->events (urxvt::EVENT_READ)
+                     ->start
+                     ->cb (sub {
+                       my ($iow, $revents) = @_;
+                       # $revents must be 1 here, no need to check
+                       sysread $term->{socket}, my $buf, 8192
+                          or end-of-file;
+                     });
+
+    $iow = new urxvt::iow
+        Create a new io watcher object in stopped state.
+
+    $iow = $iow->cb (sub { my ($iow, $reventmask) = @_; ... })
+        Set the callback to be called when io events are triggered.
+        $reventmask is a bitset as described in the "events" method.
+
+    $iow = $iow->fd ($fd)
+        Set the filedescriptor (not handle) to watch.
+
+    $iow = $iow->events ($eventmask)
+        Set the event mask to watch. The only allowed values are
+        "urxvt::EVENT_READ" and "urxvt::EVENT_WRITE", which might be ORed
+        together, or "urxvt::EVENT_NONE".
+
+    $iow = $iow->start
+        Start watching for requested events on the given handle.
+
+    $iow = $iow->stop
+        Stop watching for events on the given filehandle.
 
 ENVIRONMENT
   URXVT_PERL_VERBOSITY
-        This variable controls the verbosity level of the perl extension.
-        Higher numbers indicate more verbose output.
+    This variable controls the verbosity level of the perl extension. Higher
+    numbers indicate more verbose output.
 
-        == 0 - fatal messages
-        >= 3 - script loading and management
-        >=10 - all events received
+    == 0 - fatal messages
+    >= 3 - script loading and management
+    >=10 - all events received
 
 AUTHOR
-         Marc Lehmann <pcg@goof.com>
-         http://software.schmorp.de/pkg/rxvt-unicode
+     Marc Lehmann <pcg@goof.com>
+     http://software.schmorp.de/pkg/rxvt-unicode
 
index 7ca194df2bfb66f9dc27dfa15c8e75560840ae70..8011f828cf963dd36288dfb99f4e4c19186e1c8e 100644 (file)
@@ -987,7 +987,7 @@ rxvt_term::flush ()
 
               do
                 {
-                  l = &ROW (row++);
+                  l = &ROW (row);
 
                   if (l->f & LINE_FILTERED)
                     row++;
@@ -1575,7 +1575,7 @@ rxvt_term::x_cb (XEvent &ev)
               scr_expose (ev.xexpose.x, ev.xexpose.y,
                           ev.xexpose.width, ev.xexpose.height, False);
 
-            scr_refresh (refresh_type);
+            want_refresh = 1;
           }
         else
           {
@@ -1712,7 +1712,7 @@ rxvt_term::x_cb (XEvent &ev)
                           &unused_mask);
             scr_move_to (scrollbar_position (ev.xbutton.y) - csrO,
                          scrollbar_size ());
-            scr_refresh (refresh_type);
+            want_refresh = 1;
             refresh_limit = 0;
             scrollbar_show (1);
           }
@@ -2218,21 +2218,11 @@ rxvt_term::button_release (XButtonEvent &ev)
               else
                 {
 # endif
-# ifdef JUMP_MOUSE_WHEEL
                   scr_page (v, i);
-                  scr_refresh (SMOOTH_REFRESH);
                   scrollbar_show (1);
-# else
-                  while (i--)
-                    {
-                      scr_page (v, 1);
-                      scr_refresh (SMOOTH_REFRESH);
-                      scrollbar_show (1);
-                    }
-# endif
 # ifdef MOUSE_SLIP_WHEELING
                 }
-#endif
+# endif
             }
             break;
 #endif
@@ -2836,7 +2826,7 @@ rxvt_term::cmd_parse ()
                 {
                   flag = true;
                   scr_refresh (refresh_type);
-                  flush_ev.stop ();
+                  want_refresh = 1;
                 }
             }
 
index acb8097e64cc470c7aae66a49510749f9c377d21..25572037a9f76202b42470617dad1b14006213a7 100644 (file)
  */
 #define MOUSE_THRESHOLD                50
 
-/*
- * If mouse wheel is defined, then scrolling is by 5 lines (or 1 line
- * if the shift key is down).  Scrolling can be smooth or jump scrolling
- */
-#define JUMP_MOUSE_WHEEL
-
 /*
  * Set delay periods for continuous scrolling with scrollbar buttons
  */
index 644ad7e1e490ded1cfd29c2472872b1b5e65767f..83cb99c38901ce3416e39ffe90fad93fc5839e4b 100644 (file)
@@ -7,6 +7,12 @@ my $url =
       [ab-zA-Z0-9\-\@;\/?:&=%\$_+!*\x27()~]   # exclude some trailing characters (heuristic)
    )}x;
 
+sub on_start {
+   my ($self) = @_;
+
+   $self->{browser} = urxvt::untaint $self->x_resource ("urlLauncher") || "x-www-browser";
+}
+
 sub on_line_update {
    my ($self, $row) = @_;
 
@@ -29,22 +35,20 @@ sub on_line_update {
    ()
 }
 
-# needs confgiurability TODO
-#sub on_button_press {
-#    my ($self, $event) = @_;
-#    my $row = $event->{row};
-#    my $col =  $event->{col};
-#
-#    my $line = $self->line ($row);
-#    my $text = $line->t;
-#
-#    while($text =~ /$url/g) {
-#        #print "... " . ($-[0] 
-#        if ($-[0] <= $col && $+[0] >= $col) {
-#            system "firefox \Q$1\E &";
-#            return 1;
-#        }
-#    }
-#    ()
-#}
+sub on_button_press {
+    my ($self, $event) = @_;
+    my $row = $event->{row};
+    my $col = $event->{col};
+
+    my $line = $self->line ($row);
+    my $text = $line->t;
+
+    while($text =~ /$url/g) {
+        if ($-[0] <= $col && $+[0] >= $col) {
+            system "$self->{browser} \Q$1\E &";
+            return 1;
+        }
+    }
+    ()
+}
 
index 66274e911a84e43901a7c2842b616392e8303531..88b99f39c0bffd932e1ba9a6ce400be451066f77 100644 (file)
@@ -5,7 +5,9 @@
 sub on_init {
    my ($self) = @_;
 
-   my $hotkey = $self->{argv}[0] || "M-s";
+   my $hotkey = $self->{argv}[0]
+                || $self->x_resource ("searchable-scrollback")
+                || "M-s";
 
    $self->parse_keysym ($hotkey, "perl:searchable-scrollback:start")
       or warn "unable to register '$hotkey' as scrollback search start hotkey\n";
@@ -46,7 +48,7 @@ sub enter {
    );
 
    $self->{manpage_overlay} = $self->overlay (0, -2, $self->ncol, 1, urxvt::OVERLAY_RSTYLE, 0);
-   $self->{manpage_overlay}->set (0, 0, "scrollback search, see man ${urxvt::RXVTNAME}perl");
+   $self->{manpage_overlay}->set (0, 0, "scrollback search, see the ${urxvt::RXVTNAME}perl manpage for details");
 
    $self->idle;
 }
index e5984873ad47b55244225b65206430ad804ac915..5bc679f5d2e6c7f34cb021d59add7c8b029d13ce 100644 (file)
@@ -14,6 +14,8 @@ sub msg {
 sub on_start {
    my ($self) = @_;
 
+   $self->{browser} = urxvt::untaint $self->x_resource ("urlLauncher") || "x-www-browser";
+
    $self->grab_button (3, urxvt::ControlMask);
 }
 
@@ -67,7 +69,7 @@ sub on_button_press {
             and $add_button->("shell quote" => sub { $_ = "\Q$_" });
 
          /^(http|ftp|telnet|irc|news):\//
-            and $add_button->("run x-www-browser" => sub { system "x-www-browser \Q$_\E &" });
+            and $add_button->("run $self->{browser}" => sub { system "$self->{browser} \Q$_\E &" });
       }
 
       $popup->show;
index 82c47db858d39bf723148d3cff1edd0fb602d845..33f5109c7a9154ffd30d2ae7402c4a0711094d01 100644 (file)
@@ -1258,6 +1258,7 @@ struct rxvt_term : zero_initialized, rxvt_vars {
 
   void init_secondary ();
   const char **init_resources (int argc, const char *const *argv);
+  const char *x_resource (const char *name);
   void init_env ();
   void set_locale (const char *locale);
   void init_xlocale ();
index 69a62de9eff252379a2f546d2e3ab42d263a3cdb..ddc6538127f2a5fc24098eb1edd665780c698998 100644 (file)
@@ -1278,6 +1278,11 @@ rxvt_term::_resource (char *name, int index, SV *newval = 0)
           }
 }
 
+const char *
+rxvt_term::x_resource (const char *name)
+       CLEANUP:
+        SvTAINTED_on (ST (0));
+
 bool
 rxvt_term::option (U32 optval, int set = -1)
        CODE:
index c06d47c752b6cd394e3df2ce7fa1f54cd3ff21f4..1478194ccb54ee2ca9074d5b2063ad391c41616a 100644 (file)
@@ -2383,9 +2383,6 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
    */
   scr_reverse_selection ();
 
-  if (refresh_type & SMOOTH_REFRESH)
-    XFlush (display->display);
-
   num_scr = 0;
   num_scr_allow = 1;
 }
index 46f3fa56525813d25fcb7af92f0def45b5e32a1c..4106cbc60301fa53c57be8e97c30f38409094ca3 100644 (file)
@@ -86,7 +86,9 @@ Displays a digital clock using the built-in overlay.
 
 =item mark-urls
 
-Uses per-line display filtering (C<on_line_update>) to underline urls.
+Uses per-line display filtering (C<on_line_update>) to underline urls and
+make them clickable. When clicked, the program specified in the resource
+C<urlLauncher> (default C<x-www-browser>) will be started.
 
 =item block-graphics-to-ascii
 
@@ -125,7 +127,7 @@ hints on what they mean:
 =item $text
 
 Rxvt-unicodes special way of encoding text, where one "unicode" character
-always represents one screen cell. See L<row_t> for a discussion of this format.
+always represents one screen cell. See L<ROW_t> for a discussion of this format.
 
 =item $string
 
@@ -388,8 +390,6 @@ The basename of the installed binaries, usually C<urxvt>.
 The current terminal. This variable stores the current C<urxvt::term>
 object, whenever a callback/hook is executing.
 
-=item
-
 =back
 
 =head2 Functions in the C<urxvt> Package
@@ -784,8 +784,8 @@ sub register_package {
 =item $term = new urxvt::term $envhashref, $rxvtname, [arg...]
 
 Creates a new terminal, very similar as if you had started it with system
-C<$rxvtname, arg...>. C<$envhashref> must be a reference to a %ENV>-like
-C<hash which defines the environment of the new terminal.
+C<$rxvtname, arg...>. C<$envhashref> must be a reference to a C<%ENV>-like
+hash which defines the environment of the new terminal.
 
 Croaks (and probably outputs an error message) if the new instance
 couldn't be created.  Returns C<undef> if the new instance didn't
@@ -864,6 +864,17 @@ sub resource($$;$) {
    &urxvt::term::_resource
 }
 
+=item $value = $term->x_resource ($pattern)
+
+Returns the X-Resource for the given pattern, excluding the program or
+class name, i.e.  C<< $term->x_resource ("boldFont") >> should return the
+same value as used by this instance of rxvt-unicode. Returns C<undef> if no
+resource with that pattern exists.
+
+This method should only be called during the C<on_start> hook, as there is
+only one resource database per display, and later invocations might return
+the wrong resources.
+
 =item $success = $term->parse_keysym ($keysym_spec, $command_string)
 
 Adds a keymap translation exactly as specified via a resource. See the
@@ -1444,6 +1455,8 @@ sub DESTROY {
    $self->{term}->ungrab;
 }
 
+=back
+
 =head2 The C<urxvt::timer> Class
 
 This class implements timer watchers/events. Time is represented as a
index d83b008f61e24cfadae75c8e5af7e1ac507137ea..1f2d5f3531f16dd258a46060f510ede76eee184d 100644 (file)
@@ -773,7 +773,8 @@ rxvt_term::parse_keysym (const char *str, const char *arg)
 # endif                                /* KEYSYM_RESOURCE */
 #endif                         /* NO_RESOURCES */
 
-char *get_res (XrmDatabase database, const char *program, const char *option)
+static char *
+get_res (XrmDatabase database, const char *program, const char *option)
 {
   char resource[512];
   char *type;
@@ -785,49 +786,50 @@ char *get_res (XrmDatabase database, const char *program, const char *option)
   return result.addr;
 }
 
-/*{{{ read the resources files */
-/*
- * using XGetDefault () or the hand-rolled replacement
- */
-/* ARGSUSED */
+const char *
+rxvt_term::x_resource (const char *name)
+{
+  XrmDatabase database = XrmGetDatabase (display->display);
+
+  const char *p = get_res (database, rs[Rs_name], name);
+  const char *p0 = get_res (database, "!INVALIDPROGRAMMENAMEDONTMATCH!", name);
+
+  if (p == NULL || (p0 && strcmp (p, p0) == 0))
+    {
+      p = get_res (database, RESCLASS, name);
+#ifdef RESFALLBACK
+      if (p == NULL || (p0 && strcmp (p, p0) == 0))
+        p = get_res (database, RESFALLBACK, name);
+#endif
+    }
+
+  if (p == NULL && p0)
+    p = p0;
+
+  return p;
+}
+
 void
 rxvt_term::extract_resources ()
 {
-  dDisp;
-
 #ifndef NO_RESOURCES
-  XrmDatabase database = XrmGetDatabase (display->display);
-
   /*
    * Query resources for options that affect us
    */
   for (int entry = 0; entry < optList_size; entry++)
     {
       int s;
-      char *p, *p0;
       const char *kw = optList[entry].kw;
 
       if (kw == NULL || rs[optList[entry].doff] != NULL)
         continue; // previously set
 
-      p = get_res (database, rs[Rs_name], kw);
-      p0 = get_res (database, "!INVALIDPROGRAMMENAMEDONTMATCH!", kw);
-      if (p == NULL || (p0 && strcmp (p, p0) == 0))
-        {
-          p = get_res (database, RESCLASS, kw);
-#ifdef RESFALLBACK
-          if (p == NULL || (p0 && strcmp (p, p0) == 0))
-            p = get_res (database, RESFALLBACK, kw);
-#endif
-        }
-
-      if (p == NULL && p0)
-        p = p0;
+      const char *p = x_resource (kw);
 
       if (p)
         {
           p = strdup (p);
-          allocated.push_back (p);
+          allocated.push_back ((void *)p);
           rs[optList[entry].doff] = p;
 
           if (optList_isBool (entry))
@@ -849,6 +851,7 @@ rxvt_term::extract_resources ()
    * [R5 or later]: enumerate the resource database
    */
 #  ifdef KEYSYM_RESOURCE
+  XrmDatabase database = XrmGetDatabase (display->display);
   XrmName name_prefix[3];
   XrmClass class_prefix[3];
 
@@ -875,5 +878,4 @@ rxvt_term::extract_resources ()
 #endif                         /* NO_RESOURCES */
 }
 
-/*}}} */
 /*----------------------- end-of-file (C source) -----------------------*/