Changeset 3661


Ignore:
Timestamp:
Oct 8, 2019, 10:11:05 PM (5 years ago)
Author:
Andreas Schnellbacher
Message:
Location:
trunk/src/netlabs/macros
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/netlabs/macros/epm_ea.e

    r3460 r3661  
    108108   call Find_Ea( "\1\2\4\3\5", xx_seg, xx_ofs, xx_ptr1, xx_ptr2, xx_len, xx_entrylen, xx_valuelen)
    109109   if (xx_len > 4) and xx_entrylen then
    110       poke ea_ptr, xx_len-xx_entrylen, atol(xx_entrylen)
     110      poke ea_ptr, xx_len-xx_entrylen, atol( xx_entrylen)
    111111   endif
    112112
     
    228228         answer = WinMessageBox( SUBJ_TITLE__MSG, NON_ASCII_SUBJECT__MSG\1''CHANGE_QUERY__MSG, 16388) -- YESNO + MOVEABLE
    229229      endif
    230    else  -- arg(1) not null
     230   else  -- arg( 1) not null
    231231      answer = 6
    232232   endif
    233233   if answer = 6 then
    234234      if arg( 1) = '' then
    235          parse value EntryBox(SUBJ_TITLE__MSG, '/'SET__MSG'/'CANCEL__MSG'/'HELP__MSG, subj, 40,
     235         parse value EntryBox( SUBJ_TITLE__MSG, '/'SET__MSG'/'CANCEL__MSG'/'HELP__MSG, subj, 40,
    236236                260,
    237                 atoi(1)''atoi( 6050)''GethWndC( APP_HANDLE)''SELECT_SUBJECT__MSG) with button 2 newsubj \0
     237                atoi( 1)''atoi( 6050)''GethWndC( APP_HANDLE)''SELECT_SUBJECT__MSG) with button 2 newsubj \0
    238238      else
    239239         newsubj = arg( 1)
  • TabularUnified trunk/src/netlabs/macros/modecfg.e

    r3534 r3661  
    313313        SetToolbar        <toolbar_name> (must be defined in NEPMD.INI)
    314314        SetDynaspell      0 | 1
    315         SetEditOptions    see description of EDIT command
     315     /* SetEditOptions    see description of EDIT command (can't work) */
    316316        SetSaveOptions    see description of SAVE command
    317317        SetSearchOptions  see description of LOCATE and REPLACE commands
     
    461461'ModeExecute TEXT SetStreamMode 0'
    462462
    463 /*'ModeExecute BIN SetEditOptions /t /64 /bin'*/
    464463'ModeExecute BIN SetSaveOptions /ne /ns /nt'
    465464'ModeExecute BIN SetTabs 1'
  • TabularUnified trunk/src/netlabs/macros/modeexec.e

    r3660 r3661  
    6363;         SetToolbar        <toolbar_name> (must be defined in NEPMD.INI)
    6464;         SetDynaspell      0 | 1
    65 ;         SetEditOptions    see description of EDIT command
     65;      /* SetEditOptions    see description of EDIT command (can't work) */
    6666;         SetSaveOptions    see description of SAVE command
    6767;         SetSearchOptions  see description of LOCATE and REPLACE commands
     
    154154; ---------------------------------------------------------------------------
    155155
    156 compile if not defined(SMALL)  -- If SMALL not defined, then being separately compiled
     156compile if not defined( SMALL)  -- If SMALL not defined, then being separately compiled
    157157   EA_comment 'This defines mode-specific commands.'
    158158
     
    199199   call AddAVar( 'selectsettingslist',
    200200                        'Toolbar Keyset Expand Matchtab' ||
    201                         ' EditOptions SaveOptions SearchOptions' ||
     201                        /* EditOptions*/' SaveOptions SearchOptions' ||
    202202                        ' StreamMode InsertMode' ||
    203203                        ' TextFont TextColor MarkColor Indent' ||
     
    213213; ---------------------------------------------------------------------------
    214214defc ResetFileSettings
    215    args = arg(1)
     215   args = arg( 1)
    216216
    217217   fProcessLoad   = 0
     
    238238   getfileid fid
    239239   SettingsList = LoadSettingsList SelectSettingsList
    240    do w = 1 to words(SettingsList)
     240   do w = 1 to words( SettingsList)
    241241      wrd = word( SettingsList, w)
    242       call SetAVar( fid'.'lowcase(wrd), '')
     242      call SetAVar( fid'.'lowcase( wrd), '')
    243243   enddo
    244244   call SetAVar( fid'.modesettingsapplied', 0)
     
    263263                        -- 2: defload processed
    264264                        -- 0: afterload processed
    265    args = arg(1)
     265   args = arg( 1)
    266266   dprintf( 'LOAD', 'ProcessLoadSettings entered for 'args)
    267267
     
    272272
    273273   parse arg Mode calling_fid
    274    Mode = strip(Mode)
    275    calling_fid = strip(calling_fid)
     274   Mode = strip( Mode)
     275   calling_fid = strip( calling_fid)
    276276
    277277   if Mode = '' then
     
    284284   if refresh_on then
    285285      if LoadState then  -- during file loading
    286          CheckFlag = GetHiliteCheckFlag(Mode)
     286         CheckFlag = GetHiliteCheckFlag( Mode)
    287287      else
    288288         CheckFlag = ''
     
    296296
    297297   getfileid fid
    298    if isnum(calling_fid) then
     298   if isnum( calling_fid) then
    299299      if calling_fid <> fid then
    300300         --dprintf( 'No load settings processed. File not on top anymore:' ||
     
    307307   -- so slow, that file to be processed is not on top anymore.
    308308   prefix = 'hook.'
    309    HookName = 'load_'lowcase(Mode)
     309   HookName = 'load_'lowcase( Mode)
    310310   imax = GetAVar( prefix''HookName'.0')
    311311   if imax = '' then
     
    335335      do w = 1 to words( List)  -- Only LoadSettings need to be reset for default mode
    336336         wrd = word( List, w)
    337          next = GetAVar( fid'.'lowcase(wrd))  -- get file setting
     337         next = GetAVar( fid'.'lowcase( wrd))  -- get file setting
    338338         if next = '' | next = 'DEFAULT' then
    339339            'Set'wrd 'DEFAULT'  -- execute load setting with 'DEFAULT'
     
    355355      return
    356356   endif
    357    SelectSettingsList = GetAVar('selectsettingslist')
     357   SelectSettingsList = GetAVar( 'selectsettingslist')
    358358
    359359   -- Get file-specific setting names
     
    362362   UsedFileSettings = ''
    363363   -- Check if mode settings already overtaken from the hook to current file's array var
    364    fModeSettingsApplied = GetAVar(fid'.modesettingsapplied')
     364   fModeSettingsApplied = GetAVar( fid'.modesettingsapplied')
    365365   if fModeSettingsApplied then
    366       do w = 1 to words(SelectSettingsList)
     366      do w = 1 to words( SelectSettingsList)
    367367         wrd = word( SelectSettingsList, w)
    368368         wrd = lowcase( wrd)
    369          SettingsValue = GetAVar(fid'.'wrd)
     369         SettingsValue = GetAVar( fid'.'wrd)
    370370         if wrd = 'keyset' & SettingsValue = 'std' then
    371371            SettingsValue = 'DEFAULT'
     
    375375         endif
    376376      enddo
    377       UsedFileSettings = strip(UsedFileSettings)
     377      UsedFileSettings = strip( UsedFileSettings)
    378378   endif
    379379   --dprintf( 'UsedFileSettings = 'UsedFileSettings)
     
    384384   Mode = GetMode()
    385385   prefix = 'hook.'
    386    HookName = 'select_'lowcase(Mode)
    387    imax = GetAVar(prefix''HookName'.0')
     386   HookName = 'select_'lowcase( Mode)
     387   imax = GetAVar( prefix''HookName'.0')
    388388   if imax = '' then
    389389      imax = 0
     
    391391   UsedModeSettings = ''
    392392   do i = 1 to imax
    393       Cmd = GetAVar(prefix''HookName'.'i)
     393      Cmd = GetAVar( prefix''HookName'.'i)
    394394      parse value Cmd with wrd SettingsValue
    395       if leftstr( upcase(wrd), 3) = 'SET' then
     395      if leftstr( upcase( wrd), 3) = 'SET' then
    396396         wrd = substr( wrd, 4)  -- strip 'Set'
    397397      endif
    398       if not wordpos( upcase(wrd), upcase(UsedFileSettings)) then
     398      if not wordpos( upcase( wrd), upcase( UsedFileSettings)) then
    399399         dprintf( 'MODEEXEC', 'MODE: 'Cmd' -- '.filename)
    400400         Cmd  -- execute command
     
    402402      endif
    403403   enddo
    404    UsedModeSettings = strip(UsedModeSettings)
     404   UsedModeSettings = strip( UsedModeSettings)
    405405   if not fModeSettingsApplied then
    406406      call SetAVar( fid'.modesettingsapplied', 1)
     
    408408
    409409   -- Execute file-specific settings
    410    do w = 1 to words(UsedFileSettings)
     410   do w = 1 to words( UsedFileSettings)
    411411      wrd = word( UsedFileSettings, w)
    412       SettingsValue = GetAVar(fid'.'lowcase( wrd))
     412      SettingsValue = GetAVar( fid'.'lowcase( wrd))
    413413      Cmd = 'Set'wrd SettingsValue
    414414      dprintf( 'MODEEXEC', 'FILE: 'Cmd' -- '.filename)
     
    419419   -- Tracking every non-default setting in the array var 'lastusedsettings'
    420420   -- increases performance, because only those settings are changed.
    421    CurSettings = strip(UsedModeSettings' 'UsedFileSettings)
    422    LastSettings = GetAVar('lastusedsettings')
     421   CurSettings = strip( UsedModeSettings' 'UsedFileSettings)
     422   LastSettings = GetAVar( 'lastusedsettings')
    423423   --dprintf( 'lastsettings = 'LastSettings)
    424    do w = 1 to words(LastSettings)
     424   do w = 1 to words( LastSettings)
    425425      wrd = word( LastSettings, w)
    426       if wordpos( upcase(wrd), upcase(CurSettings)) = 0 then
     426      if wordpos( upcase( wrd), upcase( CurSettings)) = 0 then
    427427         Cmd = 'Set'wrd 'DEFAULT'  -- execute select setting with 'DEFAULT'
    428428         dprintf( 'MODEEXEC', 'RESET: 'Cmd' -- '.filename)
     
    462462   LoadSettingsList   = GetAVar( 'loadsettingslist')
    463463   SelectSettingsList = GetAVar( 'selectsettingslist')
    464    parse value arg(1) with Mode Cmd Args
    465    Mode = strip(Mode)
    466    Cmd  = strip(Cmd)
    467    Args = strip(Args)
    468    Mode = upcase(Mode)
     464   parse value arg( 1) with Mode Cmd Args
     465   Mode = strip( Mode)
     466   Cmd  = strip( Cmd)
     467   Args = strip( Args)
     468   Mode = upcase( Mode)
    469469
    470470   if Mode = 'CLEAR' then
    471471      -- Clear existing load_<mode> and select_<mode> hooks
    472       List = GetAVar('usedsettings_modes')
    473       do w = 1 to words(List)
     472      List = GetAVar( 'usedsettings_modes')
     473      do w = 1 to words( List)
    474474         wrd = word( List, w)
    475          'HookDelAll load_'lowcase(wrd)
    476          'HookDelAll select_'lowcase(wrd)
    477          call DelAVar('usedsettings_modes', wrd)
     475         'HookDelAll load_'lowcase( wrd)
     476         'HookDelAll select_'lowcase( wrd)
     477         call DelAVar( 'usedsettings_modes', wrd)
    478478      enddo
    479479      return 0
     
    484484   elseif Cmd = 'CLEAR' then
    485485      -- Clear existing load_<mode> and select_<mode> hooks for <mode>
    486       'HookDelAll load_'lowcase(Mode)
    487       'HookDelAll select_'lowcase(Mode)
    488       call DelAVar('usedsettings_modes', Mode)
     486      'HookDelAll load_'lowcase( Mode)
     487      'HookDelAll select_'lowcase( Mode)
     488      call DelAVar( 'usedsettings_modes', Mode)
    489489      return 0
    490490   endif
     
    501501   endif
    502502
    503    if wordpos( upcase(wrd), upcase(SelectSettingsList)) then
     503   if wordpos( upcase( wrd), upcase( SelectSettingsList)) then
    504504      -- These settings don't stick with the current file.
    505505      -- Execute them during ProcessAfterload and at/or defselect.
    506       'HookChange select_'lowcase(Mode) Cmd Args
     506      'HookChange select_'lowcase( Mode) Cmd Args
    507507      -- Save a list of used defselect settings for every mode
    508       call AddAVar('usedsettings_'lowcase(Mode), wrd)
    509    elseif wordpos( upcase(wrd), upcase(LoadSettingsList)) then
     508      call AddAVar( 'usedsettings_'lowcase( Mode), wrd)
     509   elseif wordpos( upcase( wrd), upcase( LoadSettingsList)) then
    510510      -- These settings stick with the current file and don't need additional
    511511      -- handling at defselect.
    512512      -- Execute them at defload only.
    513       'HookChange load_'lowcase(Mode) Cmd Args
     513      'HookChange load_'lowcase( Mode) Cmd Args
    514514   else
    515515      sayerror 'ModeExecute: "'Cmd Args'" is an invalid setting. Add "'wrd ||
     
    519519
    520520   if LoadState = 0 then  -- after afterload
    521       dprintf( 'MODEEXEC', 'LoadState = 'LoadState', calling RingRefreshSettings' arg(1))
     521      dprintf( 'MODEEXEC', 'LoadState = 'LoadState', calling RingRefreshSettings' arg( 1))
    522522compile if MODEEXEC_PROCESS_RING
    523       --dprintf( 'MODEEXEC', 'RingRefreshSetting 'arg(1)' for '.filename)
    524       'RingRefreshSetting' arg(1)
     523      --dprintf( 'MODEEXEC', 'RingRefreshSetting 'arg( 1)' for '.filename)
     524      'RingRefreshSetting' arg( 1)
    525525      -- Todo for SetCodingStyle:
    526526      --    o  Loop through all files only once, not once per subsetting.
     
    531531compile else
    532532      if Mode = GetMode() then
    533          --dprintf( 'MODEEXEC', arg(1)' for '.filename)
     533         --dprintf( 'MODEEXEC', arg( 1)' for '.filename)
    534534         Cmd Args
    535535      endif
     
    538538
    539539   -- Save a list of used modes to be able to delete all settings
    540    if not wordpos( Mode, GetAVar('usedsettings_modes', Mode)) then
    541       call AddAVar('usedsettings_modes', Mode)
     540   if not wordpos( Mode, GetAVar( 'usedsettings_modes', Mode)) then
     541      call AddAVar( 'usedsettings_modes', Mode)
    542542   endif
    543543
     
    557557   universal StatusFieldFlags
    558558   universal TitleFieldFlags
    559    parse value arg(1) with Mode Cmd Args
    560    Mode = upcase(Mode)
    561    parse value lowcase(Cmd) with 'set' SettingName  -- Strip leading 'set'
     559   parse value arg( 1) with Mode Cmd Args
     560   Mode = upcase( Mode)
     561   parse value lowcase( Cmd) with 'set' SettingName  -- Strip leading 'set'
    562562
    563563   getfileid startfid
     
    565565   fid = startfid
    566566   dprintf( 'RINGCMD', 'RingRefreshSetting')
    567    do f = 1 to filesinring(1)  -- prevent looping forever, hidden files must be included
     567   do f = 1 to filesinring( 1)  -- prevent looping forever, hidden files must be included
    568568      if Mode = 'DEFAULT' then
    569569         next = GetAVar( fid'.'SettingName)  -- query file setting
    570570         if next = 'DEFAULT' | next = '' then  -- unset if setting was not changed by any modeexecute
    571             Cmd 'REFRESHDEFAULT' Args  -- execute arg(1) with 'REFRESHDEFAULT' parameter prepended
     571            Cmd 'REFRESHDEFAULT' Args  -- execute arg( 1) with 'REFRESHDEFAULT' parameter prepended
    572572         endif
    573573      elseif Mode = GetMode() then
     
    594594; Use this command instead of ModeExecute after files are loaded.
    595595defc ModeExecuteRefresh, ModeExecRefresh
    596    'ModeExecute' arg(1)
    597    'RingRefreshSetting' arg(1)
     596   'ModeExecute' arg( 1)
     597   'RingRefreshSetting' arg( 1)
    598598*/
    599599
     
    602602; Add setting name to list of lastusedsettings.
    603603; This is used by several select setting defs.
    604 defproc UseSetting
    605    SettingName = arg(1)
    606    SettingValue = arg(2)
     604defproc UseFileSetting
     605   SettingName = arg( 1)
     606   SettingValue = arg( 2)
    607607   getfileid fid
    608608   if GetAVar( fid'.'lowcase( SettingName)) <> SettingValue then
    609609      call SetAVar( fid'.'lowcase( SettingName), SettingValue)
    610       if not wordpos( upcase(SettingName), upcase(GetAVar('lastusedsettings'))) then
     610      if not wordpos( upcase( SettingName), upcase( GetAVar( 'lastusedsettings'))) then
    611611         call AddAVar( 'lastusedsettings', SettingName)
    612612      endif
     
    617617; returned, separated by '|'
    618618defproc GetModeSetting
    619    Setting = arg(1)
    620    Mode    = arg(2)
     619   Setting = arg( 1)
     620   Mode    = arg( 2)
    621621
    622622   -- Strip possible prepended 'Set'
     
    675675; ---------------------------------------------------------------------------
    676676defc ShowModeSetting
    677    Val = GetModeSetting( arg(1))
    678    if arg(1) <> '' then
    679       sayerror 'Value for 'arg(1)' and current mode is: 'Val
     677   Val = GetModeSetting( arg( 1))
     678   if arg( 1) <> '' then
     679      sayerror 'Value for 'arg( 1)' and current mode is: 'Val
    680680   else
    681681      sayerror 'ModeSettings for current mode: 'Val
     
    684684; ---------------------------------------------------------------------------
    685685; List all mode- and file-specific settings for all files in the ring.
    686 defc RingDumpSettings
     686defc ShowFileSettings
    687687   LoadSettingsList   = GetAVar( 'loadsettingslist')
    688688   SelectSettingsList = GetAVar( 'selectsettingslist')
     
    697697   getfileid startfid
    698698   display -3
    699    if pfile_exists(TmpFileName) then
     699   if pfile_exists( TmpFileName) then
    700700      'xcom e /n' TmpFileName   -- activate tmp file
    701701   else
     
    706706   savedlast = .last
    707707   .autosave = 0
    708    insertline copies('-', 78), .last + 1
     708   insertline copies( '-', 78), .last + 1
    709709   insertline 'File settings - created on 'DateTime(), .last + 1
    710710   varname =  '   Defload settings             ='
    711711   line = varname
    712    do w = 1 to words(LoadSettingsList)
     712   do w = 1 to words( LoadSettingsList)
    713713      wrd = word( LoadSettingsList, w)
    714       if length(line) + length(wrd) > 77 then
     714      if length( line) + length( wrd) > 77 then
    715715         insertline line, .last + 1
    716          line = copies( ' ', length(varname)) wrd
     716         line = copies( ' ', length( varname)) wrd
    717717      else
    718718         line = line wrd
     
    724724   varname =  '   Defselect settings           ='
    725725   line = varname
    726    do w = 1 to words(SelectSettingsList)
     726   do w = 1 to words( SelectSettingsList)
    727727      wrd = word( SelectSettingsList, w)
    728       if length(line) + 1 + length(wrd) > 78 then
     728      if length( line) + 1 + length( wrd) > 78 then
    729729         insertline line, .last + 1
    730          line = copies( ' ', length(varname)) wrd
     730         line = copies( ' ', length( varname)) wrd
    731731      else
    732732         line = line wrd
     
    740740   activatefile startfid
    741741   fid = startfid
    742    dprintf( 'RINGCMD', 'RingDumpSettings')
    743    do f = 1 to filesinring(1)  -- just an upper limit
     742   dprintf( 'RINGCMD', 'ShowFileSettings')
     743   do f = 1 to filesinring( 1)  -- just an upper limit
    744744      if .visible then  -- omit hidden files
    745745         insertline .filename, tmpfid.last + 1, tmpfid
    746746         -- Add mode
    747          insertline '   'leftstr( 'mode', max( length('mode'), 22))' = 'GetMode(), tmpfid.last + 1, tmpfid
    748          do w = 1 to words(SettingsList)
     747         insertline '   'leftstr( 'mode', max( length( 'mode'), 22))' = 'GetMode(), tmpfid.last + 1, tmpfid
     748         do w = 1 to words( SettingsList)
    749749            wrd = word( SettingsList, w)
    750             SettingName = lowcase(wrd)
     750            SettingName = lowcase( wrd)
    751751            SettingValue = GetAVar( fid'.'SettingName)  -- query file setting
    752             insertline '   'leftstr( SettingName, max( length(SettingName), 22))' = 'SettingValue, tmpfid.last + 1, tmpfid
     752            insertline '   'leftstr( SettingName, max( length( SettingName), 22))' = 'SettingValue, tmpfid.last + 1, tmpfid
    753753         enddo
    754754      endif
     
    783783   getfileid fid
    784784   SettingValue = GetAVar( fid'.'SettingName)
    785    arg1 = upcase(arg(1))
     785   arg1 = upcase( arg( 1))
    786786   wp = wordpos( 'REFRESHDEFAULT', arg1)
    787787   RefreshDefault = (wp > 0)
     
    801801         refresh_on = QueryConfigKey( KeyPath)
    802802         if refresh_on then
    803             CheckFlag = GetHiliteCheckFlag(Mode)
     803            CheckFlag = GetHiliteCheckFlag( Mode)
    804804         endif
    805805      endif
     
    841841   -- fid'.modesettingsapplied' is reset to 0 by 'ResetFileSettings'
    842842   getfileid fid
    843    ModeSettingsApplied = GetAVar(fid'.modesettingsapplied')
     843   ModeSettingsApplied = GetAVar( fid'.modesettingsapplied')
    844844   SettingName  = 'margins'
    845845   InfolineName = 'MARGINS'
     
    847847   getfileid fid
    848848   SettingValue = GetAVar( fid'.'SettingName)
    849    arg1 = upcase(arg(1))
     849   arg1 = upcase( arg( 1))
    850850   wp = wordpos( 'REFRESHDEFAULT', arg1)
    851851   RefreshDefault = (wp > 0)
     
    904904   -- fid'.modesettingsapplied' is reset to 0 by 'ResetFileSettings'
    905905   getfileid fid
    906    ModeSettingsApplied = GetAVar(fid'.modesettingsapplied')
     906   ModeSettingsApplied = GetAVar( fid'.modesettingsapplied')
    907907   SettingName  = 'tabs'
    908908   InfolineName = 'TABS'
     
    910910   getfileid fid
    911911   SettingValue = GetAVar( fid'.'SettingName)
    912    arg1 = upcase(arg(1))
     912   arg1 = upcase( arg( 1))
    913913   wp = wordpos( 'REFRESHDEFAULT', arg1)
    914914   RefreshDefault = (wp > 0)
     
    961961   universal LoadState
    962962   universal activeaccel
    963    arg1 = upcase(arg(1))
     963   arg1 = upcase( arg( 1))
    964964   if arg1 = '' | arg1 = 'DEFAULT' then
    965965      on = 0
     
    975975   -- Save the value in an array var, to determine 'DEFAULT' state later
    976976   getfileid fid
    977    call SetAVar( fid'.dynaspell', arg(1))
     977   call SetAVar( fid'.dynaspell', arg( 1))
    978978   if LoadState = 0 then
    979979      'RefreshInfoline KEYS'
     
    984984   universal toolbar_loaded
    985985   universal current_toolbar
    986    arg1 = upcase(arg(1))
     986   arg1 = upcase( arg( 1))
    987987   if current_toolbar = '' then
    988988      current_toolbar = toolbar_loaded
     
    10001000         current_toolbar = 'STANDARD'
    10011001      else
    1002          'postme LoadToolbar NOSAVE' arg(1)
    1003          current_toolbar = arg(1)
     1002         'postme LoadToolbar NOSAVE' arg( 1)
     1003         current_toolbar = arg( 1)
    10041004      endif
    10051005   endif
    10061006   -- Save the value in an array var, because no field var exists
    1007    call UseSetting( 'ToolBar', arg(1))
     1007   call UseFileSetting( 'ToolBar', arg( 1))
    10081008
    10091009; ---------------------------------------------------------------------------
     
    10261026
    10271027   -- Save the value in an array var, because no field var exists
    1028    call UseSetting( 'Keyset', Keyset)
     1028   call UseFileSetting( 'Keyset', Keyset)
    10291029   'RefreshInfoLine KEYSET'
    10301030
     
    10321032defc SetExpand  -- defc expand exists
    10331033   universal expand_on
    1034    arg1 = upcase(arg(1))
     1034   arg1 = upcase( arg( 1))
    10351035   if arg1 = '' | arg1 = 'DEFAULT' then
    10361036      KeyPath = '\NEPMD\User\SyntaxExpansion'
     
    10541054   expand_on = on
    10551055   -- Save the value in an array var, because no field var exists
    1056    --call UseSetting( 'Expand', arg(1))
    1057    call UseSetting( 'Expand', ExpandMode)
     1056   --call UseFileSetting( 'Expand', arg( 1))
     1057   call UseFileSetting( 'Expand', ExpandMode)
    10581058   'RefreshInfoLine EXPAND'
    10591059
     
    10611061defc SetIndent
    10621062   universal indent
    1063    arg1 = upcase(arg(1))
     1063   arg1 = upcase( arg( 1))
    10641064   if arg1 = '' | arg1 = 'DEFAULT' then
    10651065      new = word( .tabs, 1)
    10661066   else
    1067       new = arg(1)
     1067      new = arg( 1)
    10681068   endif
    10691069   -- Set universal var
    10701070   indent = new
    10711071   -- Save the value in an array var, because no field var exists
    1072    call UseSetting( 'Indent', arg(1))
     1072   call UseFileSetting( 'Indent', arg( 1))
    10731073
    10741074; ---------------------------------------------------------------------------
    10751075defc SetMatchTab  -- defc matchtab exists
    10761076   universal matchtab_on
    1077    arg1 = upcase(arg(1))
     1077   arg1 = upcase( arg( 1))
    10781078   if arg1 = '' | arg1 = 'DEFAULT' then
    10791079      KeyPath = '\NEPMD\User\SpecialKeys\Tab\MatchWordsAbove'
     
    10871087   matchtab_on = on
    10881088   -- Save the value in an array var, because no field var exists
    1089    call UseSetting( 'MatchTab', arg(1))
     1089   call UseFileSetting( 'MatchTab', arg( 1))
    10901090   'RefreshInfoLine MATCHTAB'
    10911091
    10921092; ---------------------------------------------------------------------------
    1093 ;    doesn't work  (because just executed at defload, not at edit)
    1094 ; Must be executed at defmain, before executing doscommand.
     1093; This doesn't work (because executed at defload, not at edit).
     1094; It must be executed at defmain to work, before executing 'e' EpmArgs.
    10951095; Problem: Mode is not determined at this time. That will be done at
    10961096; defload, to assure that a fileid exists. It's required for the
    10971097; array var, used to save the mode of the current file.
     1098/*
    10981099defc SetEditOptions
    10991100   universal default_edit_options
    1100    arg1 = upcase(arg(1))
     1101   arg1 = upcase( arg( 1))
    11011102   if arg1 = '' | arg1 = 'DEFAULT' then
    11021103      KeyPath = '\NEPMD\User\Edit\DefaultOptions'
    11031104      new = QueryConfigKey( KeyPath)
    11041105   else
    1105       new = arg(1)
     1106      new = arg( 1)
    11061107   endif
    11071108   -- Set universal var
    11081109   default_edit_options = new
    11091110   -- Save the value in an array var, because no field var exists
    1110    call UseSetting( 'EditOptions', arg(1))
    1111 
     1111   call UseFileSetting( 'EditOptions', arg( 1))
     1112*/
    11121113; ---------------------------------------------------------------------------
    11131114defc SetSaveOptions
    11141115   universal default_save_options
    1115    arg1 = upcase(arg(1))
     1116   arg1 = upcase( arg( 1))
    11161117   if arg1 = '' | arg1 = 'DEFAULT' then
    11171118      KeyPath = '\NEPMD\User\Save\DefaultOptions'
    11181119      new = QueryConfigKey( KeyPath)
    11191120   else
    1120       new = arg(1)
     1121      new = arg( 1)
    11211122   endif
    11221123   -- Set universal var
    11231124   default_save_options = new
    11241125   -- Save the value in an array var, because no field var exists
    1125    call UseSetting( 'SaveOptions', arg(1))
     1126   call UseFileSetting( 'SaveOptions', arg( 1))
    11261127
    11271128; ---------------------------------------------------------------------------
    11281129defc SetSearchOptions
    11291130   universal default_search_options
    1130    arg1 = upcase(arg(1))
     1131   arg1 = upcase( arg( 1))
    11311132   if arg1 = '' | arg1 = 'DEFAULT' then
    11321133      KeyPath = '\NEPMD\User\Search\DefaultOptions'
    11331134      new = QueryConfigKey( KeyPath)
    11341135   else
    1135       new = arg(1)
     1136      new = arg( 1)
    11361137   endif
    11371138   -- Set universal var
    11381139   default_search_options = new
    11391140   -- Save the value in an array var, because no field var exists
    1140    call UseSetting( 'SearchOptions', arg(1))
     1141   call UseFileSetting( 'SearchOptions', arg( 1))
    11411142
    11421143; ---------------------------------------------------------------------------
     
    11441145   universal stream_mode
    11451146   universal default_stream_mode
    1146    arg1 = upcase(arg(1))
     1147   arg1 = upcase( arg( 1))
    11471148   if arg1 = '' | arg1 = 'DEFAULT' then
    11481149      on = default_stream_mode
     
    11561157   'togglecontrol 24' stream_mode
    11571158   -- Save the value in an array var, because no field var exists
    1158    call UseSetting( 'StreamMode', arg(1))
     1159   call UseFileSetting( 'StreamMode', arg( 1))
    11591160   'RefreshInfoLine STREAMMODE'
    11601161
    11611162; ---------------------------------------------------------------------------
    11621163defc SetInsertMode
    1163    arg1 = upcase(arg(1))
     1164   arg1 = upcase( arg( 1))
    11641165   if arg1 = '' | arg1 = 'DEFAULT' then
    11651166      on = 1
     
    11751176   endif
    11761177   -- Save the value in an array var, because no field var exists
    1177    call UseSetting( 'InsertMode', arg(1))
     1178   call UseFileSetting( 'InsertMode', arg( 1))
    11781179   -- Update of infoline field is handled internally
    11791180
     
    11841185defc SetTextFont
    11851186   universal lastfont
    1186    arg1 = upcase(arg(1))
     1187   arg1 = upcase( arg( 1))
    11871188   if arg1 = '' | arg1 = 'DEFAULT' then
    11881189      --new = queryprofile( app_hini, appname, 'FONT')
     
    11931194      new = QueryConfigKey( KeyPath)
    11941195   else
    1195       new = arg(1)
     1196      new = arg( 1)
    11961197      parse value new with size '.' rest
    11971198      if not isnum( size) then
     
    12001201      endif
    12011202      if rest = '' then
    1202          parse value queryfont(.font) with fontname '.' fontsize '.' fontsel
     1203         parse value queryfont( .font) with fontname '.' fontsize '.' fontsel
    12031204         new = size'.'fontname
    12041205         if fontsel > 0 then
     
    12121213                      -- and execute simply: .font = <font_id>. Therefore the
    12131214                      -- font_id would have been saved, after it was registered:
    1214                       -- .font = registerfont(fontname, fontsize, fontsel)
     1215                      -- .font = registerfont( fontname, fontsize, fontsel)
    12151216      new = ConvertToEFont( new)
    12161217      'processfontrequest' new
     
    12181219   endif
    12191220   -- Save the value in an array var, because no field var exists
    1220    call UseSetting( 'TextFont', arg(1))
     1221   call UseFileSetting( 'TextFont', arg( 1))
    12211222
    12221223; ---------------------------------------------------------------------------
    12231224defc SetTextColor
    1224    arg1 = upcase(arg(1))
     1225   arg1 = upcase( arg( 1))
    12251226   if arg1 = '' | arg1 = 'DEFAULT' then
    12261227      KeyPath = '\NEPMD\User\Colors\Text'
    12271228      new = ColorNameToNum( QueryConfigKey( KeyPath))
    12281229   else
    1229       new = ColorNameToNum( arg(1))
     1230      new = ColorNameToNum( arg( 1))
    12301231      if rc <> 0 then
    12311232         return rc
     
    12381239   endif
    12391240   -- Save the value in an array var, to determine 'DEFAULT' state later
    1240    call UseSetting( 'TextColor', arg(1))
     1241   call UseFileSetting( 'TextColor', arg( 1))
    12411242
    12421243; ---------------------------------------------------------------------------
    12431244defc SetMarkColor
    1244    arg1 = upcase(arg(1))
     1245   arg1 = upcase( arg( 1))
    12451246   if arg1 = '' | arg1 = 'DEFAULT' then
    12461247      KeyPath = '\NEPMD\User\Colors\Mark'
    12471248      new = ColorNameToNum( QueryConfigKey( KeyPath))
    12481249   else
    1249       new = ColorNameToNum( arg(1))
     1250      new = ColorNameToNum( arg( 1))
    12501251      if rc <> 0 then
    12511252         return
     
    12581259   endif
    12591260   -- Save the value in an array var, to determine 'DEFAULT' state later
    1260    call UseSetting( 'MarkColor', arg(1))
     1261   call UseFileSetting( 'MarkColor', arg( 1))
    12611262
    12621263; ---------------------------------------------------------------------------
     
    12771278   universal default_header_style
    12781279   ValidArgs = '1 2'
    1279    arg1 = strip( upcase( arg(1)))
     1280   arg1 = strip( upcase( arg( 1)))
    12801281   parse value arg1 with next rest
    12811282   if next = 'DEFINEDEFAULT' then
     
    12931294      header_style = arg1
    12941295      -- Save the value in an array var, because no field var exists
    1295       call UseSetting( 'HeaderStyle', arg(1))
     1296      call UseFileSetting( 'HeaderStyle', arg( 1))
    12961297   endif
    12971298
     
    13131314      header_width = arg1
    13141315      -- Save the value in an array var, because no field var exists
    1315       call UseSetting( 'HeaderWidth', arg( 1))
     1316      call UseFileSetting( 'HeaderWidth', arg( 1))
    13161317   endif
    13171318
     
    13231324   universal default_END_commented
    13241325   ValidArgs = '0 1'
    1325    arg1 = strip( upcase( arg(1)))
     1326   arg1 = strip( upcase( arg( 1)))
    13261327   parse value arg1 with next rest
    13271328   if next = 'DEFINEDEFAULT' then
     
    13391340      END_commented = arg1
    13401341      -- Save the value in an array var, because no field var exists
    1341       call UseSetting( 'EndCommented', arg(1))
     1342      call UseFileSetting( 'EndCommented', arg( 1))
    13421343   endif
    13431344
     
    13521353   universal match_chars
    13531354   universal default_match_chars
    1354    arg1 = strip( upcase( arg(1)))
     1355   arg1 = strip( upcase( arg( 1)))
    13551356   parse value arg1 with next rest
    13561357   if next = 'DEFINEDEFAULT' then
     
    13681369      match_chars = arg1
    13691370      -- Save the value in an array var, because no field var exists
    1370       call UseSetting( 'MatchChars', arg(1))
     1371      call UseFileSetting( 'MatchChars', arg( 1))
    13711372   endif
    13721373
     
    13781379   universal default_comment_auto_terminate
    13791380   ValidArgs = '0 1'
    1380    arg1 = strip( upcase( arg(1)))
     1381   arg1 = strip( upcase( arg( 1)))
    13811382   parse value arg1 with next rest
    13821383   if next = 'DEFINEDEFAULT' then
     
    13941395      comment_auto_terminate = arg1
    13951396      -- Save the value in an array var, because no field var exists
    1396       call UseSetting( 'CommentAutoTerminate', arg(1))
     1397      call UseFileSetting( 'CommentAutoTerminate', arg( 1))
    13971398   endif
    13981399
     
    14041405   universal default_function_spacing
    14051406   ValidArgs = 'NSCE'  -- No spaces, space at Start/Comma/End of parameter list
    1406    arg1 = strip( upcase( arg(1)))
     1407   arg1 = strip( upcase( arg( 1)))
    14071408   parse value arg1 with next rest
    14081409   if next = 'DEFINEDEFAULT' then
     
    14341435      endif
    14351436      -- Save the value in an array var, because no field var exists
    1436       call UseSetting( 'FunctionSpacing', function_spacing)
     1437      call UseFileSetting( 'FunctionSpacing', function_spacing)
    14371438   endif
    14381439
     
    14441445   universal default_closing_brace_auto_indent
    14451446   ValidArgs = '0 1'
    1446    arg1 = strip( upcase( arg(1)))
     1447   arg1 = strip( upcase( arg( 1)))
    14471448   parse value arg1 with next rest
    14481449   if next = 'DEFINEDEFAULT' then
     
    14601461      closing_brace_auto_indent = arg1
    14611462      -- Save the value in an array var, because no field var exists
    1462       call UseSetting( 'ClosingBraceAutoIndent', arg(1))
     1463      call UseFileSetting( 'ClosingBraceAutoIndent', arg( 1))
    14631464   endif
    14641465
     
    15051506; a ModeExecute command, it is resolved directly by ModeExecute.
    15061507defc SetCodingStyle
    1507    call ExecuteCodingStyle( 0, arg(1))
     1508   call ExecuteCodingStyle( 0, arg( 1))
    15081509   if isadefproc( 'MenuText_selectcodingstyle') then
    15091510      MenuText_selectcodingstyle()
     
    15211522defproc ExecuteCodingStyle
    15221523   universal LoadState
    1523    Mode = arg(1)
    1524    Name = arg(2)
     1524   Mode = arg( 1)
     1525   Name = arg( 2)
    15251526   Name = lowcase( Name)
    15261527   if Name = 'off' then
     
    15851586   None = '-none-'
    15861587
    1587    Mode = arg(1)
     1588   Mode = arg( 1)
    15881589   if Mode = '' then
    15891590      Mode = GetMode()
     
    16411642                     '/~Set/Edit ~PROFILE.ERX/~Edit MODECFG.E/'CANCEL__MSG,           -- buttons
    16421643                     0, 0,  --5, 5,                       -- top, left,
    1643                      Min( words(CodingStyles), 15), 100,  -- height, width
     1644                     Min( words( CodingStyles), 15), 100,  -- height, width
    16441645                     GethWndC( APP_HANDLE) || atoi( DefaultItem) ||
    16451646                     atoi( DefaultButton) || atoi( HelpId) ||
     
    16491650   -- Check result
    16501651   Button = asc( leftstr( Result, 1))
    1651    EOS = pos( \0, Result, 2)        -- CHR(0) signifies End Of String
     1652   EOS = pos( \0, Result, 2)        -- CHR( 0) signifies End Of String
    16521653
    16531654   NewCodingStyle = substr( Result, 2, EOS - 2)
     
    17291730         .col = 1
    17301731         fDeleted = 0
    1731          Line = strip( translate( textline(l), ' ', \9))
     1732         Line = strip( translate( textline( l), ' ', \9))
    17321733
    17331734         -- Ignore comments in Line or when already in comment
     
    17651766            -- (Surrounding quotes or doublequotes are omitted here just for simpleness.)
    17661767            Search = '(MODEEXEC|MODEEXECUTE):w'Mode':wSETCODINGSTYLE'
    1767             p = pos( Search, upcase(Line), 1, 'x')  -- using the egrep option for pos
     1768            p = pos( Search, upcase( Line), 1, 'x')  -- using the egrep option for pos
    17681769            if p > 0 then
    17691770               deleteline l
Note: See TracChangeset for help on using the changeset viewer.