Mercurial > emacs
comparison lisp/calendar/appt.el @ 110632:081b4ec99498
* lisp/calendar/appt.el (appt-check): Minor simplification.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Mon, 27 Sep 2010 20:00:09 -0700 |
parents | b799d38f522a |
children | e82d503da7c2 |
comparison
equal
deleted
inserted
replaced
110631:220a54524e9f | 110632:081b4ec99498 |
---|---|
333 ;; At first check in any day, update appointments to today's list. | 333 ;; At first check in any day, update appointments to today's list. |
334 (if (or force ; eg initialize, diary save | 334 (if (or force ; eg initialize, diary save |
335 (null appt-prev-comp-time) ; first check | 335 (null appt-prev-comp-time) ; first check |
336 (< cur-comp-time appt-prev-comp-time)) ; new day | 336 (< cur-comp-time appt-prev-comp-time)) ; new day |
337 (ignore-errors | 337 (ignore-errors |
338 (if appt-display-diary | 338 (let ((diary-hook (if (assoc 'appt-make-list diary-hook) |
339 (let ((diary-hook | 339 diary-hook |
340 (if (assoc 'appt-make-list diary-hook) | 340 (cons 'appt-make-list diary-hook))) |
341 diary-hook | 341 d-buff d-buff2) |
342 (cons 'appt-make-list diary-hook)))) | 342 (if appt-display-diary |
343 (diary)) | 343 (diary) |
344 (let* ((diary-display-function 'appt-make-list) | 344 (setq d-buff (find-buffer-visiting diary-file)) |
345 (d-buff (find-buffer-visiting diary-file)) | |
346 (selective | |
347 (if d-buff ; diary buffer exists | |
348 (with-current-buffer d-buff | |
349 diary-selective-display))) | |
350 d-buff2) | |
351 ;; Not displaying the diary, so we can ignore | 345 ;; Not displaying the diary, so we can ignore |
352 ;; diary-number-of-entries. Since appt.el only | 346 ;; diary-number-of-entries. Since appt.el only |
353 ;; works on a daily basis, no need for more entries. | 347 ;; works on a daily basis, no need for more entries. |
354 ;; FIXME why not using diary-list-entries with | 348 (diary-list-entries (calendar-current-date) 1 t) |
355 ;; non-nil LIST-ONLY? | 349 ;; If diary buffer did not exist before this command, kill it. |
356 (diary 1) | 350 ;; FIXME does not kill any included diary files. |
357 ;; If the diary buffer existed before this command, | 351 ;; The real issue is that (diary) should not have |
358 ;; restore its display state. Otherwise, kill it. | 352 ;; the side effect of visiting all the diary files. |
359 (and (setq d-buff2 (find-buffer-visiting diary-file)) | 353 ;; It is not really appt.el's job to clean up this mess... |
360 (if d-buff | 354 (and (not d-buff) |
361 (or selective | 355 (setq d-buff2 (find-buffer-visiting diary-file)) |
362 (with-current-buffer d-buff2 | 356 (kill-buffer d-buff2)))))) |
363 (if diary-selective-display | |
364 ;; diary-show-all-entries displays | |
365 ;; the diary buffer. | |
366 (diary-unhide-everything)))) | |
367 ;; FIXME does not kill any included diary files. | |
368 ;; The real issue is that (diary) should not | |
369 ;; have the side effect of visiting all the | |
370 ;; diary files. It is not really appt.el's job to | |
371 ;; clean up this mess... | |
372 (kill-buffer d-buff2))))))) | |
373 (setq appt-prev-comp-time cur-comp-time | 357 (setq appt-prev-comp-time cur-comp-time |
374 appt-mode-string nil | 358 appt-mode-string nil |
375 appt-display-count nil) | 359 appt-display-count nil) |
376 ;; If there are entries in the list, and the user wants a | 360 ;; If there are entries in the list, and the user wants a |
377 ;; message issued, get the first time off of the list and | 361 ;; message issued, get the first time off of the list and |