*** empty log message ***
authorroot <root>
Wed, 25 Jan 2006 15:32:48 +0000 (15:32 +0000)
committerroot <root>
Wed, 25 Jan 2006 15:32:48 +0000 (15:32 +0000)
Changes
MANIFEST
src/hookinc.h
src/keyboard.C
src/perl/remote-clipboard
src/perl/remote-selection [deleted file]
src/perl/searchable-scrollback
src/perl/selection
src/perl/selection-pastebin
src/urxvt.pm

diff --git a/Changes b/Changes
index fa2e4d5b98a7fac0343d1a1090ea78b2d25c9034..fcc4cdec335ceb657d6e5d1b851bd41be7b9af25 100644 (file)
--- a/Changes
+++ b/Changes
@@ -18,7 +18,7 @@ DUMB: support tex fonts
         - moved Shift-Button2 paste combination to Meta-Button2.
         - the cutchars resource will now be respected and used by the
           selection extension.
-        - added the "remote-selection" extension which just runs external
+        - added the "remote-clipboard" extension which just runs external
           commands to fetch and store the selection data.
         - removed (unused) arabic presentation form composing sequences.
         - be more strict when deciding that a core font glyph is too wide and
@@ -28,6 +28,7 @@ DUMB: support tex fonts
         - redraw even more characters around characters usign careful mode.
         - reduced number of server turnarounds at startup by allocating
           atoms only once per display.
+        - renamed on_keyboard_command to on_user_command.
         - changed version sos (ESC [ > c) response to be more compatible with
           xterm.
 
index e24748dbaaf175bcbbd7c7498a057b8d36bac9ac..4f2293a061d3273d3248c10cd1d61d5a038612d9 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -171,7 +171,7 @@ src/perl/mark-urls
 src/perl/tabbed
 src/perl/xim-onthespot
 src/perl/readline
-src/perl/remote-selection
+src/perl/remote-clipboard
 src/perl/example-refresh-hooks
 src/perl/block-graphics-to-ascii
 src/perl/digital-clock
index e716ee7beee54935a005c40ce11139b67b4140c7..33e910f3cfc0f1afb15b7a59dccb25f9ecf04e4a 100644 (file)
@@ -24,7 +24,7 @@
   def (REFRESH_BEGIN)
   def (REFRESH_END)
 
-  def (KEYBOARD_COMMAND)
+  def (USER_COMMAND)
 
   def (X_EVENT)
   def (FOCUS_IN)
index 736528434c61db68114324f7318c6bd6a25aacbf..0ef520f9e3573249524cae81ff8e05a38f17d443 100644 (file)
@@ -76,7 +76,7 @@ output_string (rxvt_term *rt, const char *str)
   if (strncmp (str, "command:", 8) == 0)
     rt->cmd_write (str + 8, strlen (str) - 8);
   else if (strncmp (str, "perl:", 5) == 0)
-    HOOK_INVOKE((rt, HOOK_KEYBOARD_COMMAND, DT_STR, str + 5, DT_END));
+    HOOK_INVOKE((rt, HOOK_USER_COMMAND, DT_STR, str + 5, DT_END));
   else
     rt->tt_write (str, strlen (str));
 }
index c73b723110fbdc52fd7201a2089ee05f30d0c0b2..0b7140d430f26e849f233d06becef3bac93569ad 100644 (file)
@@ -75,9 +75,7 @@ sub fetch {
             $self->selection_clear;
             $self->selection ($txt);
             $self->selection_grab (urxvt::CurrentTime);
-            close $fh;
-            my $status = $? >> 8;
-            $self->msg ("selection fetched (status $status)");
+            $self->msg ("selection fetched");
          }
       });
    }
@@ -102,7 +100,7 @@ sub on_start {
    ()
 }
 
