;+
;
; @file_comments
; Kind of UNDO:
; Allows to redo all the chain of drawing since the opening of the last window without
; reexecute the last order Example: I do a drawing with 10 plot over it, if I make a
; mistake, I execute this program and i can redo the only plot missed.
;
; @categories
; utilities
;
; @restrictions
; compatible with \@ps
; \@vzoom text_box...
;
; @history
; Sebastien Masson (smasson\@lodyc.jussieu.fr)
;
; @version
; $Id$
;
; @todo
; seb
;
;-
;
;------------------------------------------------------------
; Close the journal!
;------------------------------------------------------------
journal
; we recuperate the journal as a vector of string:
vectjournal = getfile(myuniquetmpdir+'idlsave.pro')
; we cut the last line which is oups
vectjournal = vectjournal[0:n_elements(vectjournal)-2 ]
;------------------------------------------------------------
; we correct it if there is the need...
;------------------------------------------------------------
for i = 0, n_elements(vectjournal)-1 do $
if strpos(vectjournal[i],'text_box' ) EQ -1 then $
vectjournal[i] = strtrim(strcompress(vectjournal[i]), 2)
;2 line are identical ??
for i = 0, n_elements(vectjournal)-2 do $
if vectjournal[i] EQ vectjournal[i+1] then vectjournal[i] = ' '
for i = 0, n_elements(vectjournal)-1 do BEGIN & $
if strpos(vectjournal[i],'oups' ) NE -1 $
OR strpos(vectjournal[i],'Syntax error' ) NE -1 $
OR strpos(vectjournal[i],'Illegal character' ) NE -1 $
then BEGIN vectjournal[i] = ' ' & vectjournal[i-1] = ' ' & endif & $
if strpos(strtrim(vectjournal[i], 1),'retall' ) EQ 0 $
OR strpos(vectjournal[i],'@oups' ) NE -1 $
OR strpos(vectjournal[i],'@ps' ) NE -1 $
OR strpos(vectjournal[i],'@vzoom' ) NE -1 $
OR strpos(vectjournal[i],'help' ) NE -1 $
OR strpos(vectjournal[i],'print' ) NE -1 $
then vectjournal[i] = ' ' & $
if strpos(vectjournal[i],'text_box' ) NE -1 then $
vectjournal[i] = vectjournal[i]+strmid(vectjournal[i+1], 1) & endfor
;
; we erase the last line to reexecute all the programm but the last order.
;
IF strpos(vectjournal[n_elements(vectjournal)-1],';,pos=[' ) NE -1 then $
vectjournal[n_elements(vectjournal)-2] = '' $
ELSE vectjournal[n_elements(vectjournal)-1] = ''
; we rewrite idlsave.pro
putfile, myuniquetmpdir+'idlsave.pro', vectjournal
; update the list of .pro and .sav in !PATH
path_cache, /rebuild
; apply idlsave
@idlsave
; the journal has just been reopened, and we put elements of vectjournal in it.
for i = 0, n_elements(vectjournal)-1 DO $
journal, vectjournal[i]