.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "urxvt-selection-autotransform 1" .TH urxvt-selection-autotransform 1 2025-10-24 9.31 RXVT-UNICODE .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "نام (NAME)" selection\-autotransform \- تبدیل خودکار متن انتخاب‌شده .SH "توضیحات (DESCRIPTION)" .IX Header "DESCRIPTION" این افزونه به شما امکان می‌دهد هر زمان که متنی انتخاب شد، تبدیل‌های خودکاری را روی متن انتخاب‌شده انجام دهید. .PP سازوکار آن با مشخص کردن قطعه‌کدهای perl (که کاربردی‌ترین آن‌ها یک عملگر تکی \f(CW\*(C`s///\*(C'\fR است) به عنوان منابع (resources) انجام می‌شود که \f(CW$_\fR را تغییر می‌دهند: .PP .Vb 3 \& URxvt.selection\-autotransform.0: transform \& URxvt.selection\-autotransform.1: transform \& ... .Ve .PP برای نمونه، دستور زیر متن‌های انتخاب‌شده به صورت \f(CW\*(C`filename:number\*(C'\fR را که اغلب در پیام‌های کامپایلر دیده می‌شوند، به \f(CWvi +$filename $word\fR تبدیل می‌کند: .PP .Vb 1 \& URxvt.selection\-autotransform.0: s/^([^:[:space:]]+):(\e\ed+):?$/vi +$2 \e\eQ$1\e\eE\e\ex0d/ .Ve .PP و این مثال همان الگو را مطابقت می‌دهد، اما آن را با دستورهای vi جایگزین می‌کند که می‌توانید مستقیماً در ویرایشگر خود (مثلاً vi :) جای‌گذاری (paste) کنید: .PP .Vb 1 \& URxvt.selection\-autotransform.0: s/^([^:[:space:]]+(\e\ed+):?$/:e \e\eQ$1\e\eE\e\ex0d:$2\e\ex0d/ .Ve .PP البته می‌توان آن را متناسب با نیازها و ویرایشگر خود شخصی‌سازی کرد :) .PP برای تعمیم مثال بالا به پیام‌های خطای معمولی perl (مانند «XXX at FILENAME line YYY.»)، به راه‌حلی اندکی جامع‌تر نیاز دارید: .PP .Vb 2 \& URxvt.selection.pattern\-0: ( at .*? line \e\ed+[,.]) \& URxvt.selection\-autotransform.0: s/^ at (.*?) line (\e\ed+)[,.]$/:e \e\eQ$1\eE\e\ex0d:$2\e\ex0d/ .Ve .PP خط اول به کد انتخاب متن اعلان می‌کند که بخش ثابت هر پیام خطا را به عنوان الگوی انتخاب در نظر بگیرد، و خط دوم پیام را برای بارگذاری فایل به دستورهای vi تبدیل می‌کند.