basefont, even if explicitly specified (tracked down by tpope).
- fixed urxvt::strwidth to calculate width in the same way as screen.C.
- fix a crash caused by passing negative widths to overlay functions.
+ - added 'matcher' extension by tpope, replacing the mark-urls extension.
+ - improve url regex to match anything www.* (tpope).
- give proper diagnostic when RXVT_SOCKET is too long instead of
corrupting the stack (patch by exg).
- urxvtd no longer crashes when the client sends an inaccessible
+++ /dev/null
-#! perl
-
-# same url as used in "selection"
-my $url =
- qr{(
- (?:https?://|ftp://|news://|mailto:|file://)[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~#]+
- [ab-zA-Z0-9\-\@;\/?:&=%\$_+!*\x27()~] # exclude some trailing characters (heuristic)
- )}x;
-
-sub on_start {
- my ($self) = @_;
-
- $self->{browser} = $self->x_resource ("urlLauncher") || "x-www-browser";
-
- ()
-}
-
-sub on_line_update {
- my ($self, $row) = @_;
-
- # fetch the line that has changed
- my $line = $self->line ($row);
- my $text = $line->t;
-
- # find all urls (if any)
- while ($text =~ /$url/g) {
- my $rend = $line->r;
-
- # mark all characters as underlined. we _must_ not toggle underline,
- # as we might get called on an already-marked url.
- $_ |= urxvt::RS_Uline
- for @{$rend}[ $-[1] .. $+[1] - 1];
-
- $line->r ($rend);
- }
-
- ()
-}
-
-sub on_button_release {
- my ($self, $event) = @_;
-
- my $mask = $self->ModLevel3Mask | $self->ModMetaMask
- | urxvt::ShiftMask | urxvt::ControlMask;
-
- if ($event->{button} == 2 && ($event->{state} & $mask) == 0) {
- my $row = $event->{row};
- my $col = $event->{col};
-
- my $line = $self->line ($row);
- my $text = $line->t;
-
- while ($text =~ /$url/g) {
- if ($-[1] <= $col && $+[1] >= $col) {
- $self->exec_async ($self->{browser}, $1);
- return 1;
- }
- }
- }
-
- ()
-}
-
# urls, just a heuristic
qr{(
- (?:https?://|ftp://|news://|mailto:|file://)[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~#]+
- [ab-zA-Z0-9\-\@;\/?:&=%\$_+!*\x27()~] # exclude some trailing characters (heuristic)
+ (?:https?://|ftp://|news://|mailto:|file://|\bwww\.)[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~#]+
+ [ab-zA-Z0-9\-\@;\/?:&=%\$_+*()~] # exclude some trailing characters (heuristic)
)}x,
# shell-like argument quoting, basically always matches
See I<COLOR AND GRAPHICS> in the @@RXVT_NAME@@(1) manpage for valid
indices.
-=item mark-urls
-
-Uses per-line display filtering (C<on_line_update>) to underline urls and
-make them clickable. When middle-clicked, the program specified in the
-resource C<urlLauncher> (default C<x-www-browser>) will be started with
-the URL as first argument.
+=item matcher
+
+Uses per-line display filtering (C<on_line_update>) to underline text
+matching a certain pattern and make it clickable. When clicked with the
+mouse button specified in the C<matcher.button> resource (default 2, or
+middle), the program specified in the C<matcher.launcher> resource
+(default, the C<urlLauncher> resource, C<sensible-browser>) will be started
+with the matched text as first argument. The default configuration is
+suitable for matching URLs and launching a web browser, like the
+former "mark-urls" extension.
+
+The default pattern to match URLs can be overridden with the
+C<matcher.pattern.0> resource, and additional patterns can be specified
+with numbered patterns, in a manner similar to the "selection" extension.
+The launcher can also be overridden on a per-pattern basis.
+
+Example configuration:
+
+ URxvt.perl-ext: default,matcher
+ URxvt.urlLauncher: sensible-browser
+ URxvt.matcher.button: 1
+ URxvt.matcher.pattern.1: \\bwww\\.[\\w-]\\.[\\w./?&@#-]*[\\w/-]
+ URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$)
+ URxvt.matcher.launcher.2: gvim +$2 $1
=item xim-onthespot