• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching +defs:time +defs:list

33 ;; only one function there - `clean-buffer-list'. It will kill the
34 ;; buffers matching `clean-buffer-list-kill-buffer-names' and
35 ;; `clean-buffer-list-kill-regexps' and the buffers which where last
36 ;; displayed more than `clean-buffer-list-delay-general' days ago,
37 ;; keeping `clean-buffer-list-kill-never-buffer-names' and
38 ;; `clean-buffer-list-kill-never-regexps'.
55 the time when it is run.")
70 ;;; time conversion
72 (defun midnight-time-float (num)
73 "Convert the float number of seconds since epoch to the list of 3 integers."
75 (list 1st (floor (- num (* (float div) 1st)))
78 (defun midnight-buffer-display-time (&optional buffer)
79 "Return the time-stamp of BUFFER, or current buffer, as float."
81 (when buffer-display-time (float-time buffer-display-time))))
83 ;;; clean-buffer-list stuff
85 (defcustom clean-buffer-list-delay-general 3
87 The autokilling is done by `clean-buffer-list' when is it in `midnight-hook'.
89 matching `clean-buffer-list-kill-never-buffer-names' and
90 `clean-buffer-list-kill-never-regexps' are excluded."
94 (defcustom clean-buffer-list-delay-special 3600
96 Buffers matched by `clean-buffer-list-kill-regexps' and
97 `clean-buffer-list-kill-buffer-names' are killed if they were last
102 (defcustom clean-buffer-list-kill-regexps nil
104 If buffer name matches a regexp in the list and the buffer was not displayed
105 in the last `clean-buffer-list-delay-special' seconds, it is killed by
106 `clean-buffer-list' when is it in `midnight-hook'.
107 If a member of the list is a cons, its `car' is the regexp and its `cdr' is
108 the number of seconds to use instead of `clean-buffer-list-delay-special'.
109 See also `clean-buffer-list-kill-buffer-names',
110 `clean-buffer-list-kill-never-regexps' and
111 `clean-buffer-list-kill-never-buffer-names'."
115 (defcustom clean-buffer-list-kill-buffer-names
119 Buffers with names in this list, which were not displayed in the last
120 `clean-buffer-list-delay-special' seconds, are killed by `clean-buffer-list'
122 If a member of the list is a cons, its `car' is the name and its `cdr' is
123 the number of seconds to use instead of `clean-buffer-list-delay-special'.
124 See also `clean-buffer-list-kill-regexps',
125 `clean-buffer-list-kill-never-regexps' and
126 `clean-buffer-list-kill-never-buffer-names'."
130 (defcustom clean-buffer-list-kill-never-buffer-names
132 "*List of buffer names which will never be killed by `clean-buffer-list'.
133 See also `clean-buffer-list-kill-never-regexps'.
134 Note that this does override `clean-buffer-list-kill-regexps' and
135 `clean-buffer-list-kill-buffer-names' so a buffer matching any of these
136 two lists will NOT be killed if it is also present in this list."
140 (defcustom clean-buffer-list-kill-never-regexps '("^ \\*Minibuf-.*\\*$")
142 See also `clean-buffer-list-kill-never-buffer-names'.
143 Killing is done by `clean-buffer-list'.
144 Note that this does override `clean-buffer-list-kill-regexps' and
145 `clean-buffer-list-kill-buffer-names' so a buffer matching any of these
146 two lists will NOT be killed if it also matches anything in this list."
156 (defun clean-buffer-list-delay (name)
158 Uses `clean-buffer-list-kill-buffer-names', `clean-buffer-list-kill-regexps'
159 `clean-buffer-list-delay-general' and `clean-buffer-list-delay-special'.
160 Autokilling is done by `clean-buffer-list'."
161 (or (assoc-default name clean-buffer-list-kill-buffer-names 'string=
162 clean-buffer-list-delay-special)
163 (assoc-default name clean-buffer-list-kill-regexps 'string-match
164 clean-buffer-list-delay-special)
165 (* clean-buffer-list-delay-general 24 60 60)))
168 (defun clean-buffer-list ()
170 The relevant variables are `clean-buffer-list-delay-general',
171 `clean-buffer-list-delay-special', `clean-buffer-list-kill-buffer-names',
172 `clean-buffer-list-kill-never-buffer-names',
173 `clean-buffer-list-kill-regexps' and
174 `clean-buffer-list-kill-never-regexps'.
176 the current date/time, buffer name, how many seconds ago it was
180 (let ((tm (float-time)) bts (ts (format-time-string "%Y-%m-%d %T"))
182 (dolist (buf (buffer-list))
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))
187 (unless (or (midnight-find bn clean-buffer-list-kill-never-regexps
189 (midnight-find bn clean-buffer-list-kill-never-buffer-names
202 (defcustom midnight-hook '(clean-buffer-list)
204 The default value is `clean-buffer-list'."
210 (multiple-value-bind (sec min hrs) (decode-time)
223 (run-at-time (if (numberp tm) (+ (midnight-next) tm) tm)
231 first argument to `run-at-time'."