- (message "[%s] processing `%s'..." ts buf)
- (setq bts (buffer-display-time buf) bn (buffer-name buf))
- (unless (or ;; (string-match clean-buffer-list-kill-never bn)
- (midnight-find bn clean-buffer-list-kill-never-regexps
- 'string-match)
- (midnight-find bn clean-buffer-list-kill-never-buffer-names
- 'string-equal)
- (buffer-modified-p buf) (get-buffer-window buf 'visible)
- (null bts) (< (- tm bts) (clean-buffer-list-delay bn)))
- (message "[%s] killing `%s'" ts bn)
- (kill-buffer buf)))))
+ (when (buffer-live-p buf)
+ (setq bts (midnight-buffer-display-time buf) bn (buffer-name buf)
+ delay (if bts (- tm bts) 0) cbld (clean-buffer-list-delay bn))
+ (message "[%s] `%s' [%s %d]" ts bn (if bts (round delay)) cbld)
+ (unless (or (midnight-find bn clean-buffer-list-kill-never-regexps
+ 'string-match)
+ (midnight-find bn clean-buffer-list-kill-never-buffer-names
+ 'string-equal)
+ (get-buffer-process buf)
+ (and (buffer-file-name buf) (buffer-modified-p buf))
+ (get-buffer-window buf 'visible) (< delay cbld))
+ (message "[%s] killing `%s'" ts bn)
+ (kill-buffer buf))))))