home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 9
/
FreshFishVol9-CD2.bin
/
bbs
/
util
/
gedscripts-1.1.lha
/
GEDScripts
/
PasTeX
/
NextError.ged
< prev
next >
Wrap
Text File
|
1994-02-15
|
2KB
|
88 lines
/* Skip to next TeX error --- take filename and line-number of the current
window look for logfile. Then look for last word on the first halfline and then
get that word and search for it. So the cursor should get to the error at once.
Done by:
R.Laederach
Kappelisackerstr. 46
3063 Ittigen
Switzerland
Phone:+41/(0)31/912 19 08
This stuff ist PD, so do what you want.
*/
ADDRESS "GOLDED.1"
LOCK CURRENT
OPTIONS RESULTS
'QUERY DOC'
fullname = RESULT
basename = (left(fullname, LENGTH(fullname)-4))
extension = translate(right(fullname, 4) , xrange('a','z'), xrange('A','Z'))
IF extension ~= ".tex" THEN DO
'REQUEST BODY="I need a .tex file"'
UNLOCK
EXIT 5
END
logname = basename||".log"
'QUERY LINE'
currentline = RESULT + 1
'REQUEST HIDE = TRUE'
'WINDOW USE' logname
notok = (RC ~= 0)
if (notok) THEN DO
'MORE'
'OPEN NAME' logname
'WINDOW HEIGHT' 80
END
'REQUEST HIDE = FALSE'
'GOTO TOP'
number = 0
found = 1
DO WHILE(found & number <= currentline)
'FIND NEXT QUIET STRING="l."'
found = (RC = 0)
if (found) THEN DO
OPTIONS RESULTS
'QUERY BUFFER'
parse var RESULT "l." number errorstring
IF "" ~= errorstring THEN DO
wordnumber = WORDS(errorstring)
errorword = WORD(errorstring,wordnumber)
/* say errorstring
say errorword
say wordnumber >I used that for debugging */
END
END
END
'WINDOW USE' fullname
IF 0~= number & number > currentline THEN DO
'GOTO LINE' number
FIRST
'FIND QUIET NEXT STRING='||errorword
UNLOCK
END
else DO
'REQUEST BODY="No more errors."'
UNLOCK
END