home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
me34exe.zip
/
mutt
/
package
/
saveall.mut
< prev
next >
Wrap
Text File
|
1995-01-14
|
1KB
|
73 lines
(include me.mh)
(defun
save-all-buffers { (save-them-all FALSE) }
save-them-all (bool interruptable) HIDDEN
{
(int j cw bp flags)
(cw (current-buffer))
(for (j 0) (< j (buffers)) (+= j 1)
{
;; maybe quit early if user is typing
(if (and interruptable (key-waiting)) (break))
(bp (nth-buffer j))
(flags (buffer-flags bp))
(if (and
(!= "" (file-name bp))
(== 0 (bit-and BFNoCare flags))
(!= 0 (bit-and BFModified flags)))
{
(current-buffer bp)
(save-buffer)
})
})
(current-buffer cw)
}
)
(small-int save-tick)
(defun
MAIN
{
(save-tick 150) ;; default
}
idle-save-tick (int tick)
{
(if (== 1 (nargs)) (save-tick tick))
save-tick
}
save-when-idle
{
(int m s)
(if (and (not (arg-flag)) (unregister-hook IDLE-HOOK "idle-save"))
{
(msg "Saving when idle turned off.")
FALSE
}
{
(register-hook IDLE-HOOK "idle-save")
(if (arg-flag) (idle-save-tick (arg-prefix)))
(arg-flag FALSE 1) ;; reset arg count
(s (- save-tick (* 60 (m (/ save-tick 60)))))
(msg "Saving when idle set to about "
m " minutes, " s " seconds.")
TRUE
})
}
idle-save (int tick)
{
(if (== tick save-tick)
{
(save-them-all TRUE)
(update) ;; restore cursor
})
}
)