;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:48:13 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/midnight.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`midnight.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\302\303\304\305\306\307\310\311&\207" [require timer custom-declare-group midnight nil "Run something every day at midnight." :group calendar :version "20.3"] 8)
#@173 *Non-nil means run `midnight-hook' at midnight.
Setting this variable outside customize has no effect;
call `cancel-timer' or `timer-activate' on `midnight-timer' instead.
(custom-declare-variable 'midnight-mode 'nil '(#$ . -808) :type 'boolean :group 'midnight :require 'midnight :initialize 'custom-initialize-default :set (lambda (symb val) (set symb val) (require 'midnight) (if val (timer-activate midnight-timer) (cancel-timer midnight-timer))))
#@76 Convert the float number of seconds since epoch to the list of 3 integers.
(defalias 'midnight-time-float #[(num) "\303\304\305\"\306	\"\211\306	\307!\n_Z!\310\311	\304\"\312_!E*\207" [div num 1st ash 1 16 floor float round mod 10000000] 7 (#$ . 1266)])
#@73 Return the time-stamp of the given buffer, or current buffer, as float.
(defalias 'midnight-buffer-display-time #[(&optional buf) "r\206 pq\210	\205 \302	!)\207" [buf buffer-display-time float-time] 2 (#$ . 1530)])
#@335 *The number of days before any buffer becomes eligible for autokilling.
The autokilling is done by `clean-buffer-list' when is it in `midnight-hook'.
Currently displayed and/or modified (unsaved) buffers, as well as buffers
matching `clean-buffer-list-kill-never-buffer-names' and
`clean-buffer-list-kill-never-regexps' are excluded.
(custom-declare-variable 'clean-buffer-list-delay-general '3 '(#$ . -1755) :type 'integer :group 'midnight)
#@243 *The number of seconds before some buffers become eligible for autokilling.
Buffers matched by `clean-buffer-list-kill-regexps' and
`clean-buffer-list-kill-buffer-names' are killed if they were last
displayed more than this many seconds ago.
(custom-declare-variable 'clean-buffer-list-delay-special '3600 '(#$ . -2204) :type 'integer :group 'midnight)
#@553 *List of regexps saying which buffers will be killed at midnight.
If buffer name matches a regexp in the list and the buffer was not displayed
in the last `clean-buffer-list-delay-special' seconds, it is killed by
`clean-buffer-list' when is it in `midnight-hook'.
If a member of the list is a cons, its `car' is the regexp and its `cdr' is
the number of seconds to use instead of `clean-buffer-list-delay-special'.
See also `clean-buffer-list-kill-buffer-names',
`clean-buffer-list-kill-never-regexps' and
`clean-buffer-list-kill-never-buffer-names'.
(custom-declare-variable 'clean-buffer-list-kill-regexps 'nil '(#$ . -2564) :type '(repeat (regexp :tag "Regexp matching Buffer Name")) :group 'midnight)
#@525 *List of strings saying which buffers will be killed at midnight.
Buffers with names in this list, which were not displayed in the last
`clean-buffer-list-delay-special' seconds, are killed by `clean-buffer-list'
when is it in `midnight-hook'.
If a member of the list is a cons, its `car' is the name and its `cdr' is
the number of seconds to use instead of `clean-buffer-list-delay-special'.
See also `clean-buffer-list-kill-regexps',
`clean-buffer-list-kill-never-regexps' and
`clean-buffer-list-kill-never-buffer-names'.
(custom-declare-variable 'clean-buffer-list-kill-buffer-names ''("*Help*" "*Apropos*" "*Man " "*Buffer List*" "*Compile-Log*" "*info*" "*vc*" "*vc-diff*" "*diff*") '(#$ . -3277) :type '(repeat (string :tag "Buffer Name")) :group 'midnight)
#@326 *List of buffer names which will never be killed by `clean-buffer-list'.
See also `clean-buffer-list-kill-never-regexps'.
Note that this does override `clean-buffer-list-kill-regexps' and
`clean-buffer-list-kill-buffer-names' so a buffer matching any of these
two lists will NOT be killed if it is also present in this list.
(custom-declare-variable 'clean-buffer-list-kill-never-buffer-names ''("*scratch*" "*Messages*") '(#$ . -4048) :type '(repeat (string :tag "Buffer Name")) :group 'midnight)
#@375 *List of regexp saying which buffers will never be killed at midnight.
See also `clean-buffer-list-kill-never-buffer-names'.
Killing is done by `clean-buffer-list'.
Note that this does override `clean-buffer-list-kill-regexps' and
`clean-buffer-list-kill-buffer-names' so a buffer matching any of these
two lists will NOT be killed if it also matches anything in this list.
(custom-declare-variable 'clean-buffer-list-kill-never-regexps ''("^ \\*Minibuf-.*\\*$") '(#$ . -4553) :type '(repeat (regexp :tag "Regexp matching Buffer Name")) :group 'midnight)
#@55 A stopgap solution to the absence of `find' in ELisp.
(defalias 'midnight-find #[(el ls test &optional key) "\300\301\215\207" [--cl-block-nil-- (byte-code "\306\211\203( \n@\f\203 \f	!\202 	\"\203! \307\310	\"\210\nA\211\204 *\306\207" [ls rr #1=#:--dolist-temp--97269 test key el nil throw --cl-block-nil--] 4)] 2 (#$ . 5114)])
#@261 Return the delay, in seconds, before killing a buffer named NAME.
Uses `clean-buffer-list-kill-buffer-names', `clean-buffer-list-kill-regexps'
`clean-buffer-list-delay-general' and `clean-buffer-list-delay-special'.
Autokilling is done by `clean-buffer-list'.
(defalias 'clean-buffer-list-delay #[(name) "\305	\306\n$\206 \305\307\n$\206 \f\310_\207" [name clean-buffer-list-kill-buffer-names clean-buffer-list-delay-special clean-buffer-list-kill-regexps clean-buffer-list-delay-general assoc-default string= string-match 86400] 5 (#$ . 5461)])
#@564 Kill old buffers that have not been displayed recently.
The relevant variables are `clean-buffer-list-delay-general',
`clean-buffer-list-delay-special', `clean-buffer-list-kill-buffer-names',
`clean-buffer-list-kill-never-buffer-names',
`clean-buffer-list-kill-regexps' and
`clean-buffer-list-kill-never-regexps'.
While processing buffers, this procedure displays messages containing
the current date/time, buffer name, how many seconds ago it was
displayed (can be nil if the buffer was never displayed) and its
lifetime, i.e., its "age" when it will be purged.
(defalias 'clean-buffer-list #[nil "\306 \307\310\311!\312 \307\211\211\211\f\211A@\211\205\211 \313!\314!\2036 Z\2027 \315\316!\317\320\205H \321\n!	%\210\322\323#\204 \322\324#\204 \325!\204 \326!\203o \327!\204 \330\331\"\204 \n	W\204 \317\332#\210\333!\210\202 .\207" [bn cbld delay buf bufs ts float-time nil format-time-string "%Y-%m-%d %T" buffer-list midnight-buffer-display-time buffer-name 0 clean-buffer-list-delay message "[%s] `%s' [%s %d]" round midnight-find string-match string-equal get-buffer-process buffer-file-name buffer-modified-p get-buffer-window visible "[%s] killing `%s'" kill-buffer bts tm clean-buffer-list-kill-never-regexps clean-buffer-list-kill-never-buffer-names] 8 (#$ . 6019) nil])
#@65 The number of seconds in a day--the delta for `midnight-timer'.
(defvar midnight-period (+ 86400 0) (#$ . 7358))
#@107 The hook run `midnight-delay' seconds after midnight every day.
The default value is `clean-buffer-list'.
(custom-declare-variable 'midnight-hook ''(clean-buffer-list) '(#$ . 7478) :type 'hook :group 'midnight)
#@54 Return the number of seconds till the next midnight.
(defalias 'midnight-next #[nil "\304 \211@A@\3058\306\307\\\310_Z\n\311_Z	Z,\207" [#1=#:G97270 sec min hrs decode-time 2 86400 0 3600 60] 4 (#$ . 7695)])
#@166 Timer running the `midnight-hook' `midnight-delay' seconds after midnight.
Use `cancel-timer' to stop it and `midnight-delay-set' to change
the time when it is run.
(defvar midnight-timer nil (#$ . 7916))
#@152 Modify `midnight-timer' according to `midnight-delay'.
Sets the first argument SYMB (which must be symbol `midnight-delay')
to its second argument TM.
(defalias 'midnight-delay-set #[(symb tm) "\304=\204\f \305\306\211#\210	L\210\307\n!\203 \310\n!\210\311	\247\203' \312 	\\\202( 	\313\314$\211\207" [symb tm midnight-timer midnight-period midnight-delay error "Illegal argument to `midnight-delay-set': `%s'" timerp cancel-timer run-at-time midnight-next run-hooks midnight-hook] 5 (#$ . 8128)])
#@295 *The number of seconds after the midnight when the `midnight-timer' is run.
You should set this variable before loading midnight.el, or
set it by calling `midnight-delay-set', or use `custom'.
If you wish, you can use a string instead, it will be passed as the
first argument to `run-at-time'.
(custom-declare-variable 'midnight-delay '3600 '(#$ . -8639) :type 'sexp :set 'midnight-delay-set :group 'midnight)
(provide 'midnight)
