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
<pre>
URxvt.keysym.C-M-r: perl:selection:rot13</pre>
</dd>
-<p></p>
-<dt><strong><a name="item_remote_2dpastebin">remote-pastebin</a></strong><br />
-</dt>
-<dd>
-Upload the selection as textfile to a remote site.
-</dd>
-<dd>
-<pre>
- URxvt.keysym.C-M-e: perl:selection:remote-pastebin</pre>
-</dd>
-<dd>
-<p>To set the command to upload the file set this resource:</p>
-</dd>
-<dd>
-<pre>
- URxvt.selection-pastebin-cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/.</pre>
-</dd>
-<dd>
-<p>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):</p>
-</dd>
-<dd>
-<pre>
- URxvt.selection-pastebin-url: <a href="http://www.ta-sa.org/files/txt/%">http://www.ta-sa.org/files/txt/%</a></pre>
-</dd>
<p></p></dl>
<dt><strong><a name="item_popup">option-popup (enabled by default)</a></strong><br />
</dt>
window. Illustrates overwriting the refresh callbacks to create your own
overlays or changes.
</dd>
+<p></p>
+<dt><strong><a name="item_selection_2dpastebin">selection-pastebin</a></strong><br />
+</dt>
+<dd>
+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
+<em>/tmp</em> directly.).
+</dd>
+<dd>
+<p>It listens to the <code>selection-pastebin:remote-pastebin</code> keyboard command,
+i.e.</p>
+</dd>
+<dd>
+<pre>
+ URxvt.keysym.C-M-e: perl:selection-pastebin:remote-pastebin</pre>
+</dd>
+<dd>
+<p>Pressing this combination runs a command with <code>%</code> replaced by the name of
+the textfile. This command can be set via a resource:</p>
+</dd>
+<dd>
+<pre>
+ URxvt.selection-pastebin.cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/.</pre>
+</dd>
+<dd>
+<p>And the default is likely not useful to anybody but the few people around
+here :)</p>
+</dd>
+<dd>
+<p>The name of the textfile is the hex encoded md5 sum of the selection, so
+the same content should lead to the same filename.</p>
+</dd>
+<dd>
+<p>After a successful upload the selection will be replaced by the text given
+in the <code>selection-pastebin-url</code> resource (again, the % is the placeholder
+for the filename):</p>
+</dd>
+<dd>
+<pre>
+ URxvt.selection-pastebin.url: <a href="http://www.ta-sa.org/files/txt/%">http://www.ta-sa.org/files/txt/%</a></pre>
+</dd>
<p></p></dl>
<p>
</p>
.\" ========================================================================
.\"
.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"
.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
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"
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.
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
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;
// 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);
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 */
}