-sub on_keyboard_command {
+sub on_user_command {
    my ($self, $cmd) = @_;
 
    if ($cmd eq "selection-pastebin:remote-pastebin") {
diff --git a/src/perl/remote-selection b/src/perl/remote-selection
deleted file mode 100644 (file)
index c73b723..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#! perl
-
-use Fcntl ();
-
-sub msg {
-   my ($self, $msg) = @_;
-
-   my $ov = $self->overlay (-1, 0, $self->strwidth ($msg), 1, urxvt::OVERLAY_RSTYLE, 0);
-   $ov->set (0, 0, $msg);
-
-   $self->{msg} =
-      urxvt::timer
-              ->new
-              ->after (5)
-              ->cb (sub { delete $self->{msg}; undef $ov; });
-}
-
-sub wait_pipe {
-   my ($self, $fh, $pid, $msg) = @_;
-
-   $self->msg ("waiting for selection process to finish...");
-
-   my $wait_pipe; $wait_pipe = urxvt::pw->new->start ($pid)->cb (sub {
-      my ($undef, $status) = @_;
-      undef $wait_pipe;
-      close $fh;
-      $status >>= 8;
-      $self->msg ("$msg (status $status)");
-   });
-}
-
-sub store {
-   my ($self) = @_;
-
-   my $txt = $self->selection;
-
-   local %ENV = %{ $self->env };
-   if (my $pid = open my $fh, "|-:utf8", $self->{store_cmd}) {
-      fcntl $fh, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK;
-      $self->{iow} = urxvt::iow
-                     ->new
-                     ->fd (fileno $fh)
-                     ->events (urxvt::EVENT_WRITE)
-                     ->start
-                     ->cb (sub {
-         if (my $len = syswrite $fh, $txt) {
-            substr $txt, 0, $len, "";
-            $self->msg ((length $txt) . " chars to go...");
-         } else {
-            delete $self->{iow};
-            $self->wait_pipe ($fh, $pid, "selection stored");
-         }
-      });
-   }
-}
-
-sub fetch {
-   my ($self) = @_;
-
-   my $txt;
-
-   local %ENV = %{ $self->env };
-   if (my $pid = open my $fh, "-|:utf8", $self->{fetch_cmd}) {
-      fcntl $fh, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK;
-      $self->{iow} = urxvt::iow
-                     ->new
-                     ->fd (fileno $fh)
-                     ->events (urxvt::EVENT_READ)
-                     ->start
-                     ->cb (sub {
-         if (my $len = sysread $fh, $txt, 8192, length $txt) {
-            $self->msg ((length $txt) . " chars read...");
-         } else {
-            delete $self->{iow};
-            $self->selection_clear;
-            $self->selection ($txt);
-            $self->selection_grab (urxvt::CurrentTime);
-            close $fh;
-            my $status = $? >> 8;
-            $self->msg ("selection fetched (status $status)");
-         }
-      });
-   }
-}
-
-sub on_start {
-   my ($self) = @_;
-
-   $self->{store_cmd} = $self->x_resource ("remote-selection.store")
-                        || "rsh ruth 'cat >/tmp/distributed-selection'";
-
-   $self->{fetch_cmd} = $self->x_resource ("remote-selection.fetch")
-                        || "rsh ruth 'cat /tmp/distributed-selection'";
-
-   push @{ $self->{term}{selection_popup_hook} }, sub {
-      ("selection => remote" => sub { $self->store })
-   };
-   push @{ $self->{term}{selection_popup_hook} }, sub {
-      ("remote => selection" => sub { $self->fetch })
-   };
-
-   ()
-}
-
-sub on_keyboard_command {
-   my ($self, $cmd) = @_;
-
-   if ($cmd eq "selection-pastebin:remote-pastebin") {
-      $self->upload_paste;
-   }
-
-   ()
-}
-
index f89bcd2788833ec253c3a525a42d67046f11ca1b..41188890148722b3330176a25f1f40e2522ca0a2 100644 (file)
@@ -15,7 +15,7 @@ sub on_init {
    ()
 }
 
-sub on_keyboard_command {
+sub on_user_command {
    my ($self, $cmd) = @_;
 
    $cmd eq "searchable-scrollback:start"
index be16135fc0a72d1aa7ba8744e28bcf93affe8ff7..2a34fbcedb28793aa43d3fa3a49c8d297dedb607 100644 (file)
@@ -1,6 +1,6 @@
 #! perl
 
-sub on_keyboard_command {
+sub on_user_command {
    my ($self, $cmd) = @_;
 
    $cmd eq "selection:rot13"
index 0da4191dfe847c0766d431b53b4011baa06fa601..f9ef7f1fc611de9e56d644f254a237d7a5d3ca94 100644 (file)
@@ -69,7 +69,7 @@ sub on_start {
    ()
 }
 
-sub on_keyboard_command {
+sub on_user_command {
    my ($self, $cmd) = @_;
 
    if ($cmd eq "selection-pastebin:remote-pastebin") {
index 39287bee278d33959fb366876467bdafdee41c07..82bba672941598939d6525b904535c69eb8d593d 100644 (file)
@@ -244,7 +244,7 @@ similar-looking ascii character.
 
 Displays a digital clock using the built-in overlay.
 
-=item remote-selection
+=item remote-clipboard
 
 Somewhat of a misnomer, this extension adds two menu entries to the
 selection popup that allows one ti run external commands to store the
@@ -517,12 +517,15 @@ code is run after this hook, and takes precedence.
 
 Called just after the screen gets redrawn. See C<on_refresh_begin>.
 
-=item on_keyboard_command $term, $string
+=item on_user_command $term, $string
 
-Called whenever the user presses a key combination that has a
-C<perl:string> action bound to it (see description of the B<keysym>
+Called whenever the a user-configured event is being activated (e.g. via
+a C<perl:string> action bound to a key, see description of the B<keysym>
 resource in the @@RXVT_NAME@@(1) manpage).
 
+The event is simply the action string. This interface is assumed to change
+slightly in the future.
+
 =item on_x_event $term, $event
 
 Called on every X event received on the vt window (and possibly other