[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autosave.lisp enhancement in contrib/



I've posted an enhanced version of autosave.lisp to the contrib directory
on cambridge.apple.com.  Here is a copy of the header of the file.  Enjoy!

-Kemi

;;;-------------------------------------------------------------------------
--
;;;  A U T O S A V E
;;;-------------------------------------------------------------------------
--
#|

Most of the original code is from a posting by:

From: Bill St. Clair <bill@cambridge.apple.com>
Subject: Re: Autosave Feature (and the lack thereof) 
Date: Wed, 26 Jun 91 17:05:09 -0400

Modifications by Kemi Jona (jona@ils.nwu.edu) Feb/March 1992:

- now is more like EMACS autosave
- files autosaved with an appended ~
- autosave files deleted when original file is saved
- prompt when opening up a file with a newer autosave file

Note:  this file defines an AROUND method for FRED-WINDOW's
INITIALIZE-INSTANCE and and AFTER method for FRED-WINDOW's WINDOW-SAVE.
If either of these methods are already defined, you will be
prompted before they get clobbered by this file.

I like this method of autosaving because it doesn't clobber your
original file.  This allows you to revert to a saved version if you
break something and want the old version back, but still have the
security of having your worked saved periodically.

Under normal operation, there shouldn't be any leftover autosave
files (except if you crash, in which case you want them!).  If for some
reason 
there are, I've included a function to clean them out of a directory. 
The function is called AUTOSAVE-CLEAN-DIRECTORY.

Please post enhancements to cambridge.apple.com, /pub/MCL2/contrib/.
Some things that need work: erase autosave file when reverting window
or doing a Save as.

To use: save this file as autosave.lisp in the library folder and put the
following
in your init.lisp file:

(load "ccl:library;autosave")
(set-auto-save-period 5)                      ; or whatever you want

The argument to SET-AUTO-SAVE-PERIOD is the number of minutes between
autosaves.