/********************************************************************/ /* Package : TeXShell for CMS, version 2.0 */ /* Author : Humberto Jose' Bortolossi */ /* */ /* Bitnet : hjbortol at brlncc.bitnet, hjbortol at brfuem.bitnet */ /* Internet : hjbortol at gauss.impa.br */ /* */ /* Organizations : Instituto de Matematica Pura e Aplicada (IMPA) */ /* Fundacao Universidade Estadual de Maringa' */ /* */ /* Copyright : This program is freely distributable. */ /* You can do changes but, please, keep my name. */ /* */ /* Description : This macro will do two things: first, it will look */ /* up TEXLOG file searching for 'errors/warnings' */ /* messages. The respective lines will recorded into */ /* ERROR (for errors) and WARNING (for war- */ /* nings). Second, if you press at LOGVIEW en- */ /* vironment, WARNING XEDIT will put the current line */ /* of TEX as the line where the error was found. */ /* This macro uses two temp files: TEXSHELL CONTROL1 */ /* and TEXSHELL CONTROL2. All temp files are erased */ /* when you go out LOGVIEW environment. */ /* */ /* (C) Copyright 1992 */ /********************************************************************/ parse arg fn . set emsg off 'listfile' fn 'WARNING * (NOHEADER ALLOC STACK' if rc /= 0 then do call process(fn) 'execio 1 diskr TEXSHELL CONTROL2' FileMode '(FINIS' parse pull CurrentError DropBuf end 'listfile' fn 'WARNING * (NOHEADER ALLOC STACK' pull . . FileMode . . NumberOfErrors . DropBuf 'execio 1 diskr TEXSHELL CONTROL2' FileMode '(FINIS' parse pull CurrentError DropBuf if CurrentError >= NumberOfErrors then CurrentError = 0 CurrentError = CurrentError + 1 set emsg off; 'erase TEXSHELL CONTROL2' FileMode; set emsg on 'execio 1 diskw TEXSHELL CONTROL2' FileMode '(FINIS STRING' CurrentError 'execio' NumberOfErrors 'diskr' fn 'WARNING' FileMode '(FINIS' do i = 1 to CurrentError - 1 pull . end pull LogLine SourceLine DropBuf queue 'sos tabcmdf' queue 'top' queue SourceLine queue 'sos tabcmdf' queue 'top' queue LogLine exit 0 process: parse arg fn set emsg off 'listfile' fn 'TEXLOG * (NOHEADER ALLOC STACK' if rc /= 0 then do say 'File' fn 'TEXLOG * not found.' DropBuf exit 0 end else do pull . . FileMode . . NumberOfLines . end DropBuf 'listfile' fn 'ERROR * (NOHEADER ALLOC STACK' if rc /= 0 then do DropBuf end else do 'erase' fn 'ERROR *' end DropBuf 'listfile' fn 'WARNING * (NOHEADER ALLOC STACK' if rc /= 0 then do DropBuf end else do 'erase' fn 'WARNING *' end DropBuf set emsg on 'execio' NumberOfLines 'diskr' fn 'TEXLOG' FileMode '(FINIS' do while queued() /= 0 parse pull Line if subword(Line,1,2) = 'LaTeX Warning:' then do LogLine = NumberOfLines - queued() parse pull Line do forever while substr(Line,1,2) /= 'l.' parse pull Line end WarningLine = delstr(subword(Line,1,1),1,2) OutRecord = right(LogLine,5) right(WarningLine,5) 'execio 1 diskw' fn 'WARNING' FileMode '(FINIS STRING' OutRecord end if subword(Line,1,1) = '!' then do LogLine = NumberOfLines - queued() parse pull Line do forever while substr(Line,1,2) /= 'l.' parse pull Line end ErrorLine = delstr(subword(Line,1,1),1,2) OutRecord = right(LogLine,5) right(ErrorLine,5) 'execio 1 diskw' fn 'ERROR' FileMode '(FINIS STRING' OutRecord end end DropBuf set emsg off 'erase TEXSHELL CONTROL1 *' 'erase TEXSHELL CONTROL2 *' Junk = 0 'execio 1 diskw TEXSHELL CONTROL1' FileMode '(FINIS STRING' Junk 'execio 1 diskw TEXSHELL CONTROL2' FileMode '(FINIS STRING' Junk 'listfile' fn 'WARNING' FileMode '(NOHEADER ALLOC STACK' if rc /= 0 then do DropBuf say 'No warnings ...' exit 0 end DropBuf return