emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100037: Fix bug#6999.


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100037: Fix bug#6999.
Date: Tue, 14 Sep 2010 00:15:06 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100037
committer: Glenn Morris <address@hidden>
branch nick: emacs-23
timestamp: Tue 2010-09-14 00:15:06 -0700
message:
  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.
modified:
  lisp/ChangeLog
  lisp/calendar/appt.el
  lisp/calendar/diary-lib.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-09-12 17:46:57 +0000
+++ b/lisp/ChangeLog    2010-09-14 07:15:06 +0000
@@ -1,3 +1,11 @@
+2010-09-14  Glenn Morris  <address@hidden>
+
+       * 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.
+       * calendar/appt.el (appt-update-list): Also check the members of
+       diary-included-files.  (Bug#6999)
+
 2010-09-12  David Reitter  <address@hidden>
 
        * simple.el (line-move-visual): Do not truncate goal column to

=== modified file 'lisp/calendar/appt.el'
--- a/lisp/calendar/appt.el     2010-06-15 03:42:33 +0000
+++ b/lisp/calendar/appt.el     2010-09-14 07:15:06 +0000
@@ -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)))

=== modified file 'lisp/calendar/diary-lib.el'
--- a/lisp/calendar/diary-lib.el        2010-08-14 02:23:56 +0000
+++ b/lisp/calendar/diary-lib.el        2010-09-14 07:15:06 +0000
@@ -699,6 +699,10 @@
              (1+ (calendar-absolute-from-gregorian gdate))))))
   (goto-char (point-min)))
 
+(defvar diary-including) ; dynamically bound in diary-include-other-diary-files
+(defvar diary-included-files nil
+  "List of any diary files included in the last call to `diary-list-entries'.")
+
 ;; FIXME non-greg and list hooks run same number of times?
 (defun diary-list-entries (date number &optional list-only)
   "Create and display a buffer containing the relevant lines in `diary-file'.
@@ -743,6 +747,8 @@
            (date-string (calendar-date-string date))
            (diary-buffer (find-buffer-visiting diary-file))
            diary-entries-list file-glob-attrs)
+      (or (bound-and-true-p diary-including)
+          (setq diary-included-files nil))
       (message "Preparing diary...")
       (save-current-buffer
         (if (not diary-buffer)
@@ -828,11 +834,15 @@
     (let ((diary-file (match-string-no-properties 1))
           (diary-list-entries-hook 'diary-include-other-diary-files)
           (diary-display-function 'ignore)
+          (diary-including t)
           diary-hook diary-list-include-blanks)
       (if (file-exists-p diary-file)
           (if (file-readable-p diary-file)
               (unwind-protect
-                  (setq diary-entries-list
+                  (setq diary-included-files
+                        (append diary-included-files
+                                (list (expand-file-name diary-file)))
+                        diary-entries-list
                         (append diary-entries-list
                                 (diary-list-entries original-date number)))
                 (with-current-buffer (find-buffer-visiting diary-file)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]