-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprofile.kex
82 lines (75 loc) · 3.38 KB
/
profile.kex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
'nomsg editv get INITIAL.0' /* read variable INITIAL.0 */
if INITIAL.0 = '' then do /* if INITIAL.0 undefined: */
arg N
if pos( 'PROFDEBUG', N ) > pos( '(', N )
then 'debug INITIAL' /* use INITIAL.KEX to set */
else 'macro INITIAL' /* new INITIAL.0 count of */
'editv get INITIAL.0' /* unusual local defaults */
end /* including initial ATTRs */
if datatype( INITIAL.0, 'w' ) then do N = 1 to INITIAL.0
'editv get INITIAL.' || N /* local INITIAL.N setting */
'set' INITIAL.N ; if rc <> 0 then exit rc
end
do ; if TYPE( 'LUA MD' ) | REXX() then do
'eolout lf' ; 'tabs incr 3'
end /* UNIX lineends, EOF = LF */
else if TYPE( 'ASM INC S SH NMK DIFF' ) | FCIV() then do
'eolout lf'
end /* normal TABSin expansion */
else if TYPE( 'AWK C H CPP HPP CXX HXX JS CSS' ) then do
'eolout lf' ; 'tabs incr 5'
end /* indent cuddled up else_ */
else if NAME( 'CTAGS TAGS KTAGS MAKEFILE' ) then do
'eolout lf' ; 'tabsin off'
end /* do not expand tags TABs */
else if TYPE( 'BAT INI SYS CMD SCF' ) then do
'eolout crlf' ; 'tabsin off'
if TYPE( 'BAT INI SYS' ) then 'eofout eoleof'
end /* EOF char. for old *.BAT */
end
if dir() | FILE( 'MACROS.KML' ) then 'forward half'
else do /* REFRESH or FORWARD load */
if opmode.1() = 'REAL' then 'undoing on 200 100'
else if opmode.1() <> 'GUI' then 'undoing on 999 200'
else 'undoing on 999 999'
'extract /LASTMSG' ; 'nomsg refresh'
'macro status' ; 'nomsg msg' LASTMSG.1
end
if version.1() <> 'KEDIT' then do
'ecolor H magenta' /* for unmatched right end */
'ecolor L dark cyan' ; 'ecolor M dark magenta'
'ecolor N dark blue' ; 'ecolor O dark gray'
'ecolor P dark green' ; 'ecolor Q red'
C = color.1( 'F' ) ; N = wordpos( 'ON', C )
if N > 0 then do /* expect ... ON ... color */
C = subword( C, N ) ; 'extract /ECOLOR */'
do N = 1 to ECOLOR.0
K = wordpos( 'ON', ECOLOR.N )
K = subword( ECOLOR.N, 1 + K )
'ecolor' changestr( 'ON' K, ECOLOR.N, C )
end N /* BG matching filearea BG */
end
if FCIV() then do /* freeciv: swap red green */
C = 'FREECIV' ; 'parser' C C || '.KLD'
'ecolor A red' ; 'ecolor G dark green'
'pcolor A red' ; 'pcolor G dark green'
'coloring on' C
end
I = 'quit' ; 'toolset top default'
'def tool_' || I '"win close file"'
'toolbutton' I 'exit /Close file/'
'toolset top user' changestr( 'PRINT', toolset.3(), I )
end
else 'nomsg macro dosmouse' /* old Kedit 5 experiment */
exit 0
FCIV: procedure /* lots of special cases */
FCIV = 'MUSICSPEC RULESET SOUNDSPEC SPEC TILESPEC'
if TYPE( FCIV 'SAV' ) then return 1
FCIV = 'HELPDATA.TXT MODPACKS.DB MODPACKS.LIST'
if FILE( FCIV ) then return 1
return NAME( '.FREECIV-CLIENT-RC-2' )
REXX: return TYPE( 'REX REXX KEX KML CLS NRX REXG REXP' )
TYPE: return WPOS( arg( 1 ), ft.1())
NAME: return WPOS( arg( 1 ), fn.1())
FILE: return WPOS( arg( 1 ), fn.1() || . || ft.1())
WPOS: return sign( wordpos( arg( 2 ), arg( 1 )))