home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 3
/
goldfish_volume_3.bin
/
files
/
text
/
edit
/
macro
/
tex-scripts
/
nexterror.ged
< prev
next >
Wrap
Text File
|
1994-03-24
|
2KB
|
98 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 PostcardWare, so send me a postcard or something useful (read
the doc!).
*/
/* $VER: 0.9, ©1993 Dietmar Eilert. Empty GoldED macro */
OPTIONS RESULTS /* enable return codes */
if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
address 'GOLDED.1'
'LOCK CURRENT' /* lock GUI, gain access */
OPTIONS FAILAT 6 /* ignore warnings */
SIGNAL ON SYNTAX /* ensure clean exit */
'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 QUIET HEIGHT=80 FORCE USE="'||logname||'"'
'OPEN AGAIN' /* Reloading file slows operation down, but ensures
that the right error will be gotten */
'REQUEST HIDE = FALSE'
'GOTO UNFOLD=TRUE 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||'"' /* FORCE is not required because text is already
loaded. If user killed text in-between, then he's a sicko */
IF 0~= number & number > currentline THEN DO
'GOTO COLUMN=1 UNFOLD=TRUE LINE=' number
'FIX VAR=ERRORWORD'
'FIND QUIET NEXT STRING="'||errorword||'"'
UNLOCK
END
else DO
'REQUEST BODY="No more errors."'
UNLOCK
END
'UNLOCK' /* VERY important: unlock GUI */
EXIT
SYNTAX:
SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
'UNLOCK'
EXIT