From d4ad302509e15a8176e75bc851387e19629a5850 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 18 Jan 2006 09:40:53 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 2 +- doc/rxvtperl.3.html | 69 ++++++++++++++++++++++++++----------------- doc/rxvtperl.3.man.in | 58 +++++++++++++++++++++--------------- doc/rxvtperl.3.txt | 44 +++++++++++++++++---------- src/rxvtperl.xs | 13 ++++++-- src/screen.C | 16 +++++----- 6 files changed, 125 insertions(+), 77 deletions(-) diff --git a/Changes b/Changes index eebdb78e..1446163e 100644 --- a/Changes +++ b/Changes @@ -14,7 +14,7 @@ WISH: support tex fonts 9.0 TODO: on_seelction_popup hook or so. -TODO: echo * at bottom => borked line lengths +TODO: distributed clipboard example - new script: perl/selection-pastebin - improved security of setuid/setgid operation, which is now encouraged, by moving privileged operations into a separate diff --git a/doc/rxvtperl.3.html b/doc/rxvtperl.3.html index ea805bce..d34b1730 100644 --- a/doc/rxvtperl.3.html +++ b/doc/rxvtperl.3.html @@ -134,33 +134,6 @@ Rot-13 the selection when activated. Used via keyboard trigger:
    URxvt.keysym.C-M-r: perl:selection:rot13
-

-
remote-pastebin
-
-
-Upload the selection as textfile to a remote site. -
-
-
-   URxvt.keysym.C-M-e: perl:selection:remote-pastebin
-
-
-

To set the command to upload the file set this resource:

-
-
-
-   URxvt.selection-pastebin-cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/.
-
-
-

The % is the placeholder for the textfile. The name of the textfile is the hex encoded -md5 sum of the selection. -After an successful upload the selection will be replaced by the following url -(the % is the placeholder for the filename):

-
-
-
-   URxvt.selection-pastebin-url: http://www.ta-sa.org/files/txt/%
-

option-popup (enabled by default)
@@ -276,6 +249,48 @@ Displays a very simple digital clock in the upper right corner of the window. Illustrates overwriting the refresh callbacks to create your own overlays or changes. +

+
selection-pastebin
+
+
+This is a little rarely useful extension that Uploads the selection as +textfile to a remote site (or does other things). (The implementation is +not currently secure for use in a multiuser environment as it writes to +/tmp directly.). +
+
+

It listens to the selection-pastebin:remote-pastebin keyboard command, +i.e.

+
+
+
+   URxvt.keysym.C-M-e: perl:selection-pastebin:remote-pastebin
+
+
+

Pressing this combination runs a command with % replaced by the name of +the textfile. This command can be set via a resource:

+
+
+
+   URxvt.selection-pastebin.cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/.
+
+
+

And the default is likely not useful to anybody but the few people around +here :)

+
+
+

The name of the textfile is the hex encoded md5 sum of the selection, so +the same content should lead to the same filename.

+
+
+

After a successful upload the selection will be replaced by the text given +in the selection-pastebin-url resource (again, the % is the placeholder +for the filename):

+
+
+
+   URxvt.selection-pastebin.url: http://www.ta-sa.org/files/txt/%
+

diff --git a/doc/rxvtperl.3.man.in b/doc/rxvtperl.3.man.in index 6eb92a0c..c1612b85 100644 --- a/doc/rxvtperl.3.man.in +++ b/doc/rxvtperl.3.man.in @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "rxvt 3" -.TH rxvt 3 "2006-01-17" "7.1" "RXVT-UNICODE" +.TH rxvt 3 "2006-01-18" "7.1" "RXVT-UNICODE" .SH "NAME" @@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter .SH "SYNOPSIS" @@ -214,28 +214,6 @@ Rot\-13 the selection when activated. Used via keyboard trigger: .Vb 1 \& URxvt.keysym.C-M-r: perl:selection:rot13 .Ve -.IP "remote-pastebin" 4 -.IX Item "remote-pastebin" -Upload the selection as textfile to a remote site. -.Sp -.Vb 1 -\& URxvt.keysym.C-M-e: perl:selection:remote-pastebin -.Ve -.Sp -To set the command to upload the file set this resource: -.Sp -.Vb 1 -\& URxvt.selection-pastebin-cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/. -.Ve -.Sp -The % is the placeholder for the textfile. The name of the textfile is the hex encoded -md5 sum of the selection. -After an successful upload the selection will be replaced by the following url -(the % is the placeholder for the filename): -.Sp -.Vb 1 -\& URxvt.selection-pastebin-url: http://www.ta-sa.org/files/txt/% -.Ve .RE .RS 4 .RE @@ -323,6 +301,40 @@ Displays a digital clock using the built-in overlay. Displays a very simple digital clock in the upper right corner of the window. Illustrates overwriting the refresh callbacks to create your own overlays or changes. +.IP "selection-pastebin" 4 +.IX Item "selection-pastebin" +This is a little rarely useful extension that Uploads the selection as +textfile to a remote site (or does other things). (The implementation is +not currently secure for use in a multiuser environment as it writes to +\&\fI/tmp\fR directly.). +.Sp +It listens to the \f(CW\*(C`selection\-pastebin:remote\-pastebin\*(C'\fR keyboard command, +i.e. +.Sp +.Vb 1 +\& URxvt.keysym.C-M-e: perl:selection-pastebin:remote-pastebin +.Ve +.Sp +Pressing this combination runs a command with \f(CW\*(C`%\*(C'\fR replaced by the name of +the textfile. This command can be set via a resource: +.Sp +.Vb 1 +\& URxvt.selection-pastebin.cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/. +.Ve +.Sp +And the default is likely not useful to anybody but the few people around +here :) +.Sp +The name of the textfile is the hex encoded md5 sum of the selection, so +the same content should lead to the same filename. +.Sp +After a successful upload the selection will be replaced by the text given +in the \f(CW\*(C`selection\-pastebin\-url\*(C'\fR resource (again, the % is the placeholder +for the filename): +.Sp +.Vb 1 +\& URxvt.selection-pastebin.url: http://www.ta-sa.org/files/txt/% +.Ve .SH "API DOCUMENTATION" .IX Header "API DOCUMENTATION" .Sh "General \s-1API\s0 Considerations" diff --git a/doc/rxvtperl.3.txt b/doc/rxvtperl.3.txt index e64f51b5..251977d0 100644 --- a/doc/rxvtperl.3.txt +++ b/doc/rxvtperl.3.txt @@ -66,22 +66,6 @@ PREPACKAGED EXTENSIONS URxvt.keysym.C-M-r: perl:selection:rot13 - remote-pastebin - Upload the selection as textfile to a remote site. - - URxvt.keysym.C-M-e: perl:selection:remote-pastebin - - To set the command to upload the file set this resource: - - URxvt.selection-pastebin-cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/. - - The % is the placeholder for the textfile. The name of the - textfile is the hex encoded md5 sum of the selection. After an - successful upload the selection will be replaced by the - following url (the % is the placeholder for the filename): - - URxvt.selection-pastebin-url: http://www.ta-sa.org/files/txt/% - option-popup (enabled by default) Binds a popup menu to Ctrl-Button2 that lets you toggle (some) options at runtime. @@ -160,6 +144,34 @@ PREPACKAGED EXTENSIONS the window. Illustrates overwriting the refresh callbacks to create your own overlays or changes. + selection-pastebin + This is a little rarely useful extension that Uploads the selection + as textfile to a remote site (or does other things). (The + implementation is not currently secure for use in a multiuser + environment as it writes to /tmp directly.). + + It listens to the "selection-pastebin:remote-pastebin" keyboard + command, i.e. + + URxvt.keysym.C-M-e: perl:selection-pastebin:remote-pastebin + + Pressing this combination runs a command with "%" replaced by the + name of the textfile. This command can be set via a resource: + + URxvt.selection-pastebin.cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/. + + And the default is likely not useful to anybody but the few people + around here :) + + The name of the textfile is the hex encoded md5 sum of the + selection, so the same content should lead to the same filename. + + After a successful upload the selection will be replaced by the text + given in the "selection-pastebin-url" resource (again, the % is the + placeholder for the filename): + + URxvt.selection-pastebin.url: http://www.ta-sa.org/files/txt/% + API DOCUMENTATION General API Considerations All objects (such as terminals, time watchers etc.) are typical diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index a3768a69..75b840b5 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -1514,8 +1514,17 @@ rxvt_term::screen_cur (...) if (items == 3) { - rc.row = clamp (SvIV (ST (1)), THIS->top_row, THIS->nrow - 1); - rc.col = clamp (SvIV (ST (2)), 0, THIS->ncol - 1); + rc.row = SvIV (ST (1)); + rc.col = SvIV (ST (2)); + + if (ix == 2 && rc.col == 0) + { + rc.row--; + rc.col = THIS->ncol; + } + + clamp_it (rc.col, 0, THIS->ncol); + clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); if (ix) THIS->want_refresh = 1; diff --git a/src/screen.C b/src/screen.C index dc86668e..1b626c41 100644 --- a/src/screen.C +++ b/src/screen.C @@ -622,19 +622,19 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) // scroll everything up 'count' lines term_start = (term_start + count) % total_rows; + // sever bottommost line { - // severe bottommost scrolled line line_t &l = ROW(row2 - count); - l.touch (); l.is_longer (0); + l.touch (); } - // erase newly scorlled-in lines - for (int i = count; i; --i ) + // erase newly scrolled-in lines + for (int i = count; i--; ) { // basically this is a slightly optimized scr_blank_screen_mem // it is worth the effort on slower machines - line_t &l = ROW(nrow - i); + line_t &l = ROW(row2 - i); scr_blank_line (l, 0, l.l, rstyle); @@ -819,11 +819,11 @@ rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) if (screen.flags & Screen_WrapNext) { - max_it (line->l, ncol); - line->is_longer (1); - scr_do_wrap (); + line->l = ncol; + line->is_longer (1); + row = screen.cur.row; line = &ROW(row); /* _must_ refresh */ } -- 2.34.1