--- /dev/null
+;; print buffers unsaved, unless within "seconds" below
+
+;; run with
+;; emacsclient --eval "$(cat /a/bin/ds/unsaved-buffers.el)" | sed 's/^..//;s/..$//'
+
+
+(format "%s"
+ (-reduce-from
+ (lambda (acc buf)
+ (let ((seconds 60)
+ (bpath (buffer-file-name buf)))
+ (if (and bpath
+ (buffer-modified-p buf)
+ (time-less-p
+ (file-attribute-modification-time (file-attributes bpath))
+ (time-add (current-time) (- seconds))))
+ (cons bpath acc )
+ acc)))
+ nil (buffer-list))
+ )