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

Lines Matching refs:midnight

0 ;;; midnight.el --- run something every midnight, e.g., kill old buffers
30 ;; To use the file, put (require 'midnight) into your .emacs. Then, at
31 ;; midnight, Emacs will run the normal hook `midnight-hook'. You can
47 (defgroup midnight nil
48 "Run something every day at midnight."
52 (defvar midnight-timer nil
53 "Timer running the `midnight-hook' `midnight-delay' seconds after midnight.
54 Use `cancel-timer' to stop it and `midnight-delay-set' to change
57 (defcustom midnight-mode nil
58 "*Non-nil means run `midnight-hook' at midnight.
60 call `cancel-timer' or `timer-activate' on `midnight-timer' instead."
62 :group 'midnight
63 :require 'midnight
66 (set symb val) (require 'midnight)
67 (if val (timer-activate midnight-timer)
68 (cancel-timer midnight-timer))))
72 (defun midnight-time-float (num)
78 (defun midnight-buffer-display-time (&optional buffer)
87 The autokilling is done by `clean-buffer-list' when is it in `midnight-hook'.
92 :group 'midnight)
100 :group 'midnight)
103 "*List of regexps saying which buffers will be killed at midnight.
106 `clean-buffer-list' when is it in `midnight-hook'.
113 :group 'midnight)
118 "*List of strings saying which buffers will be killed at midnight.
121 when is it in `midnight-hook'.
128 :group 'midnight)
138 :group 'midnight)
141 "*List of regexp saying which buffers will never be killed at midnight.
148 :group 'midnight)
150 (defun midnight-find (el ls test &optional key)
184 (setq bts (midnight-buffer-display-time buf) bn (buffer-name buf)
187 (unless (or (midnight-find bn clean-buffer-list-kill-never-regexps
189 (midnight-find bn clean-buffer-list-kill-never-buffer-names
197 ;;; midnight hook
199 (defvar midnight-period (* 24 60 60)
200 "The number of seconds in a day--the delta for `midnight-timer'.")
202 (defcustom midnight-hook '(clean-buffer-list)
203 "The hook run `midnight-delay' seconds after midnight every day.
206 :group 'midnight)
208 (defun midnight-next ()
209 "Return the number of seconds till the next midnight."
214 (defun midnight-delay-set (symb tm)
215 "Modify `midnight-timer' according to `midnight-delay'.
216 Sets the first argument SYMB (which must be symbol `midnight-delay')
218 (assert (eq symb 'midnight-delay) t
219 "Invalid argument to `midnight-delay-set': `%s'")
221 (when (timerp midnight-timer) (cancel-timer midnight-timer))
222 (setq midnight-timer
223 (run-at-time (if (numberp tm) (+ (midnight-next) tm) tm)
224 midnight-period 'run-hooks 'midnight-hook)))
226 (defcustom midnight-delay 3600
227 "*The number of seconds after the midnight when the `midnight-timer' is run.
228 You should set this variable before loading midnight.el, or
229 set it by calling `midnight-delay-set', or use `custom'.
233 :set 'midnight-delay-set
234 :group 'midnight)
236 (provide 'midnight)
239 ;;; midnight.el ends here