'set novalue on' /* force KEXX and its way of SIGNAL ON NOVALUE */ /* Usage: [MACRO] UNIX [file] */ /* Or: KEDIT file (PROFile UNIX */ /* Example: UNIX file use UNIX settings */ /* UNIX reload current file */ /* Purpose: UNIX is for odd files not automatically handled */ /* correctly by your PROFILE settings. UNIX sets: */ /* TABSIN OFF => TAB not automatically expanded */ /* TABSOUT OFF => TAB not automatically compressed */ /* EOLIN LF => only LF handled as line end */ /* EOLOUT LF => line end saved as single LF */ /* EOFOUT EOL => last line end like all line ends */ /* EOFIN ALLOW => ASCII SUB ^Z not handled as EOF */ /* TRAILING ON => spaces before line end preserved */ /* Requires: Kedit 5.0 and STATUS.KEX */ /* Optional: INITIAL.KML, COLOR.KEX, MONO.KEX, WINDOWS.KEX */ /* KeditW should also work (Frank Ellermann, 2004) */ parse source . . NAME if profile() then exit EDIT( NAME ) ; call INIT if arg( 1 ) <> '' then do 'kedit' arg( 1 ) '(PROFile' NAME ; exit rc end 'extract /FEXT/FILEID/LINE' if alt.2() <> 0 then do 'emsg' FILEID.1 'changed' ; exit 12 end if FEXT.1 = 'BAK' then 'fext TMP' ; else 'fext BAK' if rc <> 0 then exit rc ; FILEID.0 = fileid.1() 'kedit "' || FILEID.1 || '" (PROFile' NAME if rc <> 0 then do /* trouble: reset old fileid */ NAME = rc ; 'fext' FEXT.2 ; exit NAME end 'kedit "' || FILEID.0 || '" (NEW' ; 'quit' 'kedit "' || FILEID.1 || '" (NEW' ; 'locate :' || LINE.1 exit 0 EDIT: procedure /* -------------------------------------------- */ if initial() then do /* initialize global settings */ 'hexdisp on' ; 'reprof on' ; 'shifts on' ; 'beep on' 'nomsg define initial.kml' ; 'nomsg macro ' monitor.1() 'arbchar on' ; 'arrow off' ; 'backup temp' 'number on' ; 'wrap on' ; 'varblank on' call INIT /* save new favoured settings */ end 'editv get HEXE.0' do N = 1 to HEXE.0 /* restore any local settings */ 'editv get HEXE.' || N /* for file resp. view saved */ 'set' HEXE.N /* by procedure INIT before */ end /* -------------------------------------------- */ 'eofin allow' ; 'eolin lf' ; 'tabsin off' 'eofout eol' ; 'eolout lf' ; 'tabsout off' 'trailing on' ; 'macro status' ; return 0 INIT: procedure /* -------------------------------------------- */ 'nomsg query attr' ; HEXE.1 = lastmsg.1() 'nomsg query arbchar' ; HEXE.2 = lastmsg.1() 'nomsg query arrow' ; HEXE.3 = lastmsg.1() 'nomsg query backup' ; HEXE.4 = lastmsg.1() 'nomsg query number' ; HEXE.5 = lastmsg.1() 'nomsg query varblank' ; HEXE.6 = lastmsg.1() 'nomsg query wrap' ; HEXE.7 = lastmsg.1() HEXE.0 = 7 do N = 0 to HEXE.0 ; 'editv put HEXE.' || N ; end return