diff lisp/calendar/appt.el @ 110352:7c4d14415111

Fix bug#6999. * lisp/calendar/diary-lib.el (diary-included-files): New variable. (diary-list-entries): Maybe initialize diary-included-files. (diary-include-other-diary-files): Append to diary-included-files. * lisp/calendar/appt.el (appt-update-list): Also check the members of diary-included-files.
author Glenn Morris <rgm@gnu.org>
date Tue, 14 Sep 2010 00:15:06 -0700
parents ccf6e90ae542
children 5f841657c901
line wrap: on
line diff
--- a/lisp/calendar/appt.el	Sun Sep 12 13:46:57 2010 -0400
+++ b/lisp/calendar/appt.el	Tue Sep 14 00:15:06 2010 -0700
@@ -345,6 +345,8 @@
                           (if d-buff    ; diary buffer exists
                               (with-current-buffer d-buff
                                 diary-selective-display))))
+                    ;; FIXME why not using diary-list-entries with
+                    ;; non-nil LIST-ONLY?
                     (diary)
                     ;; If the diary buffer existed before this command,
                     ;; restore its display state.  Otherwise, kill it.
@@ -642,8 +644,10 @@
 
 (defun appt-update-list ()
   "If the current buffer is visiting the diary, update appointments.
-This function is intended for use with `write-file-functions'."
-  (and (string-equal buffer-file-name (expand-file-name diary-file))
+This function also acts on any file listed in `diary-included-files'.
+It is intended for use with `write-file-functions'."
+  (and (member buffer-file-name (append diary-included-files
+                                        (list (expand-file-name diary-file))))
        appt-timer
        (let ((appt-display-diary nil))
          (appt-check t)))