'set novalue on' /* force KEXX and its way of SIGNAL ON NOVALUE */ /* Usage: [MACRO] KEYDIFF [macroname(s)] */ /* Examples: KEYDIFF (default: ALL) */ /* KEYDIFF A-F8 (compare A-F8) */ /* KEYDIFF CHANGED (failure test) */ /* Purpose: Show changed key definitions in CHANGED.KML and */ /* corresponding defaults in KEYDIFF.KML. This is */ /* not the same as MACROS CHANGED resp. MACROS ALL */ /* because only modified defaults are listed. */ /* MACROS ALL ignores "uninteresting" macros, and */ /* therefore KEYDIFF won't show these macros: use */ /* MACROS CHANGED to get all changed macros. */ /* MACROS X Y lists X Y (even if "uninteresting"), */ /* therefore KEYDIFFF X Y includes X Y if changed. */ /* See also: KHELP MACROS, KEDITW BUILTIN.KML */ /* Requires: Kedit 5.0 or Keditw 1.0 (Frank Ellermann, 2000) */ NEW = dosenv( macropath.1()) /* assume MACROPATH write access */ if NEW = '' then NEW = '.' /* if MACROPATH ON or OFF use . */ if right( NEW, 1 ) <> '\' then NEW = NEW || '\' KEYDIFF = '"' || NEW || 'KEYDIFF.KML"' CHANGED = '"' || NEW || 'CHANGED.KML"' if initial() then do /* default macros in KEYDIFF.KML */ arg . 'KEYDIFF)' NEW /* argument after profile option */ 'nomsg macros' NEW ; 'ff' KEYDIFF ; 'cancel' ; exit rc end 'x' CHANGED '(new noprof' ; if rc = 0 then 'quit' if rc = 0 then 'x' KEYDIFF ; if rc <> 0 then exit rc do while size.1() = 0 /* MACRO TRACE KEYDIFF supported */ 'quit' ; if rc <> 0 then exit rc 'macros' arg(1) ; if rc <> 0 then exit rc 'quit' ; NEW = 'PROFDEBUG' 'nomsg q macro KEYDIFF' ; if rc <> 0 then NEW = 'NOSCREEN' 'dosq kedit dir (new nomsg' NEW 'prof KEYDIFF)' arg(1) 'x' KEYDIFF ; if rc <> 0 then exit rc 'nomsg erase' KEYDIFF ; if size.1() > 0 then leave if ring.0() > 0 then 'quit' NEW = 'Use KEDIT DIR (PROF KEYDIFF) outside KEDIT,' d2c(10) NEW = NEW || 'then try MACRO KEYDIFF within KEDIT again' KEYDIFF = 'Not enough memory to create KEYDIFF.KML' 'alert' delimit( NEW ) 'title' delimit( KEYDIFF ) ; exit 1 end 'macros changed' ; if rc <> 0 then exit rc if size.1() = 0 then do /* changed macros in CHANGED.KML */ 'quit' ; 'x' KEYDIFF ; if ring.0() > 0 then 'nomsg quit' 'emsg No changed macro' ; exit 1 end 'extract /SCREEN/ARBCHAR/UNDOING/STAY/WRAP/ZONE/CASE/' 'fileid' CHANGED ; 'wrap off' ; 'arbchar off' ; 'stay off' 'reset block' ; 'zone 1 *' ; 'undoing off' ; 'case M I' 'x' KEYDIFF ; 'wrap off' ; 'arbchar off' ; 'stay off' 'zone 1 *' ; 'undoing off' ; 'case M I' NEW = 0 ; 'locate :0 nomsg find :' do while rc = 0 /* remove all unmodified macros: */ MACRO = word( curline.3(), 1 ) || ' ' 'x' CHANGED ; 'locate :0 nomsg tfind' delimit( MACRO ) if rc <> 0 then do /* this is no changed default... */ 'x' KEYDIFF ; 'mark line' ; 'nomsg find :' ; 'up' 'mark line' ; 'del block' ; 'up' end else 'refresh' ; 'x' KEYDIFF ; 'nomsg find :' end 'x' CHANGED ; 'locate :0 nomsg find :' do while rc = 0 /* remove completely new macros: */ MACRO = word( curline.3(), 1 ) || ' ' ; NEW = NEW + 1 'x' KEYDIFF ; 'locate :0 nomsg tfind' delimit( MACRO ) if rc <> 0 then do /* this is no changed default... */ 'x' CHANGED ; 'mark line' ; 'nomsg find :' ; 'up' NEW = NEW-1 ; 'mark line' ; 'del block' ; 'up' end else 'refresh' ; 'x' CHANGED ; 'nomsg find :' end 'screen 2' ; ':0 forward half' ; 'set alt 0 0' 'stay' STAY.1 ; 'arbchar' ARBCHAR.1 ; 'case' CASE.1 CASE.2 'wrap' WRAP.1 ; 'undoing' UNDOING.1 ; 'zone' ZONE.1 ZONE.2 'sos tabcmdf' ; NEW = delimit( NEW 'changed default(s) found' ) 'x' KEYDIFF ; ':0 forward half' ; 'set alt 0 0' 'stay' STAY.1 ; 'arbchar' ARBCHAR.1 ; 'case' CASE.1 CASE.2 'wrap' WRAP.1 ; 'undoing' UNDOING.1 ; 'zone' ZONE.1 ZONE.2 if size.1() = 0 then do /* MACROS new or unCHANGED: exit */ 'nomsg quit' ; 'screen' SCREEN.1 ; 'x' CHANGED if ring.0() > 0 then 'quit' 'emsg either new or default:' translate( arg(1)) ; exit 1 end 'nomsg dialog /use split screen ?/ title' NEW 'OKCANCEL' if rc = 0 then if DIALOG.2 = 'OK' then exit rc 'screen' SCREEN.1 /* OKCANCEL allows ESC -> CANCEL */