Changeset 3661
- Timestamp:
- Oct 8, 2019, 10:11:05 PM (5 years ago)
- Location:
- trunk/src/netlabs/macros
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/netlabs/macros/epm_ea.e ¶
r3460 r3661 108 108 call Find_Ea( "\1\2\4\3\5", xx_seg, xx_ofs, xx_ptr1, xx_ptr2, xx_len, xx_entrylen, xx_valuelen) 109 109 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) 111 111 endif 112 112 … … 228 228 answer = WinMessageBox( SUBJ_TITLE__MSG, NON_ASCII_SUBJECT__MSG\1''CHANGE_QUERY__MSG, 16388) -- YESNO + MOVEABLE 229 229 endif 230 else -- arg( 1) not null230 else -- arg( 1) not null 231 231 answer = 6 232 232 endif 233 233 if answer = 6 then 234 234 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, 236 236 260, 237 atoi( 1)''atoi( 6050)''GethWndC( APP_HANDLE)''SELECT_SUBJECT__MSG) with button 2 newsubj \0237 atoi( 1)''atoi( 6050)''GethWndC( APP_HANDLE)''SELECT_SUBJECT__MSG) with button 2 newsubj \0 238 238 else 239 239 newsubj = arg( 1) -
TabularUnified trunk/src/netlabs/macros/modecfg.e ¶
r3534 r3661 313 313 SetToolbar <toolbar_name> (must be defined in NEPMD.INI) 314 314 SetDynaspell 0 | 1 315 SetEditOptions see description of EDIT command315 /* SetEditOptions see description of EDIT command (can't work) */ 316 316 SetSaveOptions see description of SAVE command 317 317 SetSearchOptions see description of LOCATE and REPLACE commands … … 461 461 'ModeExecute TEXT SetStreamMode 0' 462 462 463 /*'ModeExecute BIN SetEditOptions /t /64 /bin'*/464 463 'ModeExecute BIN SetSaveOptions /ne /ns /nt' 465 464 'ModeExecute BIN SetTabs 1' -
TabularUnified trunk/src/netlabs/macros/modeexec.e ¶
r3660 r3661 63 63 ; SetToolbar <toolbar_name> (must be defined in NEPMD.INI) 64 64 ; SetDynaspell 0 | 1 65 ; SetEditOptions see description of EDIT command65 ; /* SetEditOptions see description of EDIT command (can't work) */ 66 66 ; SetSaveOptions see description of SAVE command 67 67 ; SetSearchOptions see description of LOCATE and REPLACE commands … … 154 154 ; --------------------------------------------------------------------------- 155 155 156 compile if not defined( SMALL) -- If SMALL not defined, then being separately compiled156 compile if not defined( SMALL) -- If SMALL not defined, then being separately compiled 157 157 EA_comment 'This defines mode-specific commands.' 158 158 … … 199 199 call AddAVar( 'selectsettingslist', 200 200 'Toolbar Keyset Expand Matchtab' || 201 ' EditOptionsSaveOptions SearchOptions' ||201 /* EditOptions*/' SaveOptions SearchOptions' || 202 202 ' StreamMode InsertMode' || 203 203 ' TextFont TextColor MarkColor Indent' || … … 213 213 ; --------------------------------------------------------------------------- 214 214 defc ResetFileSettings 215 args = arg( 1)215 args = arg( 1) 216 216 217 217 fProcessLoad = 0 … … 238 238 getfileid fid 239 239 SettingsList = LoadSettingsList SelectSettingsList 240 do w = 1 to words( SettingsList)240 do w = 1 to words( SettingsList) 241 241 wrd = word( SettingsList, w) 242 call SetAVar( fid'.'lowcase( wrd), '')242 call SetAVar( fid'.'lowcase( wrd), '') 243 243 enddo 244 244 call SetAVar( fid'.modesettingsapplied', 0) … … 263 263 -- 2: defload processed 264 264 -- 0: afterload processed 265 args = arg( 1)265 args = arg( 1) 266 266 dprintf( 'LOAD', 'ProcessLoadSettings entered for 'args) 267 267 … … 272 272 273 273 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) 276 276 277 277 if Mode = '' then … … 284 284 if refresh_on then 285 285 if LoadState then -- during file loading 286 CheckFlag = GetHiliteCheckFlag( Mode)286 CheckFlag = GetHiliteCheckFlag( Mode) 287 287 else 288 288 CheckFlag = '' … … 296 296 297 297 getfileid fid 298 if isnum( calling_fid) then298 if isnum( calling_fid) then 299 299 if calling_fid <> fid then 300 300 --dprintf( 'No load settings processed. File not on top anymore:' || … … 307 307 -- so slow, that file to be processed is not on top anymore. 308 308 prefix = 'hook.' 309 HookName = 'load_'lowcase( Mode)309 HookName = 'load_'lowcase( Mode) 310 310 imax = GetAVar( prefix''HookName'.0') 311 311 if imax = '' then … … 335 335 do w = 1 to words( List) -- Only LoadSettings need to be reset for default mode 336 336 wrd = word( List, w) 337 next = GetAVar( fid'.'lowcase( wrd)) -- get file setting337 next = GetAVar( fid'.'lowcase( wrd)) -- get file setting 338 338 if next = '' | next = 'DEFAULT' then 339 339 'Set'wrd 'DEFAULT' -- execute load setting with 'DEFAULT' … … 355 355 return 356 356 endif 357 SelectSettingsList = GetAVar( 'selectsettingslist')357 SelectSettingsList = GetAVar( 'selectsettingslist') 358 358 359 359 -- Get file-specific setting names … … 362 362 UsedFileSettings = '' 363 363 -- 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') 365 365 if fModeSettingsApplied then 366 do w = 1 to words( SelectSettingsList)366 do w = 1 to words( SelectSettingsList) 367 367 wrd = word( SelectSettingsList, w) 368 368 wrd = lowcase( wrd) 369 SettingsValue = GetAVar( fid'.'wrd)369 SettingsValue = GetAVar( fid'.'wrd) 370 370 if wrd = 'keyset' & SettingsValue = 'std' then 371 371 SettingsValue = 'DEFAULT' … … 375 375 endif 376 376 enddo 377 UsedFileSettings = strip( UsedFileSettings)377 UsedFileSettings = strip( UsedFileSettings) 378 378 endif 379 379 --dprintf( 'UsedFileSettings = 'UsedFileSettings) … … 384 384 Mode = GetMode() 385 385 prefix = 'hook.' 386 HookName = 'select_'lowcase( Mode)387 imax = GetAVar( prefix''HookName'.0')386 HookName = 'select_'lowcase( Mode) 387 imax = GetAVar( prefix''HookName'.0') 388 388 if imax = '' then 389 389 imax = 0 … … 391 391 UsedModeSettings = '' 392 392 do i = 1 to imax 393 Cmd = GetAVar( prefix''HookName'.'i)393 Cmd = GetAVar( prefix''HookName'.'i) 394 394 parse value Cmd with wrd SettingsValue 395 if leftstr( upcase( wrd), 3) = 'SET' then395 if leftstr( upcase( wrd), 3) = 'SET' then 396 396 wrd = substr( wrd, 4) -- strip 'Set' 397 397 endif 398 if not wordpos( upcase( wrd), upcase(UsedFileSettings)) then398 if not wordpos( upcase( wrd), upcase( UsedFileSettings)) then 399 399 dprintf( 'MODEEXEC', 'MODE: 'Cmd' -- '.filename) 400 400 Cmd -- execute command … … 402 402 endif 403 403 enddo 404 UsedModeSettings = strip( UsedModeSettings)404 UsedModeSettings = strip( UsedModeSettings) 405 405 if not fModeSettingsApplied then 406 406 call SetAVar( fid'.modesettingsapplied', 1) … … 408 408 409 409 -- Execute file-specific settings 410 do w = 1 to words( UsedFileSettings)410 do w = 1 to words( UsedFileSettings) 411 411 wrd = word( UsedFileSettings, w) 412 SettingsValue = GetAVar( fid'.'lowcase( wrd))412 SettingsValue = GetAVar( fid'.'lowcase( wrd)) 413 413 Cmd = 'Set'wrd SettingsValue 414 414 dprintf( 'MODEEXEC', 'FILE: 'Cmd' -- '.filename) … … 419 419 -- Tracking every non-default setting in the array var 'lastusedsettings' 420 420 -- 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') 423 423 --dprintf( 'lastsettings = 'LastSettings) 424 do w = 1 to words( LastSettings)424 do w = 1 to words( LastSettings) 425 425 wrd = word( LastSettings, w) 426 if wordpos( upcase( wrd), upcase(CurSettings)) = 0 then426 if wordpos( upcase( wrd), upcase( CurSettings)) = 0 then 427 427 Cmd = 'Set'wrd 'DEFAULT' -- execute select setting with 'DEFAULT' 428 428 dprintf( 'MODEEXEC', 'RESET: 'Cmd' -- '.filename) … … 462 462 LoadSettingsList = GetAVar( 'loadsettingslist') 463 463 SelectSettingsList = GetAVar( 'selectsettingslist') 464 parse value arg( 1) with Mode Cmd Args465 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) 469 469 470 470 if Mode = 'CLEAR' then 471 471 -- 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) 474 474 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) 478 478 enddo 479 479 return 0 … … 484 484 elseif Cmd = 'CLEAR' then 485 485 -- 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) 489 489 return 0 490 490 endif … … 501 501 endif 502 502 503 if wordpos( upcase( wrd), upcase(SelectSettingsList)) then503 if wordpos( upcase( wrd), upcase( SelectSettingsList)) then 504 504 -- These settings don't stick with the current file. 505 505 -- Execute them during ProcessAfterload and at/or defselect. 506 'HookChange select_'lowcase( Mode) Cmd Args506 'HookChange select_'lowcase( Mode) Cmd Args 507 507 -- Save a list of used defselect settings for every mode 508 call AddAVar( 'usedsettings_'lowcase(Mode), wrd)509 elseif wordpos( upcase( wrd), upcase(LoadSettingsList)) then508 call AddAVar( 'usedsettings_'lowcase( Mode), wrd) 509 elseif wordpos( upcase( wrd), upcase( LoadSettingsList)) then 510 510 -- These settings stick with the current file and don't need additional 511 511 -- handling at defselect. 512 512 -- Execute them at defload only. 513 'HookChange load_'lowcase( Mode) Cmd Args513 'HookChange load_'lowcase( Mode) Cmd Args 514 514 else 515 515 sayerror 'ModeExecute: "'Cmd Args'" is an invalid setting. Add "'wrd || … … 519 519 520 520 if LoadState = 0 then -- after afterload 521 dprintf( 'MODEEXEC', 'LoadState = 'LoadState', calling RingRefreshSettings' arg( 1))521 dprintf( 'MODEEXEC', 'LoadState = 'LoadState', calling RingRefreshSettings' arg( 1)) 522 522 compile 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) 525 525 -- Todo for SetCodingStyle: 526 526 -- o Loop through all files only once, not once per subsetting. … … 531 531 compile else 532 532 if Mode = GetMode() then 533 --dprintf( 'MODEEXEC', arg( 1)' for '.filename)533 --dprintf( 'MODEEXEC', arg( 1)' for '.filename) 534 534 Cmd Args 535 535 endif … … 538 538 539 539 -- Save a list of used modes to be able to delete all settings 540 if not wordpos( Mode, GetAVar( 'usedsettings_modes', Mode)) then541 call AddAVar( 'usedsettings_modes', Mode)540 if not wordpos( Mode, GetAVar( 'usedsettings_modes', Mode)) then 541 call AddAVar( 'usedsettings_modes', Mode) 542 542 endif 543 543 … … 557 557 universal StatusFieldFlags 558 558 universal TitleFieldFlags 559 parse value arg( 1) with Mode Cmd Args560 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' 562 562 563 563 getfileid startfid … … 565 565 fid = startfid 566 566 dprintf( 'RINGCMD', 'RingRefreshSetting') 567 do f = 1 to filesinring( 1) -- prevent looping forever, hidden files must be included567 do f = 1 to filesinring( 1) -- prevent looping forever, hidden files must be included 568 568 if Mode = 'DEFAULT' then 569 569 next = GetAVar( fid'.'SettingName) -- query file setting 570 570 if next = 'DEFAULT' | next = '' then -- unset if setting was not changed by any modeexecute 571 Cmd 'REFRESHDEFAULT' Args -- execute arg( 1) with 'REFRESHDEFAULT' parameter prepended571 Cmd 'REFRESHDEFAULT' Args -- execute arg( 1) with 'REFRESHDEFAULT' parameter prepended 572 572 endif 573 573 elseif Mode = GetMode() then … … 594 594 ; Use this command instead of ModeExecute after files are loaded. 595 595 defc ModeExecuteRefresh, ModeExecRefresh 596 'ModeExecute' arg( 1)597 'RingRefreshSetting' arg( 1)596 'ModeExecute' arg( 1) 597 'RingRefreshSetting' arg( 1) 598 598 */ 599 599 … … 602 602 ; Add setting name to list of lastusedsettings. 603 603 ; This is used by several select setting defs. 604 defproc Use Setting605 SettingName = arg( 1)606 SettingValue = arg( 2)604 defproc UseFileSetting 605 SettingName = arg( 1) 606 SettingValue = arg( 2) 607 607 getfileid fid 608 608 if GetAVar( fid'.'lowcase( SettingName)) <> SettingValue then 609 609 call SetAVar( fid'.'lowcase( SettingName), SettingValue) 610 if not wordpos( upcase( SettingName), upcase(GetAVar('lastusedsettings'))) then610 if not wordpos( upcase( SettingName), upcase( GetAVar( 'lastusedsettings'))) then 611 611 call AddAVar( 'lastusedsettings', SettingName) 612 612 endif … … 617 617 ; returned, separated by '|' 618 618 defproc GetModeSetting 619 Setting = arg( 1)620 Mode = arg( 2)619 Setting = arg( 1) 620 Mode = arg( 2) 621 621 622 622 -- Strip possible prepended 'Set' … … 675 675 ; --------------------------------------------------------------------------- 676 676 defc ShowModeSetting 677 Val = GetModeSetting( arg( 1))678 if arg( 1) <> '' then679 sayerror 'Value for 'arg( 1)' and current mode is: 'Val677 Val = GetModeSetting( arg( 1)) 678 if arg( 1) <> '' then 679 sayerror 'Value for 'arg( 1)' and current mode is: 'Val 680 680 else 681 681 sayerror 'ModeSettings for current mode: 'Val … … 684 684 ; --------------------------------------------------------------------------- 685 685 ; List all mode- and file-specific settings for all files in the ring. 686 defc RingDumpSettings686 defc ShowFileSettings 687 687 LoadSettingsList = GetAVar( 'loadsettingslist') 688 688 SelectSettingsList = GetAVar( 'selectsettingslist') … … 697 697 getfileid startfid 698 698 display -3 699 if pfile_exists( TmpFileName) then699 if pfile_exists( TmpFileName) then 700 700 'xcom e /n' TmpFileName -- activate tmp file 701 701 else … … 706 706 savedlast = .last 707 707 .autosave = 0 708 insertline copies( '-', 78), .last + 1708 insertline copies( '-', 78), .last + 1 709 709 insertline 'File settings - created on 'DateTime(), .last + 1 710 710 varname = ' Defload settings =' 711 711 line = varname 712 do w = 1 to words( LoadSettingsList)712 do w = 1 to words( LoadSettingsList) 713 713 wrd = word( LoadSettingsList, w) 714 if length( line) + length(wrd) > 77 then714 if length( line) + length( wrd) > 77 then 715 715 insertline line, .last + 1 716 line = copies( ' ', length( varname)) wrd716 line = copies( ' ', length( varname)) wrd 717 717 else 718 718 line = line wrd … … 724 724 varname = ' Defselect settings =' 725 725 line = varname 726 do w = 1 to words( SelectSettingsList)726 do w = 1 to words( SelectSettingsList) 727 727 wrd = word( SelectSettingsList, w) 728 if length( line) + 1 + length(wrd) > 78 then728 if length( line) + 1 + length( wrd) > 78 then 729 729 insertline line, .last + 1 730 line = copies( ' ', length( varname)) wrd730 line = copies( ' ', length( varname)) wrd 731 731 else 732 732 line = line wrd … … 740 740 activatefile startfid 741 741 fid = startfid 742 dprintf( 'RINGCMD', ' RingDumpSettings')743 do f = 1 to filesinring( 1) -- just an upper limit742 dprintf( 'RINGCMD', 'ShowFileSettings') 743 do f = 1 to filesinring( 1) -- just an upper limit 744 744 if .visible then -- omit hidden files 745 745 insertline .filename, tmpfid.last + 1, tmpfid 746 746 -- Add mode 747 insertline ' 'leftstr( 'mode', max( length( 'mode'), 22))' = 'GetMode(), tmpfid.last + 1, tmpfid748 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) 749 749 wrd = word( SettingsList, w) 750 SettingName = lowcase( wrd)750 SettingName = lowcase( wrd) 751 751 SettingValue = GetAVar( fid'.'SettingName) -- query file setting 752 insertline ' 'leftstr( SettingName, max( length( SettingName), 22))' = 'SettingValue, tmpfid.last + 1, tmpfid752 insertline ' 'leftstr( SettingName, max( length( SettingName), 22))' = 'SettingValue, tmpfid.last + 1, tmpfid 753 753 enddo 754 754 endif … … 783 783 getfileid fid 784 784 SettingValue = GetAVar( fid'.'SettingName) 785 arg1 = upcase( arg(1))785 arg1 = upcase( arg( 1)) 786 786 wp = wordpos( 'REFRESHDEFAULT', arg1) 787 787 RefreshDefault = (wp > 0) … … 801 801 refresh_on = QueryConfigKey( KeyPath) 802 802 if refresh_on then 803 CheckFlag = GetHiliteCheckFlag( Mode)803 CheckFlag = GetHiliteCheckFlag( Mode) 804 804 endif 805 805 endif … … 841 841 -- fid'.modesettingsapplied' is reset to 0 by 'ResetFileSettings' 842 842 getfileid fid 843 ModeSettingsApplied = GetAVar( fid'.modesettingsapplied')843 ModeSettingsApplied = GetAVar( fid'.modesettingsapplied') 844 844 SettingName = 'margins' 845 845 InfolineName = 'MARGINS' … … 847 847 getfileid fid 848 848 SettingValue = GetAVar( fid'.'SettingName) 849 arg1 = upcase( arg(1))849 arg1 = upcase( arg( 1)) 850 850 wp = wordpos( 'REFRESHDEFAULT', arg1) 851 851 RefreshDefault = (wp > 0) … … 904 904 -- fid'.modesettingsapplied' is reset to 0 by 'ResetFileSettings' 905 905 getfileid fid 906 ModeSettingsApplied = GetAVar( fid'.modesettingsapplied')906 ModeSettingsApplied = GetAVar( fid'.modesettingsapplied') 907 907 SettingName = 'tabs' 908 908 InfolineName = 'TABS' … … 910 910 getfileid fid 911 911 SettingValue = GetAVar( fid'.'SettingName) 912 arg1 = upcase( arg(1))912 arg1 = upcase( arg( 1)) 913 913 wp = wordpos( 'REFRESHDEFAULT', arg1) 914 914 RefreshDefault = (wp > 0) … … 961 961 universal LoadState 962 962 universal activeaccel 963 arg1 = upcase( arg(1))963 arg1 = upcase( arg( 1)) 964 964 if arg1 = '' | arg1 = 'DEFAULT' then 965 965 on = 0 … … 975 975 -- Save the value in an array var, to determine 'DEFAULT' state later 976 976 getfileid fid 977 call SetAVar( fid'.dynaspell', arg( 1))977 call SetAVar( fid'.dynaspell', arg( 1)) 978 978 if LoadState = 0 then 979 979 'RefreshInfoline KEYS' … … 984 984 universal toolbar_loaded 985 985 universal current_toolbar 986 arg1 = upcase( arg(1))986 arg1 = upcase( arg( 1)) 987 987 if current_toolbar = '' then 988 988 current_toolbar = toolbar_loaded … … 1000 1000 current_toolbar = 'STANDARD' 1001 1001 else 1002 'postme LoadToolbar NOSAVE' arg( 1)1003 current_toolbar = arg( 1)1002 'postme LoadToolbar NOSAVE' arg( 1) 1003 current_toolbar = arg( 1) 1004 1004 endif 1005 1005 endif 1006 1006 -- Save the value in an array var, because no field var exists 1007 call Use Setting( 'ToolBar', arg(1))1007 call UseFileSetting( 'ToolBar', arg( 1)) 1008 1008 1009 1009 ; --------------------------------------------------------------------------- … … 1026 1026 1027 1027 -- Save the value in an array var, because no field var exists 1028 call Use Setting( 'Keyset', Keyset)1028 call UseFileSetting( 'Keyset', Keyset) 1029 1029 'RefreshInfoLine KEYSET' 1030 1030 … … 1032 1032 defc SetExpand -- defc expand exists 1033 1033 universal expand_on 1034 arg1 = upcase( arg(1))1034 arg1 = upcase( arg( 1)) 1035 1035 if arg1 = '' | arg1 = 'DEFAULT' then 1036 1036 KeyPath = '\NEPMD\User\SyntaxExpansion' … … 1054 1054 expand_on = on 1055 1055 -- Save the value in an array var, because no field var exists 1056 --call Use Setting( 'Expand', arg(1))1057 call Use Setting( 'Expand', ExpandMode)1056 --call UseFileSetting( 'Expand', arg( 1)) 1057 call UseFileSetting( 'Expand', ExpandMode) 1058 1058 'RefreshInfoLine EXPAND' 1059 1059 … … 1061 1061 defc SetIndent 1062 1062 universal indent 1063 arg1 = upcase( arg(1))1063 arg1 = upcase( arg( 1)) 1064 1064 if arg1 = '' | arg1 = 'DEFAULT' then 1065 1065 new = word( .tabs, 1) 1066 1066 else 1067 new = arg( 1)1067 new = arg( 1) 1068 1068 endif 1069 1069 -- Set universal var 1070 1070 indent = new 1071 1071 -- Save the value in an array var, because no field var exists 1072 call Use Setting( 'Indent', arg(1))1072 call UseFileSetting( 'Indent', arg( 1)) 1073 1073 1074 1074 ; --------------------------------------------------------------------------- 1075 1075 defc SetMatchTab -- defc matchtab exists 1076 1076 universal matchtab_on 1077 arg1 = upcase( arg(1))1077 arg1 = upcase( arg( 1)) 1078 1078 if arg1 = '' | arg1 = 'DEFAULT' then 1079 1079 KeyPath = '\NEPMD\User\SpecialKeys\Tab\MatchWordsAbove' … … 1087 1087 matchtab_on = on 1088 1088 -- Save the value in an array var, because no field var exists 1089 call Use Setting( 'MatchTab', arg(1))1089 call UseFileSetting( 'MatchTab', arg( 1)) 1090 1090 'RefreshInfoLine MATCHTAB' 1091 1091 1092 1092 ; --------------------------------------------------------------------------- 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. 1095 1095 ; Problem: Mode is not determined at this time. That will be done at 1096 1096 ; defload, to assure that a fileid exists. It's required for the 1097 1097 ; array var, used to save the mode of the current file. 1098 /* 1098 1099 defc SetEditOptions 1099 1100 universal default_edit_options 1100 arg1 = upcase( arg(1))1101 arg1 = upcase( arg( 1)) 1101 1102 if arg1 = '' | arg1 = 'DEFAULT' then 1102 1103 KeyPath = '\NEPMD\User\Edit\DefaultOptions' 1103 1104 new = QueryConfigKey( KeyPath) 1104 1105 else 1105 new = arg( 1)1106 new = arg( 1) 1106 1107 endif 1107 1108 -- Set universal var 1108 1109 default_edit_options = new 1109 1110 -- Save the value in an array var, because no field var exists 1110 call Use Setting( 'EditOptions', arg(1))1111 1111 call UseFileSetting( 'EditOptions', arg( 1)) 1112 */ 1112 1113 ; --------------------------------------------------------------------------- 1113 1114 defc SetSaveOptions 1114 1115 universal default_save_options 1115 arg1 = upcase( arg(1))1116 arg1 = upcase( arg( 1)) 1116 1117 if arg1 = '' | arg1 = 'DEFAULT' then 1117 1118 KeyPath = '\NEPMD\User\Save\DefaultOptions' 1118 1119 new = QueryConfigKey( KeyPath) 1119 1120 else 1120 new = arg( 1)1121 new = arg( 1) 1121 1122 endif 1122 1123 -- Set universal var 1123 1124 default_save_options = new 1124 1125 -- Save the value in an array var, because no field var exists 1125 call Use Setting( 'SaveOptions', arg(1))1126 call UseFileSetting( 'SaveOptions', arg( 1)) 1126 1127 1127 1128 ; --------------------------------------------------------------------------- 1128 1129 defc SetSearchOptions 1129 1130 universal default_search_options 1130 arg1 = upcase( arg(1))1131 arg1 = upcase( arg( 1)) 1131 1132 if arg1 = '' | arg1 = 'DEFAULT' then 1132 1133 KeyPath = '\NEPMD\User\Search\DefaultOptions' 1133 1134 new = QueryConfigKey( KeyPath) 1134 1135 else 1135 new = arg( 1)1136 new = arg( 1) 1136 1137 endif 1137 1138 -- Set universal var 1138 1139 default_search_options = new 1139 1140 -- Save the value in an array var, because no field var exists 1140 call Use Setting( 'SearchOptions', arg(1))1141 call UseFileSetting( 'SearchOptions', arg( 1)) 1141 1142 1142 1143 ; --------------------------------------------------------------------------- … … 1144 1145 universal stream_mode 1145 1146 universal default_stream_mode 1146 arg1 = upcase( arg(1))1147 arg1 = upcase( arg( 1)) 1147 1148 if arg1 = '' | arg1 = 'DEFAULT' then 1148 1149 on = default_stream_mode … … 1156 1157 'togglecontrol 24' stream_mode 1157 1158 -- Save the value in an array var, because no field var exists 1158 call Use Setting( 'StreamMode', arg(1))1159 call UseFileSetting( 'StreamMode', arg( 1)) 1159 1160 'RefreshInfoLine STREAMMODE' 1160 1161 1161 1162 ; --------------------------------------------------------------------------- 1162 1163 defc SetInsertMode 1163 arg1 = upcase( arg(1))1164 arg1 = upcase( arg( 1)) 1164 1165 if arg1 = '' | arg1 = 'DEFAULT' then 1165 1166 on = 1 … … 1175 1176 endif 1176 1177 -- Save the value in an array var, because no field var exists 1177 call Use Setting( 'InsertMode', arg(1))1178 call UseFileSetting( 'InsertMode', arg( 1)) 1178 1179 -- Update of infoline field is handled internally 1179 1180 … … 1184 1185 defc SetTextFont 1185 1186 universal lastfont 1186 arg1 = upcase( arg(1))1187 arg1 = upcase( arg( 1)) 1187 1188 if arg1 = '' | arg1 = 'DEFAULT' then 1188 1189 --new = queryprofile( app_hini, appname, 'FONT') … … 1193 1194 new = QueryConfigKey( KeyPath) 1194 1195 else 1195 new = arg( 1)1196 new = arg( 1) 1196 1197 parse value new with size '.' rest 1197 1198 if not isnum( size) then … … 1200 1201 endif 1201 1202 if rest = '' then 1202 parse value queryfont( .font) with fontname '.' fontsize '.' fontsel1203 parse value queryfont( .font) with fontname '.' fontsize '.' fontsel 1203 1204 new = size'.'fontname 1204 1205 if fontsel > 0 then … … 1212 1213 -- and execute simply: .font = <font_id>. Therefore the 1213 1214 -- font_id would have been saved, after it was registered: 1214 -- .font = registerfont( fontname, fontsize, fontsel)1215 -- .font = registerfont( fontname, fontsize, fontsel) 1215 1216 new = ConvertToEFont( new) 1216 1217 'processfontrequest' new … … 1218 1219 endif 1219 1220 -- Save the value in an array var, because no field var exists 1220 call Use Setting( 'TextFont', arg(1))1221 call UseFileSetting( 'TextFont', arg( 1)) 1221 1222 1222 1223 ; --------------------------------------------------------------------------- 1223 1224 defc SetTextColor 1224 arg1 = upcase( arg(1))1225 arg1 = upcase( arg( 1)) 1225 1226 if arg1 = '' | arg1 = 'DEFAULT' then 1226 1227 KeyPath = '\NEPMD\User\Colors\Text' 1227 1228 new = ColorNameToNum( QueryConfigKey( KeyPath)) 1228 1229 else 1229 new = ColorNameToNum( arg( 1))1230 new = ColorNameToNum( arg( 1)) 1230 1231 if rc <> 0 then 1231 1232 return rc … … 1238 1239 endif 1239 1240 -- Save the value in an array var, to determine 'DEFAULT' state later 1240 call Use Setting( 'TextColor', arg(1))1241 call UseFileSetting( 'TextColor', arg( 1)) 1241 1242 1242 1243 ; --------------------------------------------------------------------------- 1243 1244 defc SetMarkColor 1244 arg1 = upcase( arg(1))1245 arg1 = upcase( arg( 1)) 1245 1246 if arg1 = '' | arg1 = 'DEFAULT' then 1246 1247 KeyPath = '\NEPMD\User\Colors\Mark' 1247 1248 new = ColorNameToNum( QueryConfigKey( KeyPath)) 1248 1249 else 1249 new = ColorNameToNum( arg( 1))1250 new = ColorNameToNum( arg( 1)) 1250 1251 if rc <> 0 then 1251 1252 return … … 1258 1259 endif 1259 1260 -- Save the value in an array var, to determine 'DEFAULT' state later 1260 call Use Setting( 'MarkColor', arg(1))1261 call UseFileSetting( 'MarkColor', arg( 1)) 1261 1262 1262 1263 ; --------------------------------------------------------------------------- … … 1277 1278 universal default_header_style 1278 1279 ValidArgs = '1 2' 1279 arg1 = strip( upcase( arg( 1)))1280 arg1 = strip( upcase( arg( 1))) 1280 1281 parse value arg1 with next rest 1281 1282 if next = 'DEFINEDEFAULT' then … … 1293 1294 header_style = arg1 1294 1295 -- Save the value in an array var, because no field var exists 1295 call Use Setting( 'HeaderStyle', arg(1))1296 call UseFileSetting( 'HeaderStyle', arg( 1)) 1296 1297 endif 1297 1298 … … 1313 1314 header_width = arg1 1314 1315 -- Save the value in an array var, because no field var exists 1315 call Use Setting( 'HeaderWidth', arg( 1))1316 call UseFileSetting( 'HeaderWidth', arg( 1)) 1316 1317 endif 1317 1318 … … 1323 1324 universal default_END_commented 1324 1325 ValidArgs = '0 1' 1325 arg1 = strip( upcase( arg( 1)))1326 arg1 = strip( upcase( arg( 1))) 1326 1327 parse value arg1 with next rest 1327 1328 if next = 'DEFINEDEFAULT' then … … 1339 1340 END_commented = arg1 1340 1341 -- Save the value in an array var, because no field var exists 1341 call Use Setting( 'EndCommented', arg(1))1342 call UseFileSetting( 'EndCommented', arg( 1)) 1342 1343 endif 1343 1344 … … 1352 1353 universal match_chars 1353 1354 universal default_match_chars 1354 arg1 = strip( upcase( arg( 1)))1355 arg1 = strip( upcase( arg( 1))) 1355 1356 parse value arg1 with next rest 1356 1357 if next = 'DEFINEDEFAULT' then … … 1368 1369 match_chars = arg1 1369 1370 -- Save the value in an array var, because no field var exists 1370 call Use Setting( 'MatchChars', arg(1))1371 call UseFileSetting( 'MatchChars', arg( 1)) 1371 1372 endif 1372 1373 … … 1378 1379 universal default_comment_auto_terminate 1379 1380 ValidArgs = '0 1' 1380 arg1 = strip( upcase( arg( 1)))1381 arg1 = strip( upcase( arg( 1))) 1381 1382 parse value arg1 with next rest 1382 1383 if next = 'DEFINEDEFAULT' then … … 1394 1395 comment_auto_terminate = arg1 1395 1396 -- Save the value in an array var, because no field var exists 1396 call Use Setting( 'CommentAutoTerminate', arg(1))1397 call UseFileSetting( 'CommentAutoTerminate', arg( 1)) 1397 1398 endif 1398 1399 … … 1404 1405 universal default_function_spacing 1405 1406 ValidArgs = 'NSCE' -- No spaces, space at Start/Comma/End of parameter list 1406 arg1 = strip( upcase( arg( 1)))1407 arg1 = strip( upcase( arg( 1))) 1407 1408 parse value arg1 with next rest 1408 1409 if next = 'DEFINEDEFAULT' then … … 1434 1435 endif 1435 1436 -- Save the value in an array var, because no field var exists 1436 call Use Setting( 'FunctionSpacing', function_spacing)1437 call UseFileSetting( 'FunctionSpacing', function_spacing) 1437 1438 endif 1438 1439 … … 1444 1445 universal default_closing_brace_auto_indent 1445 1446 ValidArgs = '0 1' 1446 arg1 = strip( upcase( arg( 1)))1447 arg1 = strip( upcase( arg( 1))) 1447 1448 parse value arg1 with next rest 1448 1449 if next = 'DEFINEDEFAULT' then … … 1460 1461 closing_brace_auto_indent = arg1 1461 1462 -- Save the value in an array var, because no field var exists 1462 call Use Setting( 'ClosingBraceAutoIndent', arg(1))1463 call UseFileSetting( 'ClosingBraceAutoIndent', arg( 1)) 1463 1464 endif 1464 1465 … … 1505 1506 ; a ModeExecute command, it is resolved directly by ModeExecute. 1506 1507 defc SetCodingStyle 1507 call ExecuteCodingStyle( 0, arg( 1))1508 call ExecuteCodingStyle( 0, arg( 1)) 1508 1509 if isadefproc( 'MenuText_selectcodingstyle') then 1509 1510 MenuText_selectcodingstyle() … … 1521 1522 defproc ExecuteCodingStyle 1522 1523 universal LoadState 1523 Mode = arg( 1)1524 Name = arg( 2)1524 Mode = arg( 1) 1525 Name = arg( 2) 1525 1526 Name = lowcase( Name) 1526 1527 if Name = 'off' then … … 1585 1586 None = '-none-' 1586 1587 1587 Mode = arg( 1)1588 Mode = arg( 1) 1588 1589 if Mode = '' then 1589 1590 Mode = GetMode() … … 1641 1642 '/~Set/Edit ~PROFILE.ERX/~Edit MODECFG.E/'CANCEL__MSG, -- buttons 1642 1643 0, 0, --5, 5, -- top, left, 1643 Min( words( CodingStyles), 15), 100, -- height, width1644 Min( words( CodingStyles), 15), 100, -- height, width 1644 1645 GethWndC( APP_HANDLE) || atoi( DefaultItem) || 1645 1646 atoi( DefaultButton) || atoi( HelpId) || … … 1649 1650 -- Check result 1650 1651 Button = asc( leftstr( Result, 1)) 1651 EOS = pos( \0, Result, 2) -- CHR( 0) signifies End Of String1652 EOS = pos( \0, Result, 2) -- CHR( 0) signifies End Of String 1652 1653 1653 1654 NewCodingStyle = substr( Result, 2, EOS - 2) … … 1729 1730 .col = 1 1730 1731 fDeleted = 0 1731 Line = strip( translate( textline( l), ' ', \9))1732 Line = strip( translate( textline( l), ' ', \9)) 1732 1733 1733 1734 -- Ignore comments in Line or when already in comment … … 1765 1766 -- (Surrounding quotes or doublequotes are omitted here just for simpleness.) 1766 1767 Search = '(MODEEXEC|MODEEXECUTE):w'Mode':wSETCODINGSTYLE' 1767 p = pos( Search, upcase( Line), 1, 'x') -- using the egrep option for pos1768 p = pos( Search, upcase( Line), 1, 'x') -- using the egrep option for pos 1768 1769 if p > 0 then 1769 1770 deleteline l
Note:
See TracChangeset
for help on using the changeset viewer.