// // ASPELL.VDM - Use Aspell spelling checker to check file being edited in Vedit. // // - After running this macro, the words with spelling errors will be highlighted. // - Move cursor to a highlighted word and press Shift-F6 to open list of suggested // correction words. Select word with cursor keys and press enter. // - Or select "Ignore word" or "Add word to dictionary", if it is not an error. // - After finished checking, call label EXIT_SPELLCHK to restore syntax colors // and key configuration. // - For more information, see the file aspell_vdm.txt. // // (c) Pauli Lindgren, 2008-04-14 // // V1.3 2008-05-09 // ///////////////////////////////////////////////////////////////////////////////////// // // Global variables (must be retained between calls): // #40 = 0x01020304 when spelling mode active // #41 = 999 if "Find next error automatically" enabled. Num_Push(50,72) // [ Reg_Set(#51=Reg_Free," ") // #51 = Base directory of to ASPELL spelling checker program. // Reg_Set(#51,'C:\Program Files\Aspell') if (Registry_Get_Item(#51,"HKEY_LOCAL_MACHINE\SOFTWARE\Aspell\(Default)") < 0) { Alert Statline_Message("Aspell.exe not found!") } // initial values, overwritten by values from .ini file if one exists: // #61 = 500 // Number of lines after cursor to check spelling #62 = 50 // Max number of different words with spelling error before stop check #70 = 108 // color for errors with suggestions #71 = 96 // color for errors without suggestion #72 = 0 // Auto detect language = false #41 = 0 // Find next error automatically = false #50 = Buf_Num // original buffer number #60 = Cur_Pos #52 = Reg_Free // #52 = name of tmp text file input to aspell RS(#52,VEDIT_TEMP) RS(#52,'"',INSERT) // enclosed in double quotes in case it contains spaces RS(#52,'\spell.txt"',APPEND) #53 = Reg_Free // #53 = name of aspell output file RS(#53,VEDIT_TEMP) RS(#53,'"',INSERT) RS(#53,'\aspell.out"',APPEND) #54 = Reg_Free // T-Reg for block of text to be checked RS(#54,EXT_ONLY) Reg_Set(#55=Reg_Free," ") // T-Reg for language list in dialog box #59 = Config(F_F_TYPE) // File type (CR/LF) of the original file // // Main dialog box // #104 = 1 // Dictionary language radio button #106 = 0 // File type radio button #107 = 0 // Ignore Case tickbox #108 = 0 // Ignore Accents tickbox Call("READ_SETTINGS") #103 = 1 // Start at BOF tickbox if (#40 == 0x01020304) { // spell check already run #103 = 0 // start at cursor location } #105 = 2 // File type (mode) Reg_Compare(#54,"html") if (Chars_Matched > 2) { // htm or html #105 = 3 } Reg_Compare(#54,"tex") if (Chars_Matched > 2) { // tex #105 = 4 } RS(#54,"`Check spelling on current file `") if (BB >= 0 && BE > 0) { // block highlighted RS(#54,"`Check spelling in selected block `") #103=128 } :MAIN_DIALOG: if (#72) // Auto detect language enabled? { Call("DETECT_LANGUAGE") } #65 = DI1(103,^`Spelling check`, |@(#54), `[]&Start at beginning of file `, ` Dictionary: \t\t File type: `, |@(#55) `.g.h()plain &Text`, `()text with &URL`, `()&HTML`, `()Te&X`, `[]Allow &Run-together words`, `[]ignore &Case `,`.h[]ignore &Accents`, `.l[ OK ]`,`.h.l[Cancel]`,`.h.l[&Options]`^, APP+TOP+CENTER+SET,0,120) if (#65==0 || #65==2) { Goto DONE } // Esc or [Cancel] if (#65==3) { // [Options] Call("OPTIONS_DIALOG") if (Return_Value==3) { goto DONE } // [Edit .ini] if (Return_Value==1) { // [OK] Call("SAVE_SETTINGS") // Save user options } Goto MAIN_DIALOG } #64 = #103 // Start at BOF tickbox Call("SAVE_SETTINGS") // Save user options // // Save Vedit settings and Tools menu, load spTools menu // if (#40 != 0x01020304) { #40 = 0x01020304 // Syntax check mode is active #63 = Config(PG_E_SYNTAX) // old syntax higlight enable config #65 = Config(C_W_RESERVE_W3) // old syntax color for keywords 3 #66 = Config(C_W_RESERVE_W4) // old syntax color for keywords 4 Reg_Set(103,SYN_NAME) Reg_Set(104,TOOL_MENU) // Save configuration for syntax highight and tools menu in file File_Open("|(VEDIT_TEMP)\spellstatus.sav",NOEVENT+NOMSG+OVERWRITE) BOF Del_Char(ALL) Num_Ins(#63,LEFT) // save PG_E_SYNTAX Num_Ins(#65,LEFT) // save C_W_RESERVE_W3 Num_Ins(#66,LEFT) // save C_W_RESERVE_W4 Reg_Ins(103) IN // save SYN_NAME Reg_Ins(104) IN // save TOOL_MENU Reg_Set(104,WORD_SEP) Reg_Ins(104) IN // save WORD_SEP Reg_Ins(123) // save Tools menu contents Buf_Close(NOMSG+NOEVENT) // Reconfigure keyboard for SPELL.MNU Key_Add("Shft-F6",'[MENU]ts',OK) // is Suggest Key_Add("Shft-F7",'[MENU]tn',OK) // is Next error Key_Add("Shft-F8",'[MENU]te',OK) // is Exit spell check mode Key_Add("Ctrl-Shft-I",'[MENU]ti',OK) // is "ignore word" // Load SPELL.MNU Reg_Load(123,"spell.mnu",EXTRA+NOERR) // load Tools menu Config_String(TOOL_MENU,"sp&Tools") // name Tools menu as "Tools" Config_String(WORD_SEP,`,;:.()[]{}<>=*&/\||+-^"!#`) } // // Create a .BAT file to run Aspell // File_Open("|(VEDIT_TEMP)\spelltmp.bat",NOEVENT+NOMSG+OVERWRITE) #56 = Buf_Num BOF Del_Char(ALL) IC('"') Reg_Ins(#51) // Aspell home directory IT('\bin\aspell" -a') // use pipe mode Buf_Switch(Extra_Buffer_3) // list of language codes Goto_Line(#104) // Dictionary radio button RCB(104,CP,EOL_pos) // get language code Buf_Switch(#56) // .BAT file IT(' --lang=') Reg_Ins(104) if (#105 == 1) { IT(' --mode=none') // File type = Plain text } if (#105 == 3) { IT(' -H') // File type = HTML } if (#105 == 4) { IT(' -t') // File type = TeX } if (#106) { IT(' -C') // Allow run-togetger words always } if (#107) { IT(' --ignore-case') // ignore Case } if (#108) { IT(' --ignore-accents') // ignore Accents } IT(' <') Reg_Ins(#52) // tmp input text file IT(' >') Reg_Ins(#53) // Aspell output file IN Buf_Close(NOMSG+NOEVENT) if (File_Exist("|@(#51)\dict\|@(104).multi")==0) { Statline_Message("Dictionary not found!") Alert() Goto DONE } // // Create tmp text file for text section to check // Buf_Switch(#50) // original buffer if (BB >= 0 && BE > 0) { // block highlighted #60 = BB // after checking spelling, move to block begin RCB(#54,BB,BE,Block_Mode) } else { if (#64) { BOF } // Start at BOF selected Reg_Copy(#54,#61) // check next #61 lines } BB(CLEAR) File_Open(@(#52),NOEVENT+NOMSG+OVERWRITE) // tmp text file Config(F_F_TYPE,#59) // Use the same file type as original file BOF Del_Char(ALL) IT("!") IN // set Terse mode (only output words with spelling error) Reg_Ins(#54) BOF Line(1) Replace("^([!-?])","\^\1",REGEXP+ALL+NOERR) // Quote any comand characters in text stream Buf_Close(NOMSG+NOEVENT) System('"|(VEDIT_TEMP)\spelltmp.bat"',DOS+SIMPLE) // Run Aspell // // Create syntax file to highlight spelling error words // File_Open("|(USER_MACRO)\spellchk.syn",NOEVENT+NOMSG+OVERWRITE) #56 = Buf_Num BOF Del_Char(ALL) IT("Reserved3 = ") IN IN IT("Reserved4 = ") IN IN Reg_Empty(#54) // use T-Reg #54 for spelling error word File_Open(@(#53),BROWSE+NOEVENT) // Aspell output file #57 = Buf_Num #66 = 0 // number of different word with spelling error found #67 = 0 // total number of spelling errors found if (Match("@(#)")) // is this Aspell output file? { Alert() Statline_Message("Could not run Aspell!") } else { if (Search("|<|{&,#}|W",ADVANCE+NOERR+NORESTORE)) { // find first error in Aspell output file BOF while (!At_EOF && #66 < #62) { // stop when EOF or max # of errors found Search("|<|{&,#}|W",ADVANCE+ERRBREAK+NORESTORE) #68 = Match_Item // 1 = error with suggestions, 2 = error without suggestions #65 = Cur_Pos Search("|W",NOERR) RCB(#54,#65,CP) Call("ADD_WORD_TO_SYN") } Num_Str(#67,#54,LEFT) RS(#54," errors, ",APPEND) Num_Str(#66,#53,LEFT) RS(#54,@(#53),APPEND) RS(#54," different words",APPEND) Statline_Message(@(#54)) } else { Statline_Message("No errors") } } Buf_Switch(#57) // Aspell output file Buf_Close(NOMSG+NOEVENT) Buf_Switch(#56) // Syntax file EOF IT("Casesense3 = Y") IN IN IT("Casesense4 = Y") IN IN Buf_Close(NOMSG+NOEVENT) Buf_Switch(#50) // original buffer GP(#60) // original cursor pos if (#66) { // any errors found? Syntax_Load("|(USER_MACRO)\spellchk.syn") Config(PG_E_SYNTAX,1,LOCAL) Config(C_W_RESERVE_W3,#71) // color for errors without suggestion Config(C_W_RESERVE_W4,#70) // color for errors with suggestions Config_String(SYN_NAME,"spellchk.syn",LOCAL) if (#41 == 999) // find next error automatically { if (#64) { BOF } // Start at BOF selected #54 = 0 // search forward Call("FIND_ERROR") } } :DONE: Reg_Empty(#51) Reg_Empty(#52) Reg_Empty(#53) Reg_Empty(#54) Reg_Empty(#55) Num_Pop(50,72) // ] Return ////////////////////////////////////////////////////////////////////////////7 // // Add word in @(#54) in the syntax file // :ADD_WORD_TO_SYN: Buf_Switch(#56) // Syntax file BOF if (#68 == 1) { // error with suggestions, Search("Reserved4 =",ADVANCE+NOERR) } else { // error without suggestions Search("Reserved3 =",ADVANCE+NOERR) } if (Search_Block("|i|@(#54)|i",CP,EOL_pos+2,CASE+NOERR)==0) { // if word not yet in the list EOL if (Cur_Col > 14) { // some words already in list IT(",") } Reg_Ins(#54) // add word to the list #66++ // number of different words with error } Buf_Switch(#57) // Aspell output file #67++ // total number of spelling errors Return ////////////////////////////////////////////////////////////////////////////7 // // Auto detect language // return: #104 = Language radio button number // :DETECT_LANGUAGE: #63 = Reg_Free // tmp T-reg for language code // Swedish? #65 = SB("[åÅ]",1,1000,REGEXP+BEGIN+NOERR+ALL)*10 #65 += SB("[äöÄÖ]",1,1000,REGEXP+BEGIN+NOERR+ALL) if (#65>40) { RS(#63,"sv") // Swedish } // German? #66 = SB("[üÜß]",1,1000,REGEXP+BEGIN+NOERR+ALL)*50 #66 += SB("[äöÄÖ]",1,1000,REGEXP+BEGIN+NOERR+ALL)*2 if (#66>40 && #66>#65) { RS(#63,"de") // German #65 = #66 } // French? #66 = SB("[àèêïôç]",1,1000,REGEXP+BEGIN+NOERR+ALL)*8 #66 += SB("[éÉ]",1,1000,REGEXP+BEGIN+NOERR+ALL)*2 if (#66>40 && #66>#65) { RS(#63,"fr") // French } if (Reg_Size(#63)) // any language detected? { Buf_Switch(Extra_Buffer_3) if (Search("|<|@(#63)",BEGIN+NOERR)) // find index for language { #104 = Cur_Line } else { Alert() RS(#63,'No dictionary option "',INSERT) RS(#63,'"',APPEND) Statline_Message(@(#63)) } Buf_Switch(#50) // original buffer } GP(#60) // original cursor pos Reg_Empty(#63) Return ////////////////////////////////////////////////////////////////////////////7 // // 2nd entry point: // Remove word from syntax highlighting ("Ignore word") // :IGNORE: #63 = 2 // select operation "ignore word" Goto SUGG2 ////////////////////////////////////////////////////////////////////////////7 // // 3rd entry point: // Suggest correction for the word at cursor // :SUGGEST: #63 = 0 // no operation selected, show window :SUGG2: Num_Push(50,69) // [ #50 = Buf_Num // original buffer number #60 = Cur_Pos #51 = Reg_Free RS(#51," ") // #51 = T-reg for word to be checked #52 = Reg_Free RS(#52," ") // #52 = T-reg for list of suggested words #53 = Reg_Free // #53 = name of aspell output file RS(#53,VEDIT_TEMP) RS(#53,'"',INSERT) RS(#53,'\aspell.out"',APPEND) Search("|{|i,|<}",REVERSE+ADVANCE+NOERR) // CZ #68 = CP // #68 = start of word position Search("|{|i,|>}",NOERR) // CZ #69 = CP // #69 = end of word position RCB(#51,#68,CP) if (#63 > 0) { // "Ignore word" operation selected directly #62 = 1 // "enter pressed" Goto SUGG3 } File_Open(@(#53),BROWSE+NOEVENT) // Aspell output file if (Search("|<|{&,#} |@(#51)",CASE+WORD+NOERR)==0) { Buf_Quit(OK) Statline_Message("No suggestions") Goto END_S } if (Cur_Char == '#') { // error without suggestions RS(#52,"(no suggestions)") } else { Search(": ",ADVANCE) RCB(#52,CP,EOL_pos) // @(#52) = list of suggestions } Buf_Quit(OK) // #56 = Buf_Free(EXTRA) // ** does not work??? #56 = Extra_Buffer_2 // #83 = Extra Buffer for list of suggested words Buf_Switch(#56) Reg_Ins(#52) BOF Replace(", ","|N",NOERR+ALL) BOF IT("-> Add word to dict") IN IT("-> Ingore word") IN // Open a window to display suggestions #66 = 16 // #66 = width of show-select window BOF Repeat(ALL) { // check required window width EOL if (Cur_Col-2 > #66 && Cur_Col < Screen_Cols) { #66 = Cur_Col-2 } Line(1,ERRBREAK) } EOF #65 = Cur_Line // #65 = number of lines in window if (#65 > Screen_Lines) { #65 = Screen_Lines } #67 = Screen_Cols-#66 // window x position if (Win_Status(S) >= 0) { Win_Delete(S) } Win_Create(S,1,#67,#65,#66,MINBORDER) Win_Title(S,"Suggested words") Win_Switch(S) // Switch to the new window if (Is_Mono) // If monochrome { Win_Color(112) } // use black chars on white else { Win_Color(240) } // black on grey Win_Clear() // Clear window with new color Buf_Switch(#56) Win_Attach(S) // Attach special window BOF Line(2) Set_Visual_Line(3) Key_Purge() // Clear keyboard buffer // User input loop Reg_Empty(#53) // Sellected word to replace error #62 = 0 // 0 = do not replace the word #67 = 1 repeat (ALL) { // Loop until or if (#67) { // If update needed... Begin_Of_Line() Block_Begin(Cur_Pos) Block_End(EOL_Pos) Update() // Highlight current occurrence line } #67 = 0 // Assume no update needed #66 = Get_Key("Use cursor keys and press to select or to Quit",STATLINE) if (#66=='R'+'T'*256) { // Return if (Match("(no sugg") > 0) { // not "no suggestions" ) RCB(#53,BOL_Pos, EOL_Pos) #62 = 1 // Replase the word } Break // Break out of Repeat Loop } if (#66=='E'+'S'*256) { // Escape Break // Break out of Repeat Loop } if (#66==32 || #66==0x454d) { // Space or Shift-F6 Break // Break out of Repeat Loop } if (#66=='C'+'D'*256) { // Cursor Down if (Cur_Line<#65) { Line(1,NOERR) #67=1 } } if (#66=='C'+'U'*256) { // Cursor Up if (Cur_Line>1) { Line(-1,NOERR) #67=1 } } if (#66=='P'+'D'*256) { // Page Down if (Cur_Line < #65) { #67=1 } Line(Win_Lines-1,NOERR) if (At_EOF) { Line(-1,NOERR) } } if (#66=='P'+'U'*256) { // Page Up if (Cur_Line > 3) { #67=1 } Line(-(Win_Lines-1),NOERR) if (Cur_Line < 3) { Goto_Line(4) } // first actual word in list (not command) } if (#66=='L'+'E'*256) { // End if (Cur_Line < #65) { #67=1 } End_Of_File() Line(-1,NOERR) } if (#66=='L'+'B'*256) { // Home if (Cur_Line != 3) { #67=1 } Goto_Line(3) // first actual word in the list } if (#66=='i' || #66=='I' ) { // 'i' - ignore word #62 = 1 // Execute command Goto_Line(2) // Select "Ignore word" Break // Break out of Repeat Loop } if (#66=='a' || #66=='A' ) { // 'A' - Add word #62 = 1 // Execute command Goto_Line(1) // Select "Add word" Break // Break out of Repeat Loop } } Key_Purge() // Clear keyboard buffer #63 = Cur_Line // #63 = line # selected in the list Win_Delete(S) Buf_Switch(#56) Buf_Quit(OK) // Empty extra buffer Buf_Switch(#50) // Return to original buffer GP(#60) // original cursor pos :SUGG3: if (#62==1) { // Enter pressed if (#63 > 2) { // A word selected for Replace GP(#68) // start of word position Del_Block(#68,#69) // delete old word Reg_Ins(#53) // insert new word } else { #65 = 1 if (#63==1) { // "-> add word" selected Call("ADD_WORD_TO_DICT") // Add word to user dictionary } if (#65==1) { // unless add word was canceled... Call("DEL_WORD_FRM_SYN") // Remove word from syntax file Buf_Switch(#50) Syntax_Load("|(USER_MACRO)\spellchk.syn") } } if (#41 == 999) // find next error automatically { #54 = 0 // search forward Call("FIND_ERROR") } } :END_S: Reg_Empty(#51) Reg_Empty(#52) Reg_Empty(#53) Num_Pop(50,69) // ] Return ////////////////////////////////////////////////////////////////////////////7 // // Remove word in @(#51) from the syntax file // :DEL_WORD_FRM_SYN: File_Open("|(USER_MACRO)\spellchk.syn",NOEVENT+NOMSG+OVERWRITE) BOF Search("Reserved3",ADVANCE+NOERR) #64 = CP if (Search("|i|@(#51)|i",CASE+NOERR)) { // search the word from list Char Del_Char(Chars_Matched-2) if (Match(",")==0) { Del_Char(1) } else { if (Search_Block(",",BOL_pos,CP,REVERSE+NOERR)) { Del_Char(1) } } GP(#64) #54 = Reg_Free // T-Reg for status line text #61 = Search("|A|i",ALL+NOERR)-2 // How many words still in syntax file Num_Str(#61, #54, LEFT) RS(#54, " different words", APPEND) Statline_Message(@(#54)) Reg_Empty(#54) } else { Statline_Message("Word not found in .syn file!") } Buf_Close(NOMSG+NOEVENT) Return ////////////////////////////////////////////////////////////////////////////7 // // Add word in @(#51) to user dictionary // :ADD_WORD_TO_DICT: RS(103,@(#51)) // word to be added #103 = 0 // lowercase tickbox #65 = DI1(103,^`Add word to user dictionary`, `??Add word: `, `[]add as &Lower case (= ignore case) `, `.l[ OK ]`,`.h.l[Cancel]`^, APP+TOP+RIGHT+SET,-30,110) if (#65==0 || #65==2) { Return } // Esc or [Cancel] RS(#51,@(103)) File_Open("|(VEDIT_TEMP)\spelladd.txt",NOEVENT+NOMSG+OVERWRITE) // tmp text file EOF if (#103==0) { IC('*') // add word command } else { IC('&') // add word as lowercase command } Reg_Ins(#51) // the word to be added IN Num_Str(Cur_Line-1,103,LEFT) RS(103," dictionary changes queued.",APPEND) Statline_Message(@103) Buf_Close(NOMSG+NOEVENT) Return ////////////////////////////////////////////////////////////////////////////7 // // 4th entry point: // Find next word with error // :NEXT_ERROR: Num_Push(50,54) #54 = 0 // search forward :next2: #50 = Buf_Num // original buffer number #51 = Reg_Free RS(#51," ") #52 = Reg_Free RS(#52," ") Call("FIND_ERROR") Reg_Empty(#51) Reg_Empty(#52) Num_Pop(50,54) Return // Find previous word with error // :PREV_ERROR: Num_Push(50,54) #54 = REVERSE // search backward Goto next2 ////////////////////////////////////////////////////////////////////////////7 // :FIND_ERROR: File_Open("|(USER_MACRO)\spellchk.syn",NOEVENT+NOMSG+OVERWRITE) Reg_Empty(#51) // #51 = T-reg tmp Reg_Empty(#52) // #52 = T-reg for all error words if (Search("Reserved3|[|W]=|[|W]",BEGIN+ADVANCE+NOERR)) { Reg_Copy_Block(#52,CP,EOL_pos) } if (Search("Reserved4|[|W]=|[|W]",BEGIN+ADVANCE+NOERR)) { #69 = CP EOL While(Cur_Col > 240) { // search string too long? Search(",",REVERSE+ERRBREAK) } Reg_Copy_Block(#51,#69,CP) } if (Reg_Size(#51) && Reg_Size(#52)) { RS(#52,",",APPEND) } RS(#52,@(#51),APPEND) if (Reg_Size(#52) > 245) // search string too long? { RS(#52,@(#51)) } RS(#52,"|{",INSERT) RS(#52,"}",APPEND) Buf_Close(NOMSG+NOEVENT) Buf_Switch(#50) // original buffer //CZ if (#54==0) { Char } // forward? if (Search(@(#52),WORD+CASE+NOERR+#54)==0) { if (#54==0) { Char(-1) } Statline_Message("No more errors") } Return ////////////////////////////////////////////////////////////////////////////7 // // 5th entry point: // Exit spell check mode. Remove added key configurations, restore syntax color // :EXIT_SPELLCHK: if (#40 == 0x01020304) { Num_Push(60,66) // [ #60 = Buf_Num // original buffer // Execute "Add word to dictionary" commands, if any if (File_Exist("|(VEDIT_TEMP)\spelladd.txt")) { Statline_Message("Updating dictionary...") File_Open("|(VEDIT_TEMP)\spelladd.txt",NOEVENT+NOMSG+OVERWRITE) EOF IC('#') // 'save user dictionary' command IN Buf_Close(NOMSG+NOEVENT) File_Delete("|(VEDIT_TEMP)\spell.txt",OK+NOERR) File_Rename("|(VEDIT_TEMP)\spelladd.txt", "|(VEDIT_TEMP)\spell.txt") System('"|(VEDIT_TEMP)\spelltmp.bat"',DOS+SIMPLE) // Run Aspell to add word } // Read saved configuration from file if (File_Exist("|(VEDIT_TEMP)\spellstatus.sav")) { File_Open("|(VEDIT_TEMP)\spellstatus.sav",NOEVENT+NOMSG+OVERWRITE) BOF #63 = Num_Eval(SUPPRESS) // Syntax highlight enable setting Line(1) #65 = Num_Eval(SUPPRESS) // old syntax color for keywords 3 Line(1) #66 = Num_Eval(SUPPRESS) // old syntax color for keywords 4 Line(1) RCB(103,CP,EOL_pos) // SYN_NAME (buffer specific) Line(1) RCB(104,CP,EOL_pos) // TOOL_MENU Config_String(TOOL_MENU,@104) Line(1) RCB(104,CP,EOL_pos) // WORD_SEP Config_String(WORD_SEP,@104) Line(1) RCB(123,CP,EOB_pos) // restore Tools menu Buf_Close(NOMSG+NOEVENT) Buf_Switch(#60) // original buffer Config_String(SYN_NAME,@103,LOCAL) Config(PG_E_SYNTAX,#63) // Restore syntax enable setting Config(C_W_RESERVE_W3,#65) // restore syntax color for keywords 3 Config(C_W_RESERVE_W4,#66) // restore syntax color for keywords 4 Statline_Message("Normal mode") } else { Statline_Message("spellstatus.sav not found") } Update Key_Delete('[MENU]ts',REVERSE+NOERR) // Remove key sequences Key_Delete('[MENU]te',REVERSE+NOERR) #40 = 0 // Reset spell check active identifier #41 = 0 Num_Pop(60,66) // ] } Return ////////////////////////////////////////////////////////////////////////////7 // // Subroutines: // ////////////////////////////////////////////////////////////////////////////7 :OPTIONS_DIALOG: Num_Push(103,104) Num_Str(#61,103,LEFT) // max num of lines Num_Str(#62,104,LEFT) // max num of errors Num_Str(#70,105,LEFT) // Color for errors with suggestions Num_Str(#71,106,LEFT) // Color for errors without suggestions #103 = #72 #104 = 0 if (#41 == 999) { #104 = 1 } #65 = DI1(103,^`Spelling check options`, `??max number of &Lines to check: `, `??max number of &Errors to look for: `, `??&Color for errors with suggestions: `, `??C&olor for errors without suggestions:`, `[]&Auto detect language`, `[]&Find next error automatically`, `.l[ OK ]`,`.h.l[Cancel]`,`.h[Edit aspell.&ini ]`^, APP+TOP+CENTER+SET,0,120) if (#65==1) { #61 = atoi(103) #62 = atoi(104) #70 = atoi(105) #71 = atoi(106) #72 = #103 // auto detect language #41 = 0 if (#104) { #41 = 999 } // find next error automatically } if (#65==3) { // [Edit .ini] File_Open("|(USER_MACRO)\aspell.ini") } Num_Pop(103,104) Return(#65) ////////////////////////////////////////////////////////////////////////// // // Read settings from ASPELL.INI // :READ_SETTINGS: File_Open("|(USER_MACRO)\aspell.ini",BROWSE+NOEVENT) if (Search("|