comparison lisp/midnight.el @ 90133:4da4a09e8b1b

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-31 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 206-222) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 45-52) - Update from CVS - Update from CVS: texi Makefile.in CVS keyw cruft - Update from CVS: ChangeLog tweaks
author Miles Bader <miles@gnu.org>
date Thu, 31 Mar 2005 09:58:14 +0000
parents 68c22ea6027c f775b8952a66
children 08185296b491
comparison
equal deleted inserted replaced
90132:4080fe8b4f0f 90133:4da4a09e8b1b
1 ;;; midnight.el --- run something every midnight, e.g., kill old buffers 1 ;;; midnight.el --- run something every midnight, e.g., kill old buffers
2 2
3 ;;; Copyright (C) 1998, 2004 Free Software Foundation, Inc. 3 ;;; Copyright (C) 1998, 2004, 2005 Free Software Foundation, Inc.
4 4
5 ;; Author: Sam Steingold <sds@usa.net> 5 ;; Author: Sam Steingold <sds@usa.net>
6 ;; Maintainer: Sam Steingold <sds@usa.net> 6 ;; Maintainer: Sam Steingold <sds@usa.net>
7 ;; Created: 1998-05-18 7 ;; Created: 1998-05-18
8 ;; Keywords: utilities 8 ;; Keywords: utilities
213 (defun midnight-delay-set (symb tm) 213 (defun midnight-delay-set (symb tm)
214 "Modify `midnight-timer' according to `midnight-delay'. 214 "Modify `midnight-timer' according to `midnight-delay'.
215 Sets the first argument SYMB (which must be symbol `midnight-delay') 215 Sets the first argument SYMB (which must be symbol `midnight-delay')
216 to its second argument TM." 216 to its second argument TM."
217 (assert (eq symb 'midnight-delay) t 217 (assert (eq symb 'midnight-delay) t
218 "Illegal argument to `midnight-delay-set': `%s'") 218 "Invalid argument to `midnight-delay-set': `%s'")
219 (set symb tm) 219 (set symb tm)
220 (when (timerp midnight-timer) (cancel-timer midnight-timer)) 220 (when (timerp midnight-timer) (cancel-timer midnight-timer))
221 (setq midnight-timer 221 (setq midnight-timer
222 (run-at-time (if (numberp tm) (+ (midnight-next) tm) tm) 222 (run-at-time (if (numberp tm) (+ (midnight-next) tm) tm)
223 midnight-period 'run-hooks 'midnight-hook))) 223 midnight-period 'run-hooks 'midnight-hook)))