comparison lisp/midnight.el @ 24149:123fd862314c

(clean-buffer-list): do not kill a buffer if it has a process associated with it.
author Karl Heuer <kwzh@gnu.org>
date Fri, 22 Jan 1999 21:58:42 +0000
parents f6d920229f4c
children 32fd8c1e4e51
comparison
equal deleted inserted replaced
24148:b69751ec40fe 24149:123fd862314c
176 While processing buffers, this procedure displays messages containing 176 While processing buffers, this procedure displays messages containing
177 the current date/time, buffer name, how many seconds ago it was 177 the current date/time, buffer name, how many seconds ago it was
178 displayed (can be nil if the buffer was never displayed) and its 178 displayed (can be nil if the buffer was never displayed) and its
179 lifetime, i.e., its \"age\" when it will be purged." 179 lifetime, i.e., its \"age\" when it will be purged."
180 (interactive) 180 (interactive)
181 (let ((tm (midnight-float-time)) bts (ts (format-time-string "%Y-%m-%d %T")) bn 181 (let ((tm (midnight-float-time)) bts (ts (format-time-string "%Y-%m-%d %T"))
182 (bufs (buffer-list)) buf delay cbld) 182 (bufs (buffer-list)) buf delay cbld bn)
183 (while (setq buf (pop bufs)) 183 (while (setq buf (pop bufs))
184 (setq bts (midnight-buffer-display-time buf) bn (buffer-name buf) 184 (setq bts (midnight-buffer-display-time buf) bn (buffer-name buf)
185 delay (if bts (- tm bts) 0) cbld (clean-buffer-list-delay bn)) 185 delay (if bts (- tm bts) 0) cbld (clean-buffer-list-delay bn))
186 (message "[%s] `%s' [%s %d]" ts bn (if bts (round delay)) cbld) 186 (message "[%s] `%s' [%s %d]" ts bn (if bts (round delay)) cbld)
187 (unless (or (midnight-find bn clean-buffer-list-kill-never-regexps 187 (unless (or (midnight-find bn clean-buffer-list-kill-never-regexps
188 'string-match) 188 'string-match)
189 (midnight-find bn clean-buffer-list-kill-never-buffer-names 189 (midnight-find bn clean-buffer-list-kill-never-buffer-names
190 'string-equal) 190 'string-equal)
191 (get-buffer-process buf)
191 (and (buffer-file-name buf) (buffer-modified-p buf)) 192 (and (buffer-file-name buf) (buffer-modified-p buf))
192 (get-buffer-window buf 'visible) (< delay cbld)) 193 (get-buffer-window buf 'visible) (< delay cbld))
193 (message "[%s] killing `%s'" ts bn) 194 (message "[%s] killing `%s'" ts bn)
194 (kill-buffer buf))))) 195 (kill-buffer buf)))))
195 196