/* ** AREXX $VER: NextError.ced V1.23 (12.11.1995) ** ** Skip through all \TeX-errors given in the `.log' file. ** ** Idea: Take the filename and line-number of the current view, ** replace `.tex' (or `.ltx' in case of a LaTeX file) with `.log'. Go to ** the logfile and search the first `^Jl.' with a number greater than ** the current line number. ** ** Georg Hessmann (hes) 26-jul-91 ** ** Changes: Take the filename and the associate `.log' file. Jump through the ** series of errors given in the `.log' file rather than to the next error ** relative to the current position in the `.tex' file. This is much faster. ** ** Make use of the `NameStruc' script for extracting the filename. ** ** Andreas Scherer (as) 10-sep-92 ** ** Allow for LaTeX files with `.ltx' extension. ** ** Andreas Scherer (as) 19-feb-93 ** ** Search for `l.' in the first column only. ** ** Andreas Scherer (as) 12-nov-95 */ Options Results /* ** Full FileName from CED-file */ Status 19 FULLNAME = RESULT Parse Value NameStruc(FULLNAME) With IVOL IDIRS IBASE . /* ** Do we really have a TeX input file? */ If "" = SubStr(FULLNAME,1+IVOL+IDIRS+IBASE) | Upper(Right(FULLNAME,3)) ~= "TEX" Then Do /* ** Or is it a LateX input file? */ If "" = SubStr(FULLNAME,1+IVOL+IDIRS+IBASE) | Upper(Right(FULLNAME,3)) ~= "LTX" Then Do Okay1 "Fehler, die Datei muß eine Endung `.tex' oder `.ltx' haben." Exit 5 End End /* ** Name of the log file, which is hopefully created. */ LOGNAME = Left(FULLNAME,IVOL+IDIRS+IBASE)".log" /* ** Go to the LOG-File. This part is massively changed: ** Originally the 'next error' was the next relative to the current line in ** the `.tex' file. Now it is the next entry in the `.log' file. By jumping ** from one error to the next you go down through all errors. By closing ** the CED view of the `.log' file you can start anew. */ 'Jump to File' "'"LOGNAME"'" If 0 = RESULT Then Do Open New Open '"'LOGNAME'"' Editable File DUMMY = SetClip("CURRENTLOGLINE","1") End CURRENTTEXLINE = 0 CURRENTLOGLINE = GetClip("CURRENTLOGLINE") 'Jump to line' CURRENTLOGLINE /* * Kein `^M' mehr. RESULT wird erst von `Status CursorColumn' gesetzt! */ Do Until 1 = COLUMN 'Search for' "l." FOUND = RESULT If FOUND Then Do Right Status CursorColumn COLUMN = RESULT End Else COLUMN = 1 End If FOUND Then Do /* ** Take the current line from CED */ 'Status 55' Parse Var RESULT "l." CURRENTTEXLINE . /* ** Save the current line plus 1 of the log file */ Status 57 DUMMY = SetClip("CURRENTLOGLINE",RESULT+2) End /* ** Go back to the TeX-File */ 'Jump to File' "'"FULLNAME"'" If 0 ~= CURRENTTEXLINE Then Do 'Jump to line' CURRENTTEXLINE 'Beg of line' End; Else Do 'Jump to File' "'"LOGNAME"'" 'End of file' Okay1 "No more errors." End