From 8991658f1581f1b557670f8f4d5e04b08df076d1 Mon Sep 17 00:00:00 2001
From: root
Date: Sat, 7 Jan 2006 04:19:43 +0000
Subject: [PATCH] *** empty log message ***
---
README.configure | 9 +-
doc/rxvt.1.html | 10 +-
doc/rxvt.1.man.in | 13 ++-
doc/rxvt.1.txt | 9 +-
doc/rxvt.7.html | 11 ++-
doc/rxvt.7.man.in | 19 ++--
doc/rxvt.7.pod | 11 ++-
doc/rxvt.7.txt | 9 +-
doc/rxvtperl.3.html | 215 ++++++++++++++++++++++++++++++++++--------
doc/rxvtperl.3.man.in | 199 ++++++++++++++++++++++++++++----------
doc/rxvtperl.3.txt | 153 ++++++++++++++++++++++++------
src/rxvtperl.xs | 13 +++
src/urxvt.pm | 6 +-
13 files changed, 521 insertions(+), 156 deletions(-)
diff --git a/README.configure b/README.configure
index 13e7f368..d80cb0cb 100644
--- a/README.configure
+++ b/README.configure
@@ -106,10 +106,10 @@ CONFIGURE OPTIONS
at start of rxvt execution. This option requires --enable-utmp to
also be specified.
- --enable-xpm-background (default: off)
+ --enable-xpm-background (default: on)
Add support for XPM background pixmaps.
- --enable-transparency (default: off)
+ --enable-transparency (default: on)
Add support for inheriting parent backgrounds thus giving a fake
transparency to the term.
@@ -121,9 +121,10 @@ CONFIGURE OPTIONS
Add support for tinting of transparent backgrounds (requires
"--enable-transparency").
- --enable-menubar (default: off)
+ --enable-menubar (default: off) [DEPRECATED]
Add support for our menu bar system (this interacts badly with
- dynamic locale switching currently).
+ dynamic locale switching currently). This option is DEPRECATED and
+ will be removed in the future.
--enable-rxvt-scroll (default: on)
Add support for the original rxvt scrollbar.
diff --git a/doc/rxvt.1.html b/doc/rxvt.1.html
index 91990388..6b5eafd6 100644
--- a/doc/rxvt.1.html
+++ b/doc/rxvt.1.html
@@ -602,7 +602,7 @@ used (a longer example is in doc/embed):
});
--pty-fd fileno
+-pty-fd file descriptor
Tells rxvt NOT to execute any commands or create a new pty/tty
@@ -616,6 +616,10 @@ entries and will not tinker with pty/tty permissions - you have to do that
yourself if you want that.
+As an extremely special case, specifying -1
will completely suppress
+pty/tty operations.
+
+
Here is a example in perl that illustrates how this option can be used (a
longer example is in doc/pty-fd):
@@ -641,7 +645,7 @@ longer example is in doc/pty-fd):
-pe string
-Colon-separated list of perl extension scripts to use in this terminal
+Comma-separated list of perl extension scripts to use in this terminal
instance. See resource perl-ext.
@@ -1451,7 +1455,7 @@ info):
perl-ext: string
-Colon-separated list(s)
of perl extension scripts to use in this terminal
+Comma-separated list(s)
of perl extension scripts to use in this terminal
instance. Each extension is looked up in the library directories, loaded
if necessary, and bound to the current terminal instance. If this
resource is empty or missing, then the perl interpreter will not be
diff --git a/doc/rxvt.1.man.in b/doc/rxvt.1.man.in
index 5ddf4b11..7de2bce3 100644
--- a/doc/rxvt.1.man.in
+++ b/doc/rxvt.1.man.in
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "rxvt 1"
-.TH rxvt 1 "2006-01-04" "6.3" "RXVT-UNICODE"
+.TH rxvt 1 "2006-01-07" "6.3" "RXVT-UNICODE"
.SH "NAME"
rxvt\-unicode (ouR XVT, unicode) \- (a VT102 emulator for the X window system)
.SH "SYNOPSIS"
@@ -510,8 +510,8 @@ used (a longer example is in \fIdoc/embed\fR):
\& system "@@RXVT_NAME@@ -embed $xid &";
\& });
.Ve
-.IP "\fB\-pty\-fd\fR \fIfileno\fR" 4
-.IX Item "-pty-fd fileno"
+.IP "\fB\-pty\-fd\fR \fIfile descriptor\fR" 4
+.IX Item "-pty-fd file descriptor"
Tells @@RXVT_NAME@@ \s-1NOT\s0 to execute any commands or create a new pty/tty
pair but instead use the given filehandle as the tty master. This is
useful if you want to drive @@RXVT_NAME@@ as a generic terminal emulator
@@ -521,6 +521,9 @@ If this switch is given, @@RXVT_NAME@@ will not create any utmp/wtmp
entries and will not tinker with pty/tty permissions \- you have to do that
yourself if you want that.
.Sp
+As an extremely special case, specifying \f(CW\*(C`\-1\*(C'\fR will completely suppress
+pty/tty operations.
+.Sp
Here is a example in perl that illustrates how this option can be used (a
longer example is in \fIdoc/pty\-fd\fR):
.Sp
@@ -543,7 +546,7 @@ longer example is in \fIdoc/pty\-fd\fR):
.Ve
.IP "\fB\-pe\fR \fIstring\fR" 4
.IX Item "-pe string"
-Colon-separated list of perl extension scripts to use in this terminal
+Comma-separated list of perl extension scripts to use in this terminal
instance. See resource \fBperl-ext\fR.
.SH "RESOURCES (available also as long\-options)"
.IX Header "RESOURCES (available also as long-options)"
@@ -1109,7 +1112,7 @@ info):
.IP "\fBperl-ext\fR: \fIstring\fR" 4
.IX Item "perl-ext: string"
.PD
-Colon-separated list(s) of perl extension scripts to use in this terminal
+Comma-separated list(s) of perl extension scripts to use in this terminal
instance. Each extension is looked up in the library directories, loaded
if necessary, and bound to the current terminal instance. If this
resource is empty or missing, then the perl interpreter will not be
diff --git a/doc/rxvt.1.txt b/doc/rxvt.1.txt
index 3ad294b0..a57b0407 100644
--- a/doc/rxvt.1.txt
+++ b/doc/rxvt.1.txt
@@ -373,7 +373,7 @@ OPTIONS
system "rxvt -embed $xid &";
});
- -pty-fd *fileno*
+ -pty-fd *file descriptor*
Tells rxvt NOT to execute any commands or create a new pty/tty pair
but instead use the given filehandle as the tty master. This is
useful if you want to drive rxvt as a generic terminal emulator
@@ -383,6 +383,9 @@ OPTIONS
and will not tinker with pty/tty permissions - you have to do that
yourself if you want that.
+ As an extremely special case, specifying -1 will completely suppress
+ pty/tty operations.
+
Here is a example in perl that illustrates how this option can be
used (a longer example is in doc/pty-fd):
@@ -399,7 +402,7 @@ OPTIONS
while (<$slave>) { print $slave "got <$_>\n" }
-pe *string*
- Colon-separated list of perl extension scripts to use in this
+ Comma-separated list of perl extension scripts to use in this
terminal instance. See resource perl-ext.
RESOURCES (available also as long-options)
@@ -940,7 +943,7 @@ RESOURCES (available also as long-options)
perl-ext-common: *string*
perl-ext: *string*
- Colon-separated list(s) of perl extension scripts to use in this
+ Comma-separated list(s) of perl extension scripts to use in this
terminal instance. Each extension is looked up in the library
directories, loaded if necessary, and bound to the current terminal
instance. If this resource is empty or missing, then the perl
diff --git a/doc/rxvt.7.html b/doc/rxvt.7.html
index e129922d..ba44483f 100644
--- a/doc/rxvt.7.html
+++ b/doc/rxvt.7.html
@@ -2799,13 +2799,13 @@ Write user and tty to lastlog file (used by programs like
--enable-utmp to also be specified.
---enable-xpm-background (default: off)
+--enable-xpm-background (default: on)
Add support for XPM background pixmaps.
---enable-transparency (default: off)
+--enable-transparency (default: on)
Add support for inheriting parent backgrounds thus giving a fake
@@ -2824,11 +2824,12 @@ Add support for fading the text when focus is lost (requires --enable-tran
Add support for tinting of transparent backgrounds (requires --enable-transparency
).
---enable-menubar (default: off)
+--enable-menubar (default: off) [DEPRECATED]
-Add support for our menu bar system (this interacts badly with
-dynamic locale switching currently).
+Add support for our menu bar system (this interacts badly with dynamic
+locale switching currently). This option is DEPRECATED and will be removed
+in the future.
--enable-rxvt-scroll (default: on)
diff --git a/doc/rxvt.7.man.in b/doc/rxvt.7.man.in
index abb0be43..50668592 100644
--- a/doc/rxvt.7.man.in
+++ b/doc/rxvt.7.man.in
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "rxvt 7"
-.TH rxvt 7 "2006-01-04" "6.3" "RXVT-UNICODE"
+.TH rxvt 7 "2006-01-07" "6.3" "RXVT-UNICODE"
.SH "NAME"
RXVT REFERENCE \- FAQ, command sequences and other background information
.SH "SYNOPSIS"
@@ -2402,11 +2402,11 @@ option requires \-\-enable\-utmp to also be specified.
Write user and tty to lastlog file (used by programs like
\&\fIlastlogin\fR) at start of rxvt execution. This option requires
\&\-\-enable\-utmp to also be specified.
-.IP "\-\-enable\-xpm\-background (default: off)" 4
-.IX Item "--enable-xpm-background (default: off)"
+.IP "\-\-enable\-xpm\-background (default: on)" 4
+.IX Item "--enable-xpm-background (default: on)"
Add support for \s-1XPM\s0 background pixmaps.
-.IP "\-\-enable\-transparency (default: off)" 4
-.IX Item "--enable-transparency (default: off)"
+.IP "\-\-enable\-transparency (default: on)" 4
+.IX Item "--enable-transparency (default: on)"
Add support for inheriting parent backgrounds thus giving a fake
transparency to the term.
.IP "\-\-enable\-fading (default: on)" 4
@@ -2415,10 +2415,11 @@ Add support for fading the text when focus is lost (requires \f(CW\*(C`\-\-enabl
.IP "\-\-enable\-tinting (default: on)" 4
.IX Item "--enable-tinting (default: on)"
Add support for tinting of transparent backgrounds (requires \f(CW\*(C`\-\-enable\-transparency\*(C'\fR).
-.IP "\-\-enable\-menubar (default: off)" 4
-.IX Item "--enable-menubar (default: off)"
-Add support for our menu bar system (this interacts badly with
-dynamic locale switching currently).
+.IP "\-\-enable\-menubar (default: off) [\s-1DEPRECATED\s0]" 4
+.IX Item "--enable-menubar (default: off) [DEPRECATED]"
+Add support for our menu bar system (this interacts badly with dynamic
+locale switching currently). This option is \s-1DEPRECATED\s0 and will be removed
+in the future.
.IP "\-\-enable\-rxvt\-scroll (default: on)" 4
.IX Item "--enable-rxvt-scroll (default: on)"
Add support for the original rxvt scrollbar.
diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod
index 204778c4..3dfeb4fc 100644
--- a/doc/rxvt.7.pod
+++ b/doc/rxvt.7.pod
@@ -2408,11 +2408,11 @@ Write user and tty to lastlog file (used by programs like
F) at start of rxvt execution. This option requires
--enable-utmp to also be specified.
-=item --enable-xpm-background (default: off)
+=item --enable-xpm-background (default: on)
Add support for XPM background pixmaps.
-=item --enable-transparency (default: off)
+=item --enable-transparency (default: on)
Add support for inheriting parent backgrounds thus giving a fake
transparency to the term.
@@ -2425,10 +2425,11 @@ Add support for fading the text when focus is lost (requires C<--enable-transpar
Add support for tinting of transparent backgrounds (requires C<--enable-transparency>).
-=item --enable-menubar (default: off)
+=item --enable-menubar (default: off) [DEPRECATED]
-Add support for our menu bar system (this interacts badly with
-dynamic locale switching currently).
+Add support for our menu bar system (this interacts badly with dynamic
+locale switching currently). This option is DEPRECATED and will be removed
+in the future.
=item --enable-rxvt-scroll (default: on)
diff --git a/doc/rxvt.7.txt b/doc/rxvt.7.txt
index 0a0f8461..e43b3368 100644
--- a/doc/rxvt.7.txt
+++ b/doc/rxvt.7.txt
@@ -1867,10 +1867,10 @@ CONFIGURE OPTIONS
at start of rxvt execution. This option requires --enable-utmp to
also be specified.
- --enable-xpm-background (default: off)
+ --enable-xpm-background (default: on)
Add support for XPM background pixmaps.
- --enable-transparency (default: off)
+ --enable-transparency (default: on)
Add support for inheriting parent backgrounds thus giving a fake
transparency to the term.
@@ -1882,9 +1882,10 @@ CONFIGURE OPTIONS
Add support for tinting of transparent backgrounds (requires
"--enable-transparency").
- --enable-menubar (default: off)
+ --enable-menubar (default: off) [DEPRECATED]
Add support for our menu bar system (this interacts badly with
- dynamic locale switching currently).
+ dynamic locale switching currently). This option is DEPRECATED and
+ will be removed in the future.
--enable-rxvt-scroll (default: on)
Add support for the original rxvt scrollbar.
diff --git a/doc/rxvtperl.3.html b/doc/rxvtperl.3.html
index 63a29d3c..19cb30e0 100644
--- a/doc/rxvtperl.3.html
+++ b/doc/rxvtperl.3.html
@@ -106,6 +106,20 @@ Rot-13 the selection when activated. Used via keyboard trigger:
Displays a digital clock using the built-in overlay.
+mark-urls
+
+
+Uses per-line display filtering (on_line_update
) to underline urls.
+
+
+block-graphics-to-ascii
+
+
+A not very useful example of filtering all text output to the terminal,
+by replacing all line-drawing characters (U+2500 .. U+259F) by a
+similar-looking ascii character.
+
+
example-refresh-hooks
@@ -126,10 +140,35 @@ modified).
emptied, so its best to store related objects such as time watchers and
the like inside the terminal object so they get destroyed as soon as the
terminal is destroyed.
+Argument names also often indicate the type of a parameter. Here are some
+hints on what they mean:
+
+- $text
+
+-
+Rxvt-unicodes special way of encoding text, where one ``unicode'' character
+always represents one screen cell. See row_t for a discussion of this format.
+
+
+- $string
+
+-
+A perl text string, with an emphasis on text. It can store all unicode
+characters and is to be distinguished with text encoded in a specific
+encoding (often locale-specific) and binary data.
+
+
+- $octets
+
+-
+Either binary data or - more common - a text string encoded in a
+locale-specific way.
+
+
-The following subroutines can be declared in loaded scripts, and will be
+
The following subroutines can be declared in extension files, and will be
called whenever the relevant event happens.
The first argument passed to them is an object private to each terminal
and extension package. You can call all urxvt::term
methods on it, but
@@ -145,7 +184,10 @@ and the relevant action might not be carried out by the C++ code.
Called after a new terminal object has been initialized, but before
-windows are created or the command gets run.
+windows are created or the command gets run. Most methods are unsafe to
+call or deliver senseless data, as terminal size and other characteristics
+have not yet been determined. You can safely query and change resources,
+though.
on_reset $term
@@ -255,6 +297,34 @@ as its source can not easily be controleld (e-mail content, messages from
other users on the same system etc.).
+on_add_lines $term, $string
+
+
+Called whenever text is about to be output, with the text as argument. You
+can filter/change and output the text yourself by returning a true value
+and calling $term->scr_add_lines
yourself. Please note that this
+might be very slow, however, as your hook is called for all text being
+output.
+
+
+on_line_update $term, $row
+
+
+Called whenever a line was updated or changed. Can be used to filter
+screen output (e.g. underline urls or other useless stuff). Only lines
+that are being shown will be filtered, and, due to performance reasons,
+not always immediately.
+
+
+The row number is always the topmost row of the line if the line spans
+multiple rows.
+
+
+Please note that, if you change the line, then the hook might get called
+later with the already-modified line (e.g. if unrelated parts change), so
+you cannot just toggle rendition bits, but only set them.
+
+
on_refresh_begin $term
@@ -277,6 +347,33 @@ Called whenever the user presses a key combination that has a
perl:string
action bound to it (see description of the keysym
resource in the rxvt(1)
manpage).
+
+on_key_press $term, $event, $octets
+
+on_key_release $term, $event
+
+on_button_press $term, $event
+
+on_button_release $term, $event
+
+on_motion_notify $term, $event
+
+
+Called whenever the corresponding X event is received for the terminal If
+the hook returns true, then the even will be ignored by rxvt-unicode.
+
+
+The event is a hash with most values as named by Xlib (see the XEvent
+manpage), with the additional members row
and col
, which are the row
+and column under the mouse cursor.
+
+
+on_key_press
additionally receives the string rxvt-unicode would
+output, if any, in locale-specific encoding.
+
+
+subwindow.
+
@@ -285,14 +382,24 @@ resource in the rxvt(1)
manpage).
$urxvt::TERM
-The current terminal. Whenever a callback/Hook is bein executed, this
-variable stores the current urxvt::term
object.
+The current terminal. This variable stores the current urxvt::term
+object, whenever a callback/hook is executing.
+- $term = new urxvt [arg...]
+
+-
+Creates a new terminal, very similar as if you had started it with
+
system $binfile, arg...
. Croaks (and probably outputs an error message)
+if the new instance couldn't be created. Returns undef
if the new
+instance didn't initialise perl, and the terminal object otherwise. The
+init
and start
hooks will be called during the call.
+
+
- urxvt::fatal $errormessage
-
@@ -385,6 +492,12 @@ Change the custom value.
+- $term->destroy
+
+-
+Destroy the terminal object (close the window, free resources etc.).
+
+
- $value = $term->resource ($name[, $newval])
-
@@ -427,11 +540,11 @@ list:
utmpInhibit visualBell
-- $rend = $term->screen_rstyle ([$new_rstyle])
+- $rend = $term->rstyle ([$new_rstyle])
-
-Return and optionally change the current rendition. Text thta is output by
-the temrianl application will use this style.
+Return and optionally change the current rendition. Text that is output by
+the terminal application will use this style.
- ($row, $col) = $term->screen_cur ([$row, $col])
@@ -469,29 +582,21 @@ Return the current selection text and optionally replace it by $newtext
-
--
-
sub urxvt::term::scr_overlay {
-die;
- my ($self, $x, $y, $text) = @_;
-
--
-
- my @lines = split /\n/, $text;
-
--
-
- my $w = 0;
- for (map $self->strwidth ($_), @lines) {
- $w = $_ if $w < $_;
- }
-
--
-
- $self->scr_overlay_new ($x, $y, $w, scalar @lines);
- $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines;
-}
+#=cut
+#
+#sub urxvt::term::scr_overlay {
+# my ($self, $x, $y, $text) = @_;
+#
+# my @lines = split /\n/, $text;
+#
+# my $w = 0;
+# for (map $self->strwidth ($_), @lines) {
+# $w = $_ if $w < $_;
+# }
+#
+# $self->scr_overlay_new ($x, $y, $w, scalar @lines);
+# $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines;
+#}
- $term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])
@@ -537,25 +642,47 @@ If visible, hide the overlay, but do not destroy it.
If hidden, display the overlay again.
-$cellwidth = $term->strwidth $string
+$cellwidth = $term->strwidth ($string)
Returns the number of screen-cells this string would need. Correctly
accounts for wide and combining characters.
-$octets = $term->locale_encode $string
+$octets = $term->locale_encode ($string)
Convert the given text string into the corresponding locale encoding.
-$string = $term->locale_decode $octets
+$string = $term->locale_decode ($octets)
Convert the given locale-encoded octets into a perl string.
+$term->scr_add_lines ($string)
+
+
+Write the given text string to the screen, as if output by the application
+running inside the terminal. It may not contain command sequences (escape
+codes), but is free to use line feeds, carriage returns and tabs. The
+string is a normal text string, not in locale-dependent encoding.
+
+
+Normally its not a good idea to use this function, as programs might be
+confused by changes in cursor position or scrolling. Its useful inside a
+on_add_lines
hook, though.
+
+
+$term->cmd_parse ($octets)
+
+
+Similar to scr_add_lines
, but the argument must be in the
+locale-specific encoding of the terminal and can contain command sequences
+(escape codes) that will be interpreted.
+
+
$term->tt_write ($octets)
@@ -564,6 +691,18 @@ pass characters instead of octets, you should convert your strings first
to the locale-specific encoding using $term->locale_encode
.
+$windowid = $term->parent
+
+
+Return the window id of the toplevel window.
+
+
+$windowid = $term->vt
+
+
+Return the window id of the terminal window.
+
+
$window_width = $term->width
$window_height = $term->height
@@ -627,7 +766,7 @@ to replace only parts of a line. The font index in the rendition will
automatically be updated.
-$text
is in a special encoding: tabs and wide characters that use more
+
$text
is in a special encoding: tabs and wide characters that use more
than one cell when displayed are padded with urxvt::NOCHAR characters
(chr 65535
). Characters with combining characters and other characters
that do not fit into the normal tetx encoding will be replaced with
@@ -682,16 +821,16 @@ about the logical line that row $row_number
is part of. It supports
following methods:
-- $text = $line->t
+- $text = $line->t ([$new_text])
-
-Returns the full text of the line, similar to
ROW_t
+Returns or replaces the full text of the line, similar to ROW_t
-- $rend = $line->r
+- $rend = $line->r ([$new_rend])
-
-Returns the full rendition array of the line, similar to
ROW_r
+Returns or replaces the full rendition array of the line, similar to ROW_r
- $length = $line->l
diff --git a/doc/rxvtperl.3.man.in b/doc/rxvtperl.3.man.in
index 4b27e9cd..68dfea11 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-04" "6.3" "RXVT-UNICODE"
+.TH rxvt 3 "2006-01-07" "6.3" "RXVT-UNICODE"
.SH "NAME"
@@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter
.SH "SYNOPSIS"
@@ -194,6 +194,14 @@ Rot\-13 the selection when activated. Used via keyboard trigger:
.IP "digital-clock" 4
.IX Item "digital-clock"
Displays a digital clock using the built-in overlay.
+.IP "mark-urls" 4
+.IX Item "mark-urls"
+Uses per-line display filtering (\f(CW\*(C`on_line_update\*(C'\fR) to underline urls.
+.IP "block-graphics-to-ascii" 4
+.IX Item "block-graphics-to-ascii"
+A not very useful example of filtering all text output to the terminal,
+by replacing all line-drawing characters (U+2500 .. U+259F) by a
+similar-looking ascii character.
.IP "example-refresh-hooks" 4
.IX Item "example-refresh-hooks"
Displays a very simple digital clock in the upper right corner of the
@@ -211,9 +219,25 @@ When objects are destroyed on the \*(C+ side, the perl object hashes are
emptied, so its best to store related objects such as time watchers and
the like inside the terminal object so they get destroyed as soon as the
terminal is destroyed.
+.PP
+Argument names also often indicate the type of a parameter. Here are some
+hints on what they mean:
+.IP "$text" 4
+.IX Item "$text"
+Rxvt-unicodes special way of encoding text, where one \*(L"unicode\*(R" character
+always represents one screen cell. See row_t for a discussion of this format.
+.IP "$string" 4
+.IX Item "$string"
+A perl text string, with an emphasis on \fItext\fR. It can store all unicode
+characters and is to be distinguished with text encoded in a specific
+encoding (often locale\-specific) and binary data.
+.IP "$octets" 4
+.IX Item "$octets"
+Either binary data or \- more common \- a text string encoded in a
+locale-specific way.
.Sh "Hooks"
.IX Subsection "Hooks"
-The following subroutines can be declared in loaded scripts, and will be
+The following subroutines can be declared in extension files, and will be
called whenever the relevant event happens.
.PP
The first argument passed to them is an object private to each terminal
@@ -231,7 +255,10 @@ When in doubt, return a false value (preferably \f(CW\*(C`()\*(C'\fR).
.el .IP "on_init \f(CW$term\fR" 4
.IX Item "on_init $term"
Called after a new terminal object has been initialized, but before
-windows are created or the command gets run.
+windows are created or the command gets run. Most methods are unsafe to
+call or deliver senseless data, as terminal size and other characteristics
+have not yet been determined. You can safely query and change resources,
+though.
.ie n .IP "on_reset $term" 4
.el .IP "on_reset \f(CW$term\fR" 4
.IX Item "on_reset $term"
@@ -312,6 +339,28 @@ future.
Be careful not ever to trust (in a security sense) the data you receive,
as its source can not easily be controleld (e\-mail content, messages from
other users on the same system etc.).
+.ie n .IP "on_add_lines $term\fR, \f(CW$string" 4
+.el .IP "on_add_lines \f(CW$term\fR, \f(CW$string\fR" 4
+.IX Item "on_add_lines $term, $string"
+Called whenever text is about to be output, with the text as argument. You
+can filter/change and output the text yourself by returning a true value
+and calling \f(CW\*(C`$term\->scr_add_lines\*(C'\fR yourself. Please note that this
+might be very slow, however, as your hook is called for \fBall\fR text being
+output.
+.ie n .IP "on_line_update $term\fR, \f(CW$row" 4
+.el .IP "on_line_update \f(CW$term\fR, \f(CW$row\fR" 4
+.IX Item "on_line_update $term, $row"
+Called whenever a line was updated or changed. Can be used to filter
+screen output (e.g. underline urls or other useless stuff). Only lines
+that are being shown will be filtered, and, due to performance reasons,
+not always immediately.
+.Sp
+The row number is always the topmost row of the line if the line spans
+multiple rows.
+.Sp
+Please note that, if you change the line, then the hook might get called
+later with the already-modified line (e.g. if unrelated parts change), so
+you cannot just toggle rendition bits, but only set them.
.ie n .IP "on_refresh_begin $term" 4
.el .IP "on_refresh_begin \f(CW$term\fR" 4
.IX Item "on_refresh_begin $term"
@@ -329,16 +378,51 @@ Called just after the screen gets redrawn. See \f(CW\*(C`on_refresh_begin\*(C'\f
Called whenever the user presses a key combination that has a
\&\f(CW\*(C`perl:string\*(C'\fR action bound to it (see description of the \fBkeysym\fR
resource in the @@RXVT_NAME@@(1) manpage).
+.ie n .IP "on_key_press $term\fR, \f(CW$event\fR, \f(CW$octets" 4
+.el .IP "on_key_press \f(CW$term\fR, \f(CW$event\fR, \f(CW$octets\fR" 4
+.IX Item "on_key_press $term, $event, $octets"
+.PD 0
+.ie n .IP "on_key_release $term\fR, \f(CW$event" 4
+.el .IP "on_key_release \f(CW$term\fR, \f(CW$event\fR" 4
+.IX Item "on_key_release $term, $event"
+.ie n .IP "on_button_press $term\fR, \f(CW$event" 4
+.el .IP "on_button_press \f(CW$term\fR, \f(CW$event\fR" 4
+.IX Item "on_button_press $term, $event"
+.ie n .IP "on_button_release $term\fR, \f(CW$event" 4
+.el .IP "on_button_release \f(CW$term\fR, \f(CW$event\fR" 4
+.IX Item "on_button_release $term, $event"
+.ie n .IP "on_motion_notify $term\fR, \f(CW$event" 4
+.el .IP "on_motion_notify \f(CW$term\fR, \f(CW$event\fR" 4
+.IX Item "on_motion_notify $term, $event"
+.PD
+Called whenever the corresponding X event is received for the terminal If
+the hook returns true, then the even will be ignored by rxvt\-unicode.
+.Sp
+The event is a hash with most values as named by Xlib (see the XEvent
+manpage), with the additional members \f(CW\*(C`row\*(C'\fR and \f(CW\*(C`col\*(C'\fR, which are the row
+and column under the mouse cursor.
+.Sp
+\&\f(CW\*(C`on_key_press\*(C'\fR additionally receives the string rxvt-unicode would
+output, if any, in locale-specific encoding.
+.Sp
+subwindow.
.ie n .Sh "Variables in the ""urxvt"" Package"
.el .Sh "Variables in the \f(CWurxvt\fP Package"
.IX Subsection "Variables in the urxvt Package"
.IP "$urxvt::TERM" 4
.IX Item "$urxvt::TERM"
-The current terminal. Whenever a callback/Hook is bein executed, this
-variable stores the current \f(CW\*(C`urxvt::term\*(C'\fR object.
+The current terminal. This variable stores the current \f(CW\*(C`urxvt::term\*(C'\fR
+object, whenever a callback/hook is executing.
.ie n .Sh "Functions in the ""urxvt"" Package"
.el .Sh "Functions in the \f(CWurxvt\fP Package"
.IX Subsection "Functions in the urxvt Package"
+.IP "$term = new urxvt [arg...]" 4
+.IX Item "$term = new urxvt [arg...]"
+Creates a new terminal, very similar as if you had started it with
+\&\f(CW\*(C`system $binfile, arg...\*(C'\fR. Croaks (and probably outputs an error message)
+if the new instance couldn't be created. Returns \f(CW\*(C`undef\*(C'\fR if the new
+instance didn't initialise perl, and the terminal object otherwise. The
+\&\f(CW\*(C`init\*(C'\fR and \f(CW\*(C`start\*(C'\fR hooks will be called during the call.
.ie n .IP "urxvt::fatal $errormessage" 4
.el .IP "urxvt::fatal \f(CW$errormessage\fR" 4
.IX Item "urxvt::fatal $errormessage"
@@ -409,6 +493,9 @@ Change the custom value.
.ie n .Sh "The ""urxvt::term"" Class"
.el .Sh "The \f(CWurxvt::term\fP Class"
.IX Subsection "The urxvt::term Class"
+.IP "$term\->destroy" 4
+.IX Item "$term->destroy"
+Destroy the terminal object (close the window, free resources etc.).
.ie n .IP "$value = $term\fR\->resource ($name[, \f(CW$newval])" 4
.el .IP "$value = \f(CW$term\fR\->resource ($name[, \f(CW$newval\fR])" 4
.IX Item "$value = $term->resource ($name[, $newval])"
@@ -445,11 +532,11 @@ list:
\& shade term_name title transparent transparent_all tripleclickwords
\& utmpInhibit visualBell
.Ve
-.ie n .IP "$rend = $term\->screen_rstyle ([$new_rstyle])" 4
-.el .IP "$rend = \f(CW$term\fR\->screen_rstyle ([$new_rstyle])" 4
-.IX Item "$rend = $term->screen_rstyle ([$new_rstyle])"
-Return and optionally change the current rendition. Text thta is output by
-the temrianl application will use this style.
+.ie n .IP "$rend = $term\->rstyle ([$new_rstyle])" 4
+.el .IP "$rend = \f(CW$term\fR\->rstyle ([$new_rstyle])" 4
+.IX Item "$rend = $term->rstyle ([$new_rstyle])"
+Return and optionally change the current rendition. Text that is output by
+the terminal application will use this style.
.ie n .IP "($row, $col\fR) = \f(CW$term\fR\->screen_cur ([$row, \f(CW$col])" 4
.el .IP "($row, \f(CW$col\fR) = \f(CW$term\fR\->screen_cur ([$row, \f(CW$col\fR])" 4
.IX Item "($row, $col) = $term->screen_cur ([$row, $col])"
@@ -483,27 +570,20 @@ Return the current selection text and optionally replace it by \f(CW$newtext\fR.
#Create a simple multi-line overlay box. See the next method for details.
#
#=cut
-.Sp
-sub urxvt::term::scr_overlay {
-die;
- my ($self, \f(CW$x\fR, \f(CW$y\fR, \f(CW$text\fR) = \f(CW@_\fR;
-.Sp
-.Vb 1
-\& my @lines = split /\en/, $text;
-.Ve
-.Sp
-.Vb 4
-\& my $w = 0;
-\& for (map $self->strwidth ($_), @lines) {
-\& $w = $_ if $w < $_;
-\& }
-.Ve
-.Sp
-.Vb 3
-\& $self->scr_overlay_new ($x, $y, $w, scalar @lines);
-\& $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines;
-\&}
-.Ve
+#
+#sub urxvt::term::scr_overlay {
+# my ($self, \f(CW$x\fR, \f(CW$y\fR, \f(CW$text\fR) = \f(CW@_\fR;
+#
+# my \f(CW@lines\fR = split /\en/, \f(CW$text\fR;
+#
+# my \f(CW$w\fR = 0;
+# for (map \f(CW$self\fR\->strwidth ($_), \f(CW@lines\fR) {
+# \f(CW$w\fR = \f(CW$_\fR if \f(CW$w\fR < \f(CW$_\fR;
+# }
+#
+# \f(CW$self\fR\->scr_overlay_new ($x, \f(CW$y\fR, \f(CW$w\fR, scalar \f(CW@lines\fR);
+# \f(CW$self\fR\->scr_overlay_set (0, \f(CW$_\fR, \f(CW$lines\fR[$_]) for 0.. $#lines;
+#}
.ie n .IP "$term\->overlay ($x, $y\fR, \f(CW$width\fR, \f(CW$height\fR[, \f(CW$rstyle\fR[, \f(CW$border]])" 4
.el .IP "$term\->overlay ($x, \f(CW$y\fR, \f(CW$width\fR, \f(CW$height\fR[, \f(CW$rstyle\fR[, \f(CW$border\fR]])" 4
.IX Item "$term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])"
@@ -537,24 +617,47 @@ If hidden, display the overlay again.
.RE
.RS 4
.RE
-.ie n .IP "$cellwidth = $term\fR\->strwidth \f(CW$string" 4
-.el .IP "$cellwidth = \f(CW$term\fR\->strwidth \f(CW$string\fR" 4
-.IX Item "$cellwidth = $term->strwidth $string"
+.ie n .IP "$cellwidth = $term\->strwidth ($string)" 4
+.el .IP "$cellwidth = \f(CW$term\fR\->strwidth ($string)" 4
+.IX Item "$cellwidth = $term->strwidth ($string)"
Returns the number of screen-cells this string would need. Correctly
accounts for wide and combining characters.
-.ie n .IP "$octets = $term\fR\->locale_encode \f(CW$string" 4
-.el .IP "$octets = \f(CW$term\fR\->locale_encode \f(CW$string\fR" 4
-.IX Item "$octets = $term->locale_encode $string"
+.ie n .IP "$octets = $term\->locale_encode ($string)" 4
+.el .IP "$octets = \f(CW$term\fR\->locale_encode ($string)" 4
+.IX Item "$octets = $term->locale_encode ($string)"
Convert the given text string into the corresponding locale encoding.
-.ie n .IP "$string = $term\fR\->locale_decode \f(CW$octets" 4
-.el .IP "$string = \f(CW$term\fR\->locale_decode \f(CW$octets\fR" 4
-.IX Item "$string = $term->locale_decode $octets"
+.ie n .IP "$string = $term\->locale_decode ($octets)" 4
+.el .IP "$string = \f(CW$term\fR\->locale_decode ($octets)" 4
+.IX Item "$string = $term->locale_decode ($octets)"
Convert the given locale-encoded octets into a perl string.
+.IP "$term\->scr_add_lines ($string)" 4
+.IX Item "$term->scr_add_lines ($string)"
+Write the given text string to the screen, as if output by the application
+running inside the terminal. It may not contain command sequences (escape
+codes), but is free to use line feeds, carriage returns and tabs. The
+string is a normal text string, not in locale-dependent encoding.
+.Sp
+Normally its not a good idea to use this function, as programs might be
+confused by changes in cursor position or scrolling. Its useful inside a
+\&\f(CW\*(C`on_add_lines\*(C'\fR hook, though.
+.IP "$term\->cmd_parse ($octets)" 4
+.IX Item "$term->cmd_parse ($octets)"
+Similar to \f(CW\*(C`scr_add_lines\*(C'\fR, but the argument must be in the
+locale-specific encoding of the terminal and can contain command sequences
+(escape codes) that will be interpreted.
.IP "$term\->tt_write ($octets)" 4
.IX Item "$term->tt_write ($octets)"
Write the octets given in \f(CW$data\fR to the tty (i.e. as program input). To
pass characters instead of octets, you should convert your strings first
to the locale-specific encoding using \f(CW\*(C`$term\->locale_encode\*(C'\fR.
+.ie n .IP "$windowid = $term\->parent" 4
+.el .IP "$windowid = \f(CW$term\fR\->parent" 4
+.IX Item "$windowid = $term->parent"
+Return the window id of the toplevel window.
+.ie n .IP "$windowid = $term\->vt" 4
+.el .IP "$windowid = \f(CW$term\fR\->vt" 4
+.IX Item "$windowid = $term->vt"
+Return the window id of the terminal window.
.ie n .IP "$window_width = $term\->width" 4
.el .IP "$window_width = \f(CW$term\fR\->width" 4
.IX Item "$window_width = $term->width"
@@ -663,14 +766,14 @@ Create and return a new \f(CW\*(C`urxvt::line\*(C'\fR object that stores informa
about the logical line that row \f(CW$row_number\fR is part of. It supports the
following methods:
.RS 4
-.ie n .IP "$text = $line\->t" 4
-.el .IP "$text = \f(CW$line\fR\->t" 4
-.IX Item "$text = $line->t"
-Returns the full text of the line, similar to \f(CW\*(C`ROW_t\*(C'\fR
-.ie n .IP "$rend = $line\->r" 4
-.el .IP "$rend = \f(CW$line\fR\->r" 4
-.IX Item "$rend = $line->r"
-Returns the full rendition array of the line, similar to \f(CW\*(C`ROW_r\*(C'\fR
+.ie n .IP "$text = $line\->t ([$new_text])" 4
+.el .IP "$text = \f(CW$line\fR\->t ([$new_text])" 4
+.IX Item "$text = $line->t ([$new_text])"
+Returns or replaces the full text of the line, similar to \f(CW\*(C`ROW_t\*(C'\fR
+.ie n .IP "$rend = $line\->r ([$new_rend])" 4
+.el .IP "$rend = \f(CW$line\fR\->r ([$new_rend])" 4
+.IX Item "$rend = $line->r ([$new_rend])"
+Returns or replaces the full rendition array of the line, similar to \f(CW\*(C`ROW_r\*(C'\fR
.ie n .IP "$length = $line\->l" 4
.el .IP "$length = \f(CW$line\fR\->l" 4
.IX Item "$length = $line->l"
diff --git a/doc/rxvtperl.3.txt b/doc/rxvtperl.3.txt
index a228b5bd..5e5c1372 100644
--- a/doc/rxvtperl.3.txt
+++ b/doc/rxvtperl.3.txt
@@ -47,6 +47,15 @@ DESCRIPTION
digital-clock
Displays a digital clock using the built-in overlay.
+ mark-urls
+ Uses per-line display filtering ("on_line_update") to underline
+ urls.
+
+ block-graphics-to-ascii
+ A not very useful example of filtering all text output to the
+ terminal, by replacing all line-drawing characters (U+2500 ..
+ U+259F) by a similar-looking ascii character.
+
example-refresh-hooks
Displays a very simple digital clock in the upper right corner of
the window. Illustrates overwriting the refresh callbacks to create
@@ -64,9 +73,26 @@ DESCRIPTION
the like inside the terminal object so they get destroyed as soon as the
terminal is destroyed.
+ Argument names also often indicate the type of a parameter. Here are
+ some hints on what they mean:
+
+ $text
+ Rxvt-unicodes special way of encoding text, where one "unicode"
+ character always represents one screen cell. See row_t for a
+ discussion of this format.
+
+ $string
+ A perl text string, with an emphasis on *text*. It can store all
+ unicode characters and is to be distinguished with text encoded in a
+ specific encoding (often locale-specific) and binary data.
+
+ $octets
+ Either binary data or - more common - a text string encoded in a
+ locale-specific way.
+
Hooks
- The following subroutines can be declared in loaded scripts, and will be
- called whenever the relevant event happens.
+ The following subroutines can be declared in extension files, and will
+ be called whenever the relevant event happens.
The first argument passed to them is an object private to each terminal
and extension package. You can call all "urxvt::term" methods on it, but
@@ -83,7 +109,10 @@ DESCRIPTION
on_init $term
Called after a new terminal object has been initialized, but before
- windows are created or the command gets run.
+ windows are created or the command gets run. Most methods are unsafe
+ to call or deliver senseless data, as terminal size and other
+ characteristics have not yet been determined. You can safely query
+ and change resources, though.
on_reset $term
Called after the screen is "reset" for any reason, such as resizing
@@ -157,6 +186,27 @@ DESCRIPTION
receive, as its source can not easily be controleld (e-mail content,
messages from other users on the same system etc.).
+ on_add_lines $term, $string
+ Called whenever text is about to be output, with the text as
+ argument. You can filter/change and output the text yourself by
+ returning a true value and calling "$term->scr_add_lines" yourself.
+ Please note that this might be very slow, however, as your hook is
+ called for all text being output.
+
+ on_line_update $term, $row
+ Called whenever a line was updated or changed. Can be used to filter
+ screen output (e.g. underline urls or other useless stuff). Only
+ lines that are being shown will be filtered, and, due to performance
+ reasons, not always immediately.
+
+ The row number is always the topmost row of the line if the line
+ spans multiple rows.
+
+ Please note that, if you change the line, then the hook might get
+ called later with the already-modified line (e.g. if unrelated parts
+ change), so you cannot just toggle rendition bits, but only set
+ them.
+
on_refresh_begin $term
Called just before the screen gets redrawn. Can be used for overlay
or similar effects by modify terminal contents in refresh_begin, and
@@ -171,12 +221,38 @@ DESCRIPTION
"perl:string" action bound to it (see description of the keysym
resource in the rxvt(1) manpage).
+ on_key_press $term, $event, $octets
+ on_key_release $term, $event
+ on_button_press $term, $event
+ on_button_release $term, $event
+ on_motion_notify $term, $event
+ Called whenever the corresponding X event is received for the
+ terminal If the hook returns true, then the even will be ignored by
+ rxvt-unicode.
+
+ The event is a hash with most values as named by Xlib (see the
+ XEvent manpage), with the additional members "row" and "col", which
+ are the row and column under the mouse cursor.
+
+ "on_key_press" additionally receives the string rxvt-unicode would
+ output, if any, in locale-specific encoding.
+
+ subwindow.
+
Variables in the "urxvt" Package
$urxvt::TERM
- The current terminal. Whenever a callback/Hook is bein executed,
- this variable stores the current "urxvt::term" object.
+ The current terminal. This variable stores the current "urxvt::term"
+ object, whenever a callback/hook is executing.
Functions in the "urxvt" Package
+ $term = new urxvt [arg...]
+ Creates a new terminal, very similar as if you had started it with
+ "system $binfile, arg...". Croaks (and probably outputs an error
+ message) if the new instance couldn't be created. Returns "undef" if
+ the new instance didn't initialise perl, and the terminal object
+ otherwise. The "init" and "start" hooks will be called during the
+ call.
+
urxvt::fatal $errormessage
Fatally aborts execution with the given error message. Avoid at all
costs! The only time this is acceptable is when the terminal process
@@ -233,6 +309,9 @@ DESCRIPTION
Change the custom value.
The "urxvt::term" Class
+ $term->destroy
+ Destroy the terminal object (close the window, free resources etc.).
+
$value = $term->resource ($name[, $newval])
Returns the current resource value associated with a given name and
optionally sets a new value. Setting values is most useful in the
@@ -267,9 +346,9 @@ DESCRIPTION
shade term_name title transparent transparent_all tripleclickwords
utmpInhibit visualBell
- $rend = $term->screen_rstyle ([$new_rstyle])
- Return and optionally change the current rendition. Text thta is
- output by the temrianl application will use this style.
+ $rend = $term->rstyle ([$new_rstyle])
+ Return and optionally change the current rendition. Text that is
+ output by the terminal application will use this style.
($row, $col) = $term->screen_cur ([$row, $col])
Return the current coordinates of the text cursor position and
@@ -291,20 +370,12 @@ DESCRIPTION
$newtext.
#=item $term->overlay ($x, $y, $text) # #Create a simple multi-line
- overlay box. See the next method for details. # #=cut
-
- sub urxvt::term::scr_overlay { die; my ($self, $x, $y, $text) = @_;
-
- my @lines = split /\n/, $text;
-
- my $w = 0;
- for (map $self->strwidth ($_), @lines) {
- $w = $_ if $w < $_;
- }
-
- $self->scr_overlay_new ($x, $y, $w, scalar @lines);
- $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines;
- }
+ overlay box. See the next method for details. # #=cut # #sub
+ urxvt::term::scr_overlay { # my ($self, $x, $y, $text) = @_; # # my
+ @lines = split /\n/, $text; # # my $w = 0; # for (map
+ $self->strwidth ($_), @lines) { # $w = $_ if $w < $_; # } # #
+ $self->scr_overlay_new ($x, $y, $w, scalar @lines); #
+ $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines; #}
$term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])
Create a new (empty) overlay at the given position with the given
@@ -333,23 +404,45 @@ DESCRIPTION
$overlay->show
If hidden, display the overlay again.
- $cellwidth = $term->strwidth $string
+ $cellwidth = $term->strwidth ($string)
Returns the number of screen-cells this string would need. Correctly
accounts for wide and combining characters.
- $octets = $term->locale_encode $string
+ $octets = $term->locale_encode ($string)
Convert the given text string into the corresponding locale
encoding.
- $string = $term->locale_decode $octets
+ $string = $term->locale_decode ($octets)
Convert the given locale-encoded octets into a perl string.
+ $term->scr_add_lines ($string)
+ Write the given text string to the screen, as if output by the
+ application running inside the terminal. It may not contain command
+ sequences (escape codes), but is free to use line feeds, carriage
+ returns and tabs. The string is a normal text string, not in
+ locale-dependent encoding.
+
+ Normally its not a good idea to use this function, as programs might
+ be confused by changes in cursor position or scrolling. Its useful
+ inside a "on_add_lines" hook, though.
+
+ $term->cmd_parse ($octets)
+ Similar to "scr_add_lines", but the argument must be in the
+ locale-specific encoding of the terminal and can contain command
+ sequences (escape codes) that will be interpreted.
+
$term->tt_write ($octets)
Write the octets given in $data to the tty (i.e. as program input).
To pass characters instead of octets, you should convert your
strings first to the locale-specific encoding using
"$term->locale_encode".
+ $windowid = $term->parent
+ Return the window id of the toplevel window.
+
+ $windowid = $term->vt
+ Return the window id of the terminal window.
+
$window_width = $term->width
$window_height = $term->height
$font_width = $term->fwidth
@@ -426,11 +519,13 @@ DESCRIPTION
about the logical line that row $row_number is part of. It supports
the following methods:
- $text = $line->t
- Returns the full text of the line, similar to "ROW_t"
+ $text = $line->t ([$new_text])
+ Returns or replaces the full text of the line, similar to
+ "ROW_t"
- $rend = $line->r
- Returns the full rendition array of the line, similar to "ROW_r"
+ $rend = $line->r ([$new_rend])
+ Returns or replaces the full rendition array of the line,
+ similar to "ROW_r"
$length = $line->l
Returns the length of the line in cells, similar to "ROW_l".
diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs
index ea90adbe..85a45274 100644
--- a/src/rxvtperl.xs
+++ b/src/rxvtperl.xs
@@ -707,6 +707,17 @@ MODULE = urxvt PACKAGE = urxvt::term
void
rxvt_term::destroy ()
+void
+rxvt_term::grab (int eventtime)
+ CODE:
+{
+return;
+ XGrabPointer (THIS->display->display, THIS->vt, 0,
+ ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
+ GrabModeAsync, GrabModeAsync, None, None, eventtime);
+ XGrabKeyboard (THIS->display->display, THIS->vt, 0, GrabModeAsync, GrabModeAsync, eventtime);
+}
+
int
rxvt_term::strwidth (SV *str)
CODE:
@@ -1148,7 +1159,9 @@ rxvt_term::cmd_parse (SV *octets)
THIS->cmdbuf_ptr = str;
THIS->cmdbuf_endp = str + len;
+ rxvt_push_locale (THIS->locale);
THIS->cmd_parse ();
+ rxvt_pop_locale ();
THIS->cmdbuf_ptr = old_cmdbuf_ptr;
THIS->cmdbuf_endp = old_cmdbuf_endp;
diff --git a/src/urxvt.pm b/src/urxvt.pm
index 7f8cbfad..8624a51e 100644
--- a/src/urxvt.pm
+++ b/src/urxvt.pm
@@ -118,7 +118,7 @@ locale-specific way.
=head2 Hooks
-The following subroutines can be declared in loaded scripts, and will be
+The following subroutines can be declared in extension files, and will be
called whenever the relevant event happens.
The first argument passed to them is an object private to each terminal
@@ -292,8 +292,8 @@ subwindow.
=item $urxvt::TERM
-The current terminal. Whenever a callback/Hook is bein executed, this
-variable stores the current C object.
+The current terminal. This variable stores the current C
+object, whenever a callback/hook is executing.
=back
--
2.34.1