home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 3
/
goldfish_volume_3.bin
/
files
/
text
/
edit
/
macro
/
tex-scripts
/
gotosdvi.ged
< prev
next >
Wrap
Text File
|
1994-03-24
|
2KB
|
88 lines
/*RX
GoToSDVI.ged NAME:GoToSDVI.ged Version:1.00
- Load SDVI if it isn't running, with the current dvi file of the CED
view (if it's a tex file)
- Check if the current CED view filename (with dvi) is the filename in
ShowDVI. If it isn't, load it into SDVI. Check if DVI file is there.
- If the above things don't apply, bring SDVI to front.
Ren\'e Laederach February 94
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 FILE
filename=RESULT /* No time to test new routine. Works OK */
QUERY PATH
pathname=RESULT
if (RIGHT(pathname,1)) ~= ":" THEN DO
pathname = pathname||"/"
END
filename = left(filename,lastpos('.',filename)-1)
IF ~EXISTS(pathname||filename||".dvi") THEN DO
'REQUEST BODY="The corresponding .dvi file does not exist|Use Start_TeX to generate one."'
UNLOCK
EXIT
END
/* Now check if ShowDVI is running */
IF ~SHOW('P','showdvi') THEN DO
ADDRESS COMMAND "run <nil: >nil: tex:bin/ShowDVI" pathname||filename||".dvi"
UNLOCK
EXIT
END
UNLOCK /* I leave this as my scripts runs fine */
address "showdvi"
getfile
loadedfile = RESULT
getdir
loadeddir = RESULT
IF RIGHT(loadeddir,1)~=':' & RIGHT(loadeddir,1)~='/' THEN
loadeddir = loadeddir||'/'
IF loadeddir||loadedfile~=fullsrc THEN DO
loadnew fullsrc||".dvi"
tofront
activate
END
ELSE DO
tofront
activate
EXIT
END