Hi,
I found a nice Tex compiler support macro on the old bbs. It was meant for the Tex/Latex compiler, although I have a hunch that it is interesting for other compilers as well.
It was written by Christian Gerard.

My personal interest in the macro is this: At present, I am using a third party program for that task. ( The technical name is inverse search.) So, it would be nice to do it in Vedit.

Here is the macro:

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Topic: Another TeX macro I would like to write (1 of 4), Read 75 times
Conf: VEDIT User Applications
From: Christian Gerard
Date: Thursday, November 08, 2001 04:08 AM

Dear group,

there is another TeX macro which would be very nice:
assume I have run TeX on the file myfile.tex, and I am looking at myfile.log
to see the errors. A typical error message in TeX is as follows:
l.xxx ..error message..,
where xxx is the line number in myfile.tex where TeX has found the error.

What I would like to do is the following:
when the cursor in myfile.log is on a line reporting an error, the macro should read the
line number (xxx), and open myfile.tex at line number xxx, so that I can correct the error directly.

Any suggestions?

Christian.


Topic: Another TeX macro I would like to write (2 of 4), Read 77 times
Conf: VEDIT User Applications
From: Christian Ziemski
Date: Thursday, November 08, 2001 08:05 AM

To begin:
I don't know anything about tex! I just jumped into this thread...

Assuming "myfile.tex" and the errorlog are opened in the same instance of VEDIT you can do it like that:

// in the errorlog file:
Begin_Of_Line
Char(2)
#99=Num_Eval(SUPPRESS)
File_Open("myfile.text")
Goto_Line(#99)


Christian Z.


Topic: Another TeX macro I would like to write (3 of 4), Read 78 times
Conf: VEDIT User Applications
From: Christian Gerard
Date: Thursday, November 08, 2001 09:04 AM

Dear Christian,

thanks a lot!. Your suggestion did the trick.
I have uploaded the macro searcherrors.vdm
to the ftp server.
many thanks,

Christian.


Topic: Another TeX macro I would like to write (4 of 4), Read 83 times
Conf: VEDIT User Applications
From: Christian Gerard
Date: Friday, November 09, 2001 02:47 AM

since the ftp server does not seem to work,
here is the macro:
(it is probably too long!)

Christian.
//Description of use:

//edit the .log file in Vedit. Put the cursor //on a line showing an error message
//(the line number in the .tex file is at the //beginning of this line).
//Executing this macro will open the .tex //file at the correct line number to correct //the error


// I. Set file specs
//

//Empty registers
Reg_Push(20,23)
Num_Push(20, 23)
#20 = BufNum // Buffer of log file
Reg_Set(21,FILEONLY)
// name of the log file //without extension->@(21)
Reg_Set(22,PATHNAME)
// full name with path of the log file -> //@(22}
Reg_set(23,PATHONLY)
// full path of the directory of the log file //-> @(23)


//get the line number in the current error //message and puts it in numerical register //23
Begin_Of_Line
Char(2)

#23=Num_Eval(SUPPRESS)
// II. Check for open TeX file; if open close //it
//
#22=File_Check("|@(23)\|@(21).tex")

if(#22 > 0) {
Buf_Switch(#22)
Buf_Quit(delete)}
//Opens the TeX file
Num_Push(30,32)
Buf_Switch(Buf_Free)
File_Open("|@(23)\|@(21).tex")
#32 = Screen_Lines - Win_Reserved_Bottom - Win_Reserved_Top -20
if (#32 < 4) { #32 = 4 }
Win_Create(Win_Free,20,1,#32,Screen_Cols)
Win_Switch(Win_Num,ATTACH)
Margin_Right(70)
//Go to line of the error
Goto_Line(#23)
//restore various registers
Num_Pop(30,32)
Reg_Pop(20,23)
Num_Pop(20,23)