comparison lisp/calendar/appt.el @ 110377:6dcf9897d91a

merge trunk
author Kenichi Handa <handa@m17n.org>
date Thu, 16 Sep 2010 11:11:13 +0900
parents 41bf9b6f3b91
children b799d38f522a
comparison
equal deleted inserted replaced
110376:cc92458a9829 110377:6dcf9897d91a
46 ;; 46 ;;
47 ;; Today's appointment list is initialized from the diary when this 47 ;; Today's appointment list is initialized from the diary when this
48 ;; package is activated. Additionally, the appointments list is 48 ;; package is activated. Additionally, the appointments list is
49 ;; recreated automatically at 12:01am for those who do not logout 49 ;; recreated automatically at 12:01am for those who do not logout
50 ;; every day or are programming late. It is also updated when the 50 ;; every day or are programming late. It is also updated when the
51 ;; `diary-file' is saved. Calling `appt-check' with an argument (or 51 ;; `diary-file' (or a file it includes) is saved. Calling
52 ;; re-enabling the package) forces a re-initialization at any time. 52 ;; `appt-check' with an argument (or re-enabling the package) forces a
53 ;; re-initialization at any time.
53 ;; 54 ;;
54 ;; In order to add or delete items from today's list, without 55 ;; In order to add or delete items from today's list, without
55 ;; changing the diary file, use `appt-add' and `appt-delete'. 56 ;; changing the diary file, use `appt-add' and `appt-delete'.
56 ;; 57 ;;
57 58
260 261
261 (defun appt-check (&optional force) 262 (defun appt-check (&optional force)
262 "Check for an appointment and update any reminder display. 263 "Check for an appointment and update any reminder display.
263 If optional argument FORCE is non-nil, reparse the diary file for 264 If optional argument FORCE is non-nil, reparse the diary file for
264 appointments. Otherwise the diary file is only parsed once per day, 265 appointments. Otherwise the diary file is only parsed once per day,
265 and when saved. 266 or when it (or a file it includes) is saved.
266 267
267 Note: the time must be the first thing in the line in the diary 268 Note: the time must be the first thing in the line in the diary
268 for a warning to be issued. The format of the time can be either 269 for a warning to be issued. The format of the time can be either
269 24 hour or am/pm. For example: 270 24 hour or am/pm. For example:
270 271
344 (d-buff (find-buffer-visiting diary-file)) 345 (d-buff (find-buffer-visiting diary-file))
345 (selective 346 (selective
346 (if d-buff ; diary buffer exists 347 (if d-buff ; diary buffer exists
347 (with-current-buffer d-buff 348 (with-current-buffer d-buff
348 diary-selective-display)))) 349 diary-selective-display))))
350 ;; FIXME why not using diary-list-entries with
351 ;; non-nil LIST-ONLY?
349 (diary) 352 (diary)
350 ;; If the diary buffer existed before this command, 353 ;; If the diary buffer existed before this command,
351 ;; restore its display state. Otherwise, kill it. 354 ;; restore its display state. Otherwise, kill it.
352 (if d-buff 355 (if d-buff
353 ;; Displays the diary buffer. 356 ;; Displays the diary buffer.
641 ;; Convert the actual time into minutes. 644 ;; Convert the actual time into minutes.
642 (+ (* hr 60) min))) 645 (+ (* hr 60) min)))
643 646
644 (defun appt-update-list () 647 (defun appt-update-list ()
645 "If the current buffer is visiting the diary, update appointments. 648 "If the current buffer is visiting the diary, update appointments.
646 This function is intended for use with `write-file-functions'." 649 This function also acts on any file listed in `diary-included-files'.
647 (and (string-equal buffer-file-name (expand-file-name diary-file)) 650 It is intended for use with `write-file-functions'."
651 (and (member buffer-file-name (append diary-included-files
652 (list (expand-file-name diary-file))))
648 appt-timer 653 appt-timer
649 (let ((appt-display-diary nil)) 654 (let ((appt-display-diary nil))
650 (appt-check t))) 655 (appt-check t)))
651 nil) 656 nil)
652 657