'set novalue on' /* force KEXX and its way of SIGNAL ON NOVALUE */ /* Usage: [MACRO] UNBLANK */ /* Purpose: Get rid of even blank lines (NetScape 2.02 uses */ /* weird CR CR LF as line end in "view source", so */ /* all even line numbers are blank). */ /* My first application for LESS 1 plus MORE 2 :-) */ /* Requires: Kedit 5.0 (Frank Ellermann, 2002) */ 'set point .UNBLANK.1' /* point at actual line... */ 'locate' focustof() - focuseof() /* next (or previous) line */ 'set point .UNBLANK.2' /* 1 of 2 points survives */ 'top' ; 'less 1' ; 'more 2' /* show even line numbers */ 'nomsg locate ~blank' ; RX = rc ; S = 0 if RX <> 0 then 'del all' ; 'all' /* show remaining lines */ if RX <> 0 then do N = 1 to size.1() 'locate :' || N ; S = S + 2 + length( curline.3()) end 'nomsg locate .UNBLANK.2' ; 'nomsg set point .UNBLANK.2 off' 'nomsg locate .UNBLANK.1' ; 'nomsg set point .UNBLANK.1 off' if RX <> 0 then say S 'bytes in' N - 1 'lines incl. CrLf' else 'emsg not all even lines blank' exit RX = 0 /* 1 if not all even blank */