-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 554139cd0b53e40a91b8e39c4817e53694d36373: path_to: revision_to:
commit 554139cd0b53e40a91b8e39c4817e53694d36373 Author: Marc Lehmann <schmorp@schmorp.de> Date: Fri Jan 6 21:06:09 2006 +0000 *** empty log message *** diff --git a/MANIFEST b/MANIFEST
--- a/MANIFEST +++ b/MANIFEST @@ -171,7 +171,7 @@ src/rxvtperl.h src/rxvtperl.xs src/perl/example-refresh-hooks -src/perl/example-filter-input +src/perl/block-graphics-to-ascii src/perl/digital-clock src/perl/selection src/perl/mark-urls diff --git a/src/perl/block-graphics-to-ascii b/src/perl/block-graphics-to-ascii new file mode 100644 index 0000000000000000000000000000000000000000..4bdb1b3adb1d75eb0c44780f92481ba9badc2934 --- /dev/null +++ b/src/perl/block-graphics-to-ascii @@ -0,0 +1,16 @@ +#! perl + +# ─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋╌╍╎╏ +my $rep = "--||--||--||++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--||" +# ═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲ ╳╴╵╶╷╸╹╺╻╼╽╾╿▀▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▐░▒▓▔▕▖▗▘▙▚▛▜▝▞▟ + . "=|+++++++++++++++++++++++++++++++/\\X-|-|-|-|-|-|#____#######|||||###~###########"; + +sub on_add_lines { + my ($term, $str) = @_; + + $str =~ s/([\x{2500}-\x{259f}])/substr $rep, (ord $1) - 0x2500, 1/ge; + $term->scr_add_lines ($str); + + 1 +} + diff --git a/src/perl/example-filter-input b/src/perl/example-filter-input deleted file mode 100644 index ce19f2bc36f4d801b640acb5926f08af3a1d5611..0000000000000000000000000000000000000000 --- a/src/perl/example-filter-input +++ /dev/null @@ -1,29 +0,0 @@ -#! perl - -# same url as used in "selection" -my $url = - qr{( - (?:https?|ftp|news|mailto|file)://[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~]+ - [ab-zA-Z0-9\-\@;\/?:&=%\$_+!*\x27(),~] # do not include a trailing dot, its wrong too often - )}x; - -sub on_add_lines { - my ($term, $str) = @_; - - while ($str =~ $url) { - # found a url, first output preceding text - $term->scr_add_lines (substr $str, 0, $-[1], ""); - # then toggle underline - $term->rstyle ($term->rstyle ^ urxvt::RS_Uline); - # now output the url - $term->scr_add_lines (substr $str, 0, $+[1] - $-[1], ""); - # toggle undelrine again - $term->rstyle ($term->rstyle ^ urxvt::RS_Uline); - } - - # output trailing text - $term->scr_add_lines ($str); - - 1 -} - diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs
--- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -487,6 +487,7 @@ rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) XPUSHs (sv_2mortal (wcs2sv (wstr, wlen))); } + break; case DT_XEVENT: { diff --git a/src/urxvt.pm b/src/urxvt.pm
--- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -64,7 +64,13 @@ Displays a digital clock using the built-in overlay. =item mark-urls -Uses per-line filtering (C<on_line_update>) to underline urls. +Uses per-line display filtering (C<on_line_update>) to underline urls. + +=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. =item example-refresh-hooks @@ -72,13 +78,6 @@ 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. -=item example-filter-input - -A not very useful example of filtering all text output to the terminal, by -underlining all urls that matches a certain regex (i.e. some urls :). It -is not very useful because urls that are output in multiple steps (e.g. -when typing them) do not get marked. - =back =head2 General API Considerations
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 09:42:35 2024