repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 8bd9b1db84307e0eb033d45ae6aff8a0850c3a29:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 8bd9b1db84307e0eb033d45ae6aff8a0850c3a29
Author: Marc Lehmann 
Date:   Sun Jan 8 05:50:27 2006 +0000

    *** empty log message ***

diff --git a/Changes b/Changes
index 78229dba50f2db4d2f636d8478244daea77e6c6a..
index ..05ab8da5e7daa82a296d47feebe409dd8e093240 100644
--- a/Changes
+++ b/Changes
@@ -9,12 +9,15 @@ WISH: OnTheSpot editing, or maybe switch to miiiiiiif
 WISH: just for fun, do shade and tint with XRender.
 WISH: support tex fonts

-TODO: document transient_for, vt
+TODO: document transient_for, vt and the grab etc. functionality

 	- perl: implement additional hook: line_update, add_lines.
         - perl: urxvt::line now can set via ->t and ->r.
         - perl: changed interpretation of --perl-ext-common and -pe.
-        - perl: much increased functionality, better overlays, popup support.
+        - perl: finally implemented --perl-eval.
+        - perl: much increased functionality, better overlays, popup support
+          and much much more.
+        - perl: anyevent support.

 6.3  Wed Jan  4 22:37:10 CET 2006
         - SECURITY FIX: on systems using openpty, permissions were
diff --git a/src/perl/selection b/src/perl/selection
index 1a0a466327522dbd636790f9f4df84ebb2f976ed..
index ..b0c1faf22e8340740f3b05aa97bd344c7db11021 100644
--- a/src/perl/selection
+++ b/src/perl/selection
@@ -17,10 +17,13 @@ my @mark_patterns = (
       [ab-zA-Z0-9\-\@;\/?:&=%\$_+!*\x27(),~]   # do not include a trailing dot, its wrong too often
    )}x,

-   # common forms of quoting
-   qr{(?:^|\s) [‘`] ([^‘`’']+) [’'] (?:\s|$)}x,
+   # common "parentheses"
+   qr{(?:^|\s) ‘  ([^‘’]+?) ’  (?:\s|$)}x,
+   qr{(?:^|\s) `  ([^`']+?) '  (?:\s|$)}x,
+   qr{         \{ ([^{}]+?) \}         }x,
+   qr{         \[ ([^{}]+?) \]         }x,

-   # shell-like argument quoting
+   # shell-like argument quoting, basically always matches
    qr{\G [\ \t|&;<>()] *(
       (?:
          [^\\"'\ \t|&;<>()]+
diff --git a/src/urxvt.pm b/src/urxvt.pm
index af902a5d7c2a2353b4b04f9b06887db073721df4..
index ..6dc7a9fd9a52cb9ef55f4572c02f11a8a95642ff 100644
--- a/src/urxvt.pm
+++ b/src/urxvt.pm
@@ -344,7 +344,7 @@ Returns the "current time" (as per the event loop).
 Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask,
 Button4Mask, Button5Mask, AnyModifier

-Various constants for use in X events.
+Various constants for use in X calls and event processing.

 =back

@@ -409,6 +409,7 @@ use strict;
 use Scalar::Util ();
 use List::Util ();

+our $VERSION = 1;
 our $TERM;
 our @HOOKNAME;
 our %OPTION;
@@ -509,6 +510,9 @@ sub invoke {
             warn "perl extension '$ext' not found in perl library search path\n";
          }
       }
+
+      eval "#line 1 \"--perl-eval resource/argument\"\n" . $TERM->resource ("perl_eval");
+      warn $@ if $@;
    }

    $retval = undef;
@@ -553,6 +557,8 @@ sub invoke {
    $retval
 }

+# urxvt::term::proxy
+
 sub urxvt::term::proxy::AUTOLOAD {
    $urxvt::term::proxy::AUTOLOAD =~ /:([^:]+)$/
       or die "FATAL: \$AUTOLOAD '$urxvt::term::proxy::AUTOLOAD' unparsable";
@@ -568,6 +574,8 @@ sub urxvt::term::proxy::AUTOLOAD {
    goto &$urxvt::term::proxy::AUTOLOAD;
 }

+# urxvt::destroy_hook
+
 sub urxvt::destroy_hook::DESTROY {
    ${$_[0]}->();
 }
@@ -576,6 +584,68 @@ sub urxvt::destroy_hook(&) {
    bless \shift, urxvt::destroy_hook::
 }

+# urxvt::anyevent
+
+package urxvt::anyevent;
+
+our $VERSION = 1;
+
+$INC{"urxvt/anyevent.pm"} = 1; # mark us as there
+push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::];
+
+sub timer {
+   my ($class, %arg) = @_;
+
+   my $cb = $arg{cb};
+
+   urxvt::timer
+      ->new
+      ->start (urxvt::NOW + $arg{after})
+      ->cb (sub {
+        $_[0]->stop; # need to cancel manually
+        $cb->();
+      })
+}
+
+sub io {
+   my ($class, %arg) = @_;
+
+   my $cb = $arg{cb};
+
+   bless [$arg{fh}, urxvt::iow
+             ->new
+             ->fd (fileno $arg{fh})
+             ->events (($arg{poll} =~ /r/ ? 1 : 0)
+                     | ($arg{poll} =~ /w/ ? 2 : 0))
+             ->start
+             ->cb (sub {
+                $cb->(($_[1] & 1 ? 'r' : '')
+                    . ($_[1] & 2 ? 'w' : ''));
+             })],
+         urxvt::anyevent::
+}
+
+sub DESTROY {
+   $_[0][1]->stop;
+}
+
+sub condvar {
+   bless \my $flag, urxvt::anyevent::condvar::
+}
+
+sub urxvt::anyevent::condvar::broadcast {
+   ${$_[0]}++;
+}
+
+sub urxvt::anyevent::condvar::wait {
+   unless (${$_[0]}) {
+      require Carp;
+      Carp::croak ("AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API");
+   }
+}
+
+package urxvt::term;
+
 =head2 The C Class

 =over 4
@@ -636,7 +706,7 @@ to see the actual list:

 =cut

-sub urxvt::term::resource($$;$) {
+sub resource($$;$) {
    my ($self, $name) = (shift, shift);
    unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0);
    &urxvt::term::_resource
@@ -733,7 +803,7 @@ currently).

 =cut

-sub urxvt::term::popup {
+sub popup {
    my ($self, $event) = @_;

    $self->grab ($event->{time}, 1)
@@ -933,7 +1003,7 @@ Translates a string offset into terminal coordinates again.

 =cut

-sub urxvt::term::line {
+sub line {
    my ($self, $row) = @_;

    my $maxrow = $self->nrow - 1;
@@ -1021,14 +1091,16 @@ C<< $term->ROW_t >> for details.

 =back

+=cut
+
+package urxvt::popup;
+
 =head2 The C Class

 =over 4

 =cut

-package urxvt::popup;
-
 sub add_item {
    my ($self, $item) = @_;

-----END OF PAGE-----