home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
editor
/
me_cd.arc
/
BACKUP.MUT
< prev
next >
Wrap
Text File
|
1988-08-11
|
580b
|
21 lines
; Make a back when trying to save
; Note: Make sure you add (init-backup) to buffer-created-hook
; Usually (bind-to-key "backup-then-save" "^X^S")
; C Durland
(defun
backup-then-save
{
(string bname 100)
(if (and (!= (buffer-var 9) 0)(buffer-modified -1)(!= (file-name) ""))
{
(bname (file-name))
(RE-string '\([^.]*\)' (buffer-name -1))
(bname (concat "/" (get-matched '\1') ".BAK"))
(write-file bname)(buffer-modified -1 TRUE)
(buffer-var 9 0)
})
(save-buffer)
}
init-backup {(buffer-var 9 1)}
)