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

Comparing rxvt-unicode/doc/rxvtperl.3.html (file contents):
Revision 1.35 by root, Fri Jan 20 22:49:34 2006 UTC vs.
Revision 1.38 by root, Wed Jan 25 00:57:57 2006 UTC

121<dd> 121<dd>
122<pre> 122<pre>
123 URxvt.selection.pattern-0: \\|([^|]+)\\|</pre> 123 URxvt.selection.pattern-0: \\|([^|]+)\\|</pre>
124</dd> 124</dd>
125<dd> 125<dd>
126<p>Another example: Programs I use often output ``absolute path: '' at the
127beginning of a line when they process multiple files. The following
128pattern matches the filename (note, there is a single space at the very
129end):</p>
130</dd>
131<dd>
132<pre>
133 URxvt.selection.pattern-0: ^(/[^:]+):\</pre>
134</dd>
135<dd>
126<p>You can look at the source of the selection extension to see more 136<p>You can look at the source of the selection extension to see more
127interesting uses, such as parsing a line from beginning to end.</p> 137interesting uses, such as parsing a line from beginning to end.</p>
128</dd> 138</dd>
129<dd> 139<dd>
130<p>This extension also offers following bindable keyboard commands:</p> 140<p>This extension also offers following bindable keyboard commands:</p>
195was started, while <code>Enter</code> or <code>Return</code> stay at the current position and 205was started, while <code>Enter</code> or <code>Return</code> stay at the current position and
196additionally stores the first match in the current line into the primary 206additionally stores the first match in the current line into the primary
197selection.</p> 207selection.</p>
198</dd> 208</dd>
199<p></p> 209<p></p>
200<dt><strong><a name="item_selection_2dautotransform">selection-autotransform</a></strong><br />
201</dt>
202<dd>
203This selection allows you to do automatic transforms on a selection
204whenever a selection is made.
205</dd>
206<dd>
207<p>It works by specifying perl snippets (most useful is a single <code>s///</code>
208operator) that modify <code>$_</code> as resources:</p>
209</dd>
210<dd>
211<pre>
212 URxvt.selection-autotransform.0: transform
213 URxvt.selection-autotransform.1: transform
214 ...</pre>
215</dd>
216<dd>
217<p>For example, the following will transform selections of the form
218<code>filename:number</code>, often seen in compiler messages, into <code>vi +$filename
219$word</code>:</p>
220</dd>
221<dd>
222<pre>
223 URxvt.selection-autotransform.0: s/^([^:[:space:]]+):(\\d+):?$/vi +$2 \\Q$1\\E\\x0d/</pre>
224</dd>
225<dd>
226<p>And this example matches the same,but replaces it with vi-commands you can
227paste directly into your (vi :) editor:</p>
228</dd>
229<dd>
230<pre>
231 URxvt.selection-autotransform.0: s/^([^:[:space:]]+(\\d+):?$/:e \\Q$1\\E\\x0d:$2\\x0d/</pre>
232</dd>
233<dd>
234<p>Of course, this can be modified to suit your needs and your editor :)</p>
235</dd>
236<dd>
237<p>To expand the example above to typical perl error messages (``XXX at
238FILENAME line YYY.''), you need a slightly more elaborate solution:</p>
239</dd>
240<dd>
241<pre>
242 URxvt.selection.pattern-0: ( at .*? line \\d+[,.])
243 URxvt.selection-autotransform.0: s/^ at (.*?) line (\\d+)[,.]$/:e \\Q$1\E\\x0d:$2\\x0d/</pre>
244</dd>
245<dd>
246<p>The first line tells the selection code to treat the unchanging part of
247every error message as a selection pattern, and the second line transforms
248the message into vi commands to load the file.</p>
249</dd>
250<p></p>
251<dt><strong><a name="item_readline">readline</a></strong><br /> 210<dt><strong><a name="item_readline">readline (enabled by default)</a></strong><br />
252</dt> 211</dt>
253<dd> 212<dd>
254A support package that tries to make editing with readline easier. At the 213A support package that tries to make editing with readline easier. At the
255moment, it reacts to clicking with the left mouse button by trying to 214moment, it reacts to clicking with the left mouse button by trying to
256move the text cursor to this position. It does so by generating as many 215move the text cursor to this position. It does so by generating as many
257cursor-left or cursor-right keypresses as required (the this only works 216cursor-left or cursor-right keypresses as required (the this only works
258for programs that correctly support wide characters). 217for programs that correctly support wide characters).
259</dd> 218</dd>
260<dd> 219<dd>
261<p>It only works when clicking into the same line (possibly extended over 220<p>To avoid too many false positives, this is only done when:</p>
262multiple rows) as the text cursor and on the primary screen, to reduce the 221</dd>
263risk of misinterpreting. The normal selection isn't disabled, so quick 222<dl>
223<dt><strong><a name="item__2d_the_tty_is_in_icanon_state_2e">- the tty is in ICANON state.</a></strong><br />
224</dt>
225<dt><strong><a name="item__2d_the_text_cursor_is_visible_2e">- the text cursor is visible.</a></strong><br />
226</dt>
227<dt><strong><a name="item__2d_the_primary_screen_is_currently_being_displaye">- the primary screen is currently being displayed.</a></strong><br />
228</dt>
229<dt><strong><a name="item_same">- the mouse is on the same (multi-row-) line as the text cursor.</a></strong><br />
230</dt>
231</dl>
232<p>The normal selection mechanism isn't disabled, so quick successive clicks
264successive clicks might interfere with selection creation in harmless 233might interfere with selection creation in harmless ways.</p>
265ways.</p> 234<dt><strong><a name="item_selection_2dautotransform">selection-autotransform</a></strong><br />
235</dt>
236<dd>
237This selection allows you to do automatic transforms on a selection
238whenever a selection is made.
239</dd>
240<dd>
241<p>It works by specifying perl snippets (most useful is a single <code>s///</code>
242operator) that modify <code>$_</code> as resources:</p>
243</dd>
244<dd>
245<pre>
246 URxvt.selection-autotransform.0: transform
247 URxvt.selection-autotransform.1: transform
248 ...</pre>
249</dd>
250<dd>
251<p>For example, the following will transform selections of the form
252<code>filename:number</code>, often seen in compiler messages, into <code>vi +$filename
253$word</code>:</p>
254</dd>
255<dd>
256<pre>
257 URxvt.selection-autotransform.0: s/^([^:[:space:]]+):(\\d+):?$/vi +$2 \\Q$1\\E\\x0d/</pre>
258</dd>
259<dd>
260<p>And this example matches the same,but replaces it with vi-commands you can
261paste directly into your (vi :) editor:</p>
262</dd>
263<dd>
264<pre>
265 URxvt.selection-autotransform.0: s/^([^:[:space:]]+(\\d+):?$/:e \\Q$1\\E\\x0d:$2\\x0d/</pre>
266</dd>
267<dd>
268<p>Of course, this can be modified to suit your needs and your editor :)</p>
269</dd>
270<dd>
271<p>To expand the example above to typical perl error messages (``XXX at
272FILENAME line YYY.''), you need a slightly more elaborate solution:</p>
273</dd>
274<dd>
275<pre>
276 URxvt.selection.pattern-0: ( at .*? line \\d+[,.])
277 URxvt.selection-autotransform.0: s/^ at (.*?) line (\\d+)[,.]$/:e \\Q$1\E\\x0d:$2\\x0d/</pre>
278</dd>
279<dd>
280<p>The first line tells the selection code to treat the unchanging part of
281every error message as a selection pattern, and the second line transforms
282the message into vi commands to load the file.</p>
266</dd> 283</dd>
267<p></p> 284<p></p>
268<dt><strong><a name="item_tabbed">tabbed</a></strong><br /> 285<dt><strong><a name="item_tabbed">tabbed</a></strong><br />
269</dt> 286</dt>
270<dd> 287<dd>
284<dd> 301<dd>
285Uses per-line display filtering (<code>on_line_update</code>) to underline urls and 302Uses per-line display filtering (<code>on_line_update</code>) to underline urls and
286make them clickable. When middle-clicked, the program specified in the 303make them clickable. When middle-clicked, the program specified in the
287resource <code>urlLauncher</code> (default <code>x-www-browser</code>) will be started with 304resource <code>urlLauncher</code> (default <code>x-www-browser</code>) will be started with
288the URL as first argument. 305the URL as first argument.
306</dd>
307<p></p>
308<dt><strong><a name="item_xim_2donthespot">xim-onthespot</a></strong><br />
309</dt>
310<dd>
311This (experimental) perl extension implements OnTheSpot editing. It does
312not work perfectly, and some input methods don't seem to work well with
313OnTheSpot editing in general, but it seems to work at leats for SCIM and
314kinput2.
315</dd>
316<dd>
317<p>You enable it by specifying this extension and a preedit style of
318<code>OnTheSpot</code>, i.e.:</p>
319</dd>
320<dd>
321<pre>
322 rxvt -pt OnTheSpot -pe xim-onthespot</pre>
289</dd> 323</dd>
290<p></p> 324<p></p>
291<dt><strong><a name="item_automove_2dbackground">automove-background</a></strong><br /> 325<dt><strong><a name="item_automove_2dbackground">automove-background</a></strong><br />
292</dt> 326</dt>
293<dd> 327<dd>
470</dd> 504</dd>
471<p></p> 505<p></p>
472<dt><strong><a name="item_on_destroy__24term">on_destroy $term</a></strong><br /> 506<dt><strong><a name="item_on_destroy__24term">on_destroy $term</a></strong><br />
473</dt> 507</dt>
474<dd> 508<dd>
475Called whenever something tries to destroy terminal, before doing anything 509Called whenever something tries to destroy terminal, when the terminal is
476yet. If this hook returns true, then destruction is skipped, but this is 510still fully functional (not for long, though).
477rarely a good idea.
478</dd> 511</dd>
479<p></p> 512<p></p>
480<dt><strong><a name="item_on_reset__24term">on_reset $term</a></strong><br /> 513<dt><strong><a name="item_on_reset__24term">on_reset $term</a></strong><br />
481</dt> 514</dt>
482<dd> 515<dd>
1192be used to suppress input and output handling to the pty/tty. See the 1225be used to suppress input and output handling to the pty/tty. See the
1193description of <a href="#item_events"><code>urxvt::timer-&gt;events</code></a>. Make sure to always restore 1226description of <a href="#item_events"><code>urxvt::timer-&gt;events</code></a>. Make sure to always restore
1194the previous value. 1227the previous value.
1195</dd> 1228</dd>
1196<p></p> 1229<p></p>
1230<dt><strong><a name="item_pty_fd">$fd = $term-&gt;pty_fd</a></strong><br />
1231</dt>
1232<dd>
1233Returns the master file descriptor for the pty in use, or <code>-1</code> if no pty
1234is used.
1235</dd>
1236<p></p>
1197<dt><strong><a name="item_parent">$windowid = $term-&gt;parent</a></strong><br /> 1237<dt><strong><a name="item_parent">$windowid = $term-&gt;parent</a></strong><br />
1198</dt> 1238</dt>
1199<dd> 1239<dd>
1200Return the window id of the toplevel window. 1240Return the window id of the toplevel window.
1201</dd> 1241</dd>
1277<p></p> 1317<p></p>
1278<dt><strong><a name="item_current_screen">$screen = $term-&gt;current_screen</a></strong><br /> 1318<dt><strong><a name="item_current_screen">$screen = $term-&gt;current_screen</a></strong><br />
1279</dt> 1319</dt>
1280<dd> 1320<dd>
1281Returns the currently displayed screen (0 primary, 1 secondary). 1321Returns the currently displayed screen (0 primary, 1 secondary).
1322</dd>
1323<p></p>
1324<dt><strong><a name="item_hidden_cursor">$cursor_is_hidden = $term-&gt;hidden_cursor</a></strong><br />
1325</dt>
1326<dd>
1327Returns wether the cursor is currently hidden or not.
1282</dd> 1328</dd>
1283<p></p> 1329<p></p>
1284<dt><strong><a name="item_view_start">$view_start = $term-&gt;view_start ([$newvalue])</a></strong><br /> 1330<dt><strong><a name="item_view_start">$view_start = $term-&gt;view_start ([$newvalue])</a></strong><br />
1285</dt> 1331</dt>
1286<dd> 1332<dd>
1314line, starting at column <code>$start_col</code> (default <code>0</code>), which is useful 1360line, starting at column <code>$start_col</code> (default <code>0</code>), which is useful
1315to replace only parts of a line. The font index in the rendition will 1361to replace only parts of a line. The font index in the rendition will
1316automatically be updated.</p> 1362automatically be updated.</p>
1317</dd> 1363</dd>
1318<dd> 1364<dd>
1319<p><a href="#item__24text"><code>$text</code></a> is in a special encoding: tabs and wide characters that use 1365<p><a href="#item__24text"><code>$text</code></a> is in a special encoding: tabs and wide characters that use more
1320more than one cell when displayed are padded with <code>$urxvt::NOCHAR</code> 1366than one cell when displayed are padded with <code>$urxvt::NOCHAR</code> (chr 65535)
1321characters. Characters with combining characters and other characters that 1367characters. Characters with combining characters and other characters that
1322do not fit into the normal tetx encoding will be replaced with characters 1368do not fit into the normal tetx encoding will be replaced with characters
1323in the private use area.</p> 1369in the private use area.</p>
1324</dd> 1370</dd>
1325<dd> 1371<dd>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines