ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/doc/rxvtperl.3.txt
(Generate patch)

Comparing rxvt-unicode/doc/rxvtperl.3.txt (file contents):
Revision 1.22 by root, Wed Jan 11 02:13:56 2006 UTC vs.
Revision 1.29 by root, Tue Jan 17 16:22:41 2006 UTC

31 31
32 rxvt -pe <extensionname> 32 rxvt -pe <extensionname>
33 33
34 selection (enabled by default) 34 selection (enabled by default)
35 (More) intelligent selection. This extension tries to be more 35 (More) intelligent selection. This extension tries to be more
36 intelligent when the user extends selections (double-click). Right 36 intelligent when the user extends selections (double-click and
37 now, it tries to select urls and complete shell-quoted arguments, 37 further clicks). Right now, it tries to select words, urls and
38 which is very convenient, too, if your ls supports 38 complete shell-quoted arguments, which is very convenient, too, if
39 "--quoting-style=shell". 39 your ls supports "--quoting-style=shell".
40 40
41 A double-click usually selects the word under the cursor, further
42 clicks will enlarge the selection.
43
44 The selection works by trying to match a number of regexes and
45 displaying them in increasing order of length. You can add your own
46 regexes by specifying resources of the form:
47
48 URxvt.selection.pattern-0: perl-regex
49 URxvt.selection.pattern-1: perl-regex
50 ...
51
52 The index number (0, 1...) must not have any holes, and each regex
53 must contain at least one pair of capturing parentheses, which will
54 be used for the match. For example, the followign adds a regex that
55 matches everything between two vertical bars:
56
57 URxvt.selection.pattern-0: \\|([^|]+)\\|
58
59 You can look at the source of the selection extension to see more
60 interesting uses, such as parsing a line from beginning to end.
61
41 It also offers the following bindable keyboard command: 62 This extension also offers following bindable keyboard commands:
42 63
43 rot13 64 rot13
44 Rot-13 the selection when activated. Used via keyboard trigger: 65 Rot-13 the selection when activated. Used via keyboard trigger:
45 66
46 URxvt.keysym.C-M-r: perl:selection:rot13 67 URxvt.keysym.C-M-r: perl:selection:rot13
68
69 remote-pastebin
70 Upload the selection as textfile to a remote site.
71
72 URxvt.keysym.C-M-e: perl:selection:remote-pastebin
73
74 To set the command to upload the file set this resource:
75
76 URxvt.selection-pastebin-cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/.
77
78 The % is the placeholder for the textfile. The name of the
79 textfile is the hex encoded md5 sum of the selection. After an
80 successful upload the selection will be replaced by the
81 following url (the % is the placeholder for the filename):
82
83 URxvt.selection-pastebin-url: http://www.ta-sa.org/files/txt/%
47 84
48 option-popup (enabled by default) 85 option-popup (enabled by default)
49 Binds a popup menu to Ctrl-Button2 that lets you toggle (some) 86 Binds a popup menu to Ctrl-Button2 that lets you toggle (some)
50 options at runtime. 87 options at runtime.
51 88
55 unescaping, perl evalution, web-browser starting etc.), depending on 92 unescaping, perl evalution, web-browser starting etc.), depending on
56 content. 93 content.
57 94
58 searchable-scrollback<hotkey> (enabled by default) 95 searchable-scrollback<hotkey> (enabled by default)
59 Adds regex search functionality to the scrollback buffer, triggered 96 Adds regex search functionality to the scrollback buffer, triggered
60 by a hotkey (default: "M-s"). When in search mode, normal terminal 97 by a hotkey (default: "M-s"). While in search mode, normal terminal
61 input/output is suspended. 98 input/output is suspended and a regex is displayed at the bottom of
99 the screen.
62 100
63 "/" starts an incremental regex search, "n" searches further, "p" or 101 Inputting characters appends them to the regex and continues
64 "N" jump to the previous match, "G" jumps to the bottom and clears 102 incremental search. "BackSpace" removes a character from the regex,
65 the history, "enter" leaves search mode at the current position and 103 "Up" and "Down" search upwards/downwards in the scrollback buffer,
66 "escape" returns to the original position. 104 "End" jumps to the bottom. "Escape" leaves search mode and returns
105 to the point where search was started, while "Enter" or "Return"
106 stay at the current position and additionally stores the first match
107 in the current line into the primary selection.
67 108
68 digital-clock 109 selection-autotransform
69 Displays a digital clock using the built-in overlay. 110 This selection allows you to do automatic transforms on a selection
111 whenever a selection is made.
112
113 It works by specifying perl snippets (most useful is a single "s///"
114 operator) that modify $_ as resources:
115
116 URxvt.selection-autotransform.0: transform
117 URxvt.selection-autotransform.1: transform
118 ...
119
120 For example, the following will transform selections of the form
121 "filename:number", often seen in compiler messages, into "vi
122 +$filename $word":
123
124 URxvt.selection-autotransform.0: s/^([^:[:space:]]+):(\\d+):?$/vi +$2 \\Q$1\\E\\x0d/
125
126 And this example matches the same,but replaces it with vi-commands
127 you can paste directly into your (vi :) editor:
128
129 URxvt.selection-autotransform.0: s/^([^:[:space:]]+(\\d+):?$/\\x1b:e \\Q$1\\E\\x0d:$2\\x0d/
130
131 Of course, this can be modified to suit your needs and your editor
132 :)
133
134 To expand the example above to typical perl error messages ("XXX at
135 FILENAME line YYY."), you need a slightly more elaborate solution:
136
137 URxvt.selection.pattern-0: ( at .*? line \\d+\\.)
138 URxvt.selection-autotransform.0: s/^ at (.*?) line (\\d+)\\.$/\x1b:e \\Q$1\E\\x0d:$2\\x0d/
139
140 The first line tells the selection code to treat the unchanging part
141 of every error message as a selection pattern, and the second line
142 transforms the message into vi commands to load the file.
70 143
71 mark-urls 144 mark-urls
72 Uses per-line display filtering ("on_line_update") to underline urls 145 Uses per-line display filtering ("on_line_update") to underline urls
73 and make them clickable. When clicked, the program specified in the 146 and make them clickable. When middle-clicked, the program specified
74 resource "urlLauncher" (default "x-www-browser") will be started. 147 in the resource "urlLauncher" (default "x-www-browser") will be
148 started with the URL as first argument.
75 149
76 block-graphics-to-ascii 150 block-graphics-to-ascii
77 A not very useful example of filtering all text output to the 151 A not very useful example of filtering all text output to the
78 terminal, by replacing all line-drawing characters (U+2500 .. 152 terminal, by replacing all line-drawing characters (U+2500 ..
79 U+259F) by a similar-looking ascii character. 153 U+259F) by a similar-looking ascii character.
154
155 digital-clock
156 Displays a digital clock using the built-in overlay.
80 157
81 example-refresh-hooks 158 example-refresh-hooks
82 Displays a very simple digital clock in the upper right corner of 159 Displays a very simple digital clock in the upper right corner of
83 the window. Illustrates overwriting the refresh callbacks to create 160 the window. Illustrates overwriting the refresh callbacks to create
84 your own overlays or changes. 161 your own overlays or changes.
187 264
188 on_sel_extend $term 265 on_sel_extend $term
189 Called whenever the user tries to extend the selection (e.g. with a 266 Called whenever the user tries to extend the selection (e.g. with a
190 double click) and is either supposed to return false (normal 267 double click) and is either supposed to return false (normal
191 operation), or should extend the selection itelf and return true to 268 operation), or should extend the selection itelf and return true to
192 suppress the built-in processing. 269 suppress the built-in processing. This can happen multiple times, as
270 long as the callback returns true, it will be called on every
271 further click by the user and is supposed to enlarge the selection
272 more and more, if possible.
193 273
194 See the selection example extension. 274 See the selection example extension.
195 275
196 on_view_change $term, $offset 276 on_view_change $term, $offset
197 Called whenever the view offset changes, i..e the user or program 277 Called whenever the view offset changes, i..e the user or program
255 335
256 on_keyboard_command $term, $string 336 on_keyboard_command $term, $string
257 Called whenever the user presses a key combination that has a 337 Called whenever the user presses a key combination that has a
258 "perl:string" action bound to it (see description of the keysym 338 "perl:string" action bound to it (see description of the keysym
259 resource in the rxvt(1) manpage). 339 resource in the rxvt(1) manpage).
340
341 on_x_event $term, $event
342 Called on every X event received on the vt window (and possibly
343 other windows). Should only be used as a last resort. Most event
344 structure members are not passed.
260 345
261 on_focus_in $term 346 on_focus_in $term
262 Called whenever the window gets the keyboard focus, before 347 Called whenever the window gets the keyboard focus, before
263 rxvt-unicode does focus in processing. 348 rxvt-unicode does focus in processing.
264 349
316 Using this function has the advantage that its output ends up in the 401 Using this function has the advantage that its output ends up in the
317 correct place, e.g. on stderr of the connecting urxvtc client. 402 correct place, e.g. on stderr of the connecting urxvtc client.
318 403
319 Messages have a size limit of 1023 bytes currently. 404 Messages have a size limit of 1023 bytes currently.
320 405
321 $is_safe = urxvt::safe
322 Returns true when it is safe to do potentially unsafe things, such
323 as evaluating perl code specified by the user. This is true when
324 urxvt was started setuid or setgid.
325
326 $time = urxvt::NOW 406 $time = urxvt::NOW
327 Returns the "current time" (as per the event loop). 407 Returns the "current time" (as per the event loop).
328 408
329 urxvt::CurrentTime 409 urxvt::CurrentTime
330 urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, 410 urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask,
331 Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, Button4Mask, 411 Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, Button4Mask,
332 Button5Mask, AnyModifier 412 Button5Mask, AnyModifier
413 urxvt::NoEventMask, KeyPressMask, KeyReleaseMask, ButtonPressMask,
414 ButtonReleaseMask, EnterWindowMask, LeaveWindowMask, PointerMotionMask,
415 PointerMotionHintMask, Button1MotionMask, Button2MotionMask,
416 Button3MotionMask, Button4MotionMask, Button5MotionMask,
417 ButtonMotionMask, KeymapStateMask, ExposureMask, VisibilityChangeMask,
418 StructureNotifyMask, ResizeRedirectMask, SubstructureNotifyMask,
419 SubstructureRedirectMask, FocusChangeMask, PropertyChangeMask,
420 ColormapChangeMask, OwnerGrabButtonMask
421 urxvt::KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify,
422 EnterNotify, LeaveNotify, FocusIn, FocusOut, KeymapNotify, Expose,
423 GraphicsExpose, NoExpose, VisibilityNotify, CreateNotify, DestroyNotify,
424 UnmapNotify, MapNotify, MapRequest, ReparentNotify, ConfigureNotify,
425 ConfigureRequest, GravityNotify, ResizeRequest, CirculateNotify,
426 CirculateRequest, PropertyNotify, SelectionClear, SelectionRequest,
427 SelectionNotify, ColormapNotify, ClientMessage, MappingNotify
333 Various constants for use in X calls and event processing. 428 Various constants for use in X calls and event processing.
334 429
335 RENDITION 430 RENDITION
336 Rendition bitsets contain information about colour, font, font styles 431 Rendition bitsets contain information about colour, font, font styles
337 and similar information for each screen cell. 432 and similar information for each screen cell.
472 ($row, $col) = $term->selection_beg ([$row, $col]) 567 ($row, $col) = $term->selection_beg ([$row, $col])
473 ($row, $col) = $term->selection_end ([$row, $col]) 568 ($row, $col) = $term->selection_end ([$row, $col])
474 Return the current values of the selection mark, begin or end 569 Return the current values of the selection mark, begin or end
475 positions, and optionally set them to new values. 570 positions, and optionally set them to new values.
476 571
572 $term->selection_make ($eventtime[, $rectangular])
573 Tries to make a selection as set by "selection_beg" and
574 "selection_end". If $rectangular is true (default: false), a
575 rectangular selection will be made. This is the prefered function to
576 make a selection.
577
477 $success = $term->selection_grab ($eventtime) 578 $success = $term->selection_grab ($eventtime)
478 Try to request the primary selection from the server (for example, 579 Try to request the primary selection text from the server (for
479 as set by the next method). 580 example, as set by the next method). No visual feedback will be
581 given. This function is mostly useful from within "on_sel_grab"
582 hooks.
480 583
481 $oldtext = $term->selection ([$newtext]) 584 $oldtext = $term->selection ([$newtext])
482 Return the current selection text and optionally replace it by 585 Return the current selection text and optionally replace it by
483 $newtext. 586 $newtext.
484 587
529 $string = $term->locale_decode ($octets) 632 $string = $term->locale_decode ($octets)
530 Convert the given locale-encoded octets into a perl string. 633 Convert the given locale-encoded octets into a perl string.
531 634
532 $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) 635 $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle])
533 XORs the rendition values in the given span with the provided value 636 XORs the rendition values in the given span with the provided value
534 (default: "RS_RVid"). Useful in refresh hooks to provide effects 637 (default: "RS_RVid"), which *MUST NOT* contain font styles. Useful
535 similar to the selection. 638 in refresh hooks to provide effects similar to the selection.
536 639
537 $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, 640 $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[,
538 $rstyle2]]) 641 $rstyle2]])
539 Similar to "scr_xor_span", but xors a rectangle instead. Trailing 642 Similar to "scr_xor_span", but xors a rectangle instead. Trailing
540 whitespace will additionally be xored with the $rstyle2, which 643 whitespace will additionally be xored with the $rstyle2, which
541 defaults to "RS_RVid | RS_Uline", which removes reverse video again 644 defaults to "RS_RVid | RS_Uline", which removes reverse video again
542 and underlines it instead. 645 and underlines it instead. Both styles *MUST NOT* contain font
646 styles.
543 647
544 $term->scr_bell 648 $term->scr_bell
545 Ring the bell! 649 Ring the bell!
546 650
547 $term->scr_add_lines ($string) 651 $term->scr_add_lines ($string)
575 $windowid = $term->parent 679 $windowid = $term->parent
576 Return the window id of the toplevel window. 680 Return the window id of the toplevel window.
577 681
578 $windowid = $term->vt 682 $windowid = $term->vt
579 Return the window id of the terminal window. 683 Return the window id of the terminal window.
684
685 $term->vt_emask_add ($x_event_mask)
686 Adds the specified events to the vt event mask. Useful e.g. when you
687 want to receive pointer events all the times:
688
689 $term->vt_emask_add (urxvt::PointerMotionMask);
580 690
581 $window_width = $term->width 691 $window_width = $term->width
582 $window_height = $term->height 692 $window_height = $term->height
583 $font_width = $term->fwidth 693 $font_width = $term->fwidth
584 $font_height = $term->fheight 694 $font_height = $term->fheight
587 $terminal_columns = $term->ncol 697 $terminal_columns = $term->ncol
588 $has_focus = $term->focus 698 $has_focus = $term->focus
589 $is_mapped = $term->mapped 699 $is_mapped = $term->mapped
590 $max_scrollback = $term->saveLines 700 $max_scrollback = $term->saveLines
591 $nrow_plus_saveLines = $term->total_rows 701 $nrow_plus_saveLines = $term->total_rows
592 $lines_in_scrollback = $term->nsaved 702 $topmost_scrollback_row = $term->top_row
593 Return various integers describing terminal characteristics. 703 Return various integers describing terminal characteristics.
594 704
595 $x_display = $term->display_id 705 $x_display = $term->display_id
596 Return the DISPLAY used by rxvt-unicode. 706 Return the DISPLAY used by rxvt-unicode.
597 707
608 Return the modifier masks corresponding to the "ISO Level 3 Shift" 718 Return the modifier masks corresponding to the "ISO Level 3 Shift"
609 (often AltGr), the meta key (often Alt) and the num lock key, if 719 (often AltGr), the meta key (often Alt) and the num lock key, if
610 applicable. 720 applicable.
611 721
612 $view_start = $term->view_start ([$newvalue]) 722 $view_start = $term->view_start ([$newvalue])
613 Returns the negative row number of the topmost line. Minimum value 723 Returns the row number of the topmost displayed line. Maximum value
614 is 0, which displays the normal terminal contents. Larger values 724 is 0, which displays the normal terminal contents. Lower values
615 scroll this many lines into the scrollback buffer. 725 scroll this many lines into the scrollback buffer.
616 726
617 $term->want_refresh 727 $term->want_refresh
618 Requests a screen refresh. At the next opportunity, rxvt-unicode 728 Requests a screen refresh. At the next opportunity, rxvt-unicode
619 will compare the on-screen display with its stored representation. 729 will compare the on-screen display with its stored representation.
687 Return the row number of the first/last row of the line, 797 Return the row number of the first/last row of the line,
688 respectively. 798 respectively.
689 799
690 $offset = $line->offset_of ($row, $col) 800 $offset = $line->offset_of ($row, $col)
691 Returns the character offset of the given row|col pair within 801 Returns the character offset of the given row|col pair within
692 the logical line. 802 the logical line. Works for rows outside the line, too, and
803 returns corresponding offsets outside the string.
693 804
694 ($row, $col) = $line->coord_of ($offset) 805 ($row, $col) = $line->coord_of ($offset)
695 Translates a string offset into terminal coordinates again. 806 Translates a string offset into terminal coordinates again.
696 807
697 $text = $term->special_encode $string 808 $text = $term->special_encode $string
827 This variable controls the verbosity level of the perl extension. Higher 938 This variable controls the verbosity level of the perl extension. Higher
828 numbers indicate more verbose output. 939 numbers indicate more verbose output.
829 940
830 == 0 - fatal messages 941 == 0 - fatal messages
831 >= 3 - script loading and management 942 >= 3 - script loading and management
832 >=10 - all events received 943 >=10 - all called hooks
944 >=11 - hook reutrn values
833 945
834AUTHOR 946AUTHOR
835 Marc Lehmann <pcg@goof.com> 947 Marc Lehmann <pcg@goof.com>
836 http://software.schmorp.de/pkg/rxvt-unicode 948 http://software.schmorp.de/pkg/rxvt-unicode
837 949

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines