host info updates
[distro-setup] / unsaved-buffers.el
1 ;; print buffers unsaved, unless within "seconds" below
2
3 ;; for example running, see system-stat
4
5 (format "%s"
6 (-reduce-from
7 (lambda (acc buf)
8 (let ((bpath (buffer-file-name buf)))
9 (if (and bpath
10 (buffer-modified-p buf))
11 (cons bpath acc )
12 acc)))
13 nil (buffer-list))
14 )
15
16 ;; put into
17 ;; (format "%s" (-reduce-from (lambda (acc buf) (let ((bpath (buffer-file-name buf))) (if (and bpath (buffer-modified-p buf)) (cons bpath acc ) acc))) nil (buffer-list)))
18
19
20 ;;
21 ;; Previously, I used a condition to check only for files not saved
22 ;; which had mod times > 60 seconds. However, using it my system status
23 ;; script meant stating a lot of files over and over, which eventually
24 ;; caused some lag, so I abandoned it.
25 ;;