aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-09-14 00:15:06 -0700
committerGlenn Morris2010-09-14 00:15:06 -0700
commit92b99a01de828c4bf81b465f1b1b2e9e06b0d96d (patch)
tree10b5ccdafb1b19ead66f71b6218cbc74be7f3848
parent5a66ed0f659b03419e0aab65a7841211f82af545 (diff)
downloademacs-92b99a01de828c4bf81b465f1b1b2e9e06b0d96d.tar.gz
emacs-92b99a01de828c4bf81b465f1b1b2e9e06b0d96d.zip
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.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/calendar/appt.el8
-rw-r--r--lisp/calendar/diary-lib.el12
3 files changed, 25 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8ac5a4a4351..103d6406629 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12010-09-14 Glenn Morris <rgm@gnu.org>
2
3 * calendar/diary-lib.el (diary-included-files): New variable.
4 (diary-list-entries): Maybe initialize diary-included-files.
5 (diary-include-other-diary-files): Append to diary-included-files.
6 * calendar/appt.el (appt-update-list): Also check the members of
7 diary-included-files. (Bug#6999)
8
12010-09-12 David Reitter <david.reitter@gmail.com> 92010-09-12 David Reitter <david.reitter@gmail.com>
2 10
3 * simple.el (line-move-visual): Do not truncate goal column to 11 * simple.el (line-move-visual): Do not truncate goal column to
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index 7fcaab9da34..08184922e79 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -345,6 +345,8 @@ displayed in a window:
345 (if d-buff ; diary buffer exists 345 (if d-buff ; diary buffer exists
346 (with-current-buffer d-buff 346 (with-current-buffer d-buff
347 diary-selective-display)))) 347 diary-selective-display))))
348 ;; FIXME why not using diary-list-entries with
349 ;; non-nil LIST-ONLY?
348 (diary) 350 (diary)
349 ;; If the diary buffer existed before this command, 351 ;; If the diary buffer existed before this command,
350 ;; restore its display state. Otherwise, kill it. 352 ;; restore its display state. Otherwise, kill it.
@@ -642,8 +644,10 @@ hour and minute parts."
642 644
643(defun appt-update-list () 645(defun appt-update-list ()
644 "If the current buffer is visiting the diary, update appointments. 646 "If the current buffer is visiting the diary, update appointments.
645This function is intended for use with `write-file-functions'." 647This function also acts on any file listed in `diary-included-files'.
646 (and (string-equal buffer-file-name (expand-file-name diary-file)) 648It is intended for use with `write-file-functions'."
649 (and (member buffer-file-name (append diary-included-files
650 (list (expand-file-name diary-file))))
647 appt-timer 651 appt-timer
648 (let ((appt-display-diary nil)) 652 (let ((appt-display-diary nil))
649 (appt-check t))) 653 (appt-check t)))
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 39354bd31e3..83b49e91e76 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -699,6 +699,10 @@ of the appropriate type."
699 (1+ (calendar-absolute-from-gregorian gdate)))))) 699 (1+ (calendar-absolute-from-gregorian gdate))))))
700 (goto-char (point-min))) 700 (goto-char (point-min)))
701 701
702(defvar diary-including) ; dynamically bound in diary-include-other-diary-files
703(defvar diary-included-files nil
704 "List of any diary files included in the last call to `diary-list-entries'.")
705
702;; FIXME non-greg and list hooks run same number of times? 706;; FIXME non-greg and list hooks run same number of times?
703(defun diary-list-entries (date number &optional list-only) 707(defun diary-list-entries (date number &optional list-only)
704 "Create and display a buffer containing the relevant lines in `diary-file'. 708 "Create and display a buffer containing the relevant lines in `diary-file'.
@@ -743,6 +747,8 @@ LIST-ONLY is non-nil, in which case it just returns the list."
743 (date-string (calendar-date-string date)) 747 (date-string (calendar-date-string date))
744 (diary-buffer (find-buffer-visiting diary-file)) 748 (diary-buffer (find-buffer-visiting diary-file))
745 diary-entries-list file-glob-attrs) 749 diary-entries-list file-glob-attrs)
750 (or (bound-and-true-p diary-including)
751 (setq diary-included-files nil))
746 (message "Preparing diary...") 752 (message "Preparing diary...")
747 (save-current-buffer 753 (save-current-buffer
748 (if (not diary-buffer) 754 (if (not diary-buffer)
@@ -828,11 +834,15 @@ the variable `diary-include-string'."
828 (let ((diary-file (match-string-no-properties 1)) 834 (let ((diary-file (match-string-no-properties 1))
829 (diary-list-entries-hook 'diary-include-other-diary-files) 835 (diary-list-entries-hook 'diary-include-other-diary-files)
830 (diary-display-function 'ignore) 836 (diary-display-function 'ignore)
837 (diary-including t)
831 diary-hook diary-list-include-blanks) 838 diary-hook diary-list-include-blanks)
832 (if (file-exists-p diary-file) 839 (if (file-exists-p diary-file)
833 (if (file-readable-p diary-file) 840 (if (file-readable-p diary-file)
834 (unwind-protect 841 (unwind-protect
835 (setq diary-entries-list 842 (setq diary-included-files
843 (append diary-included-files
844 (list (expand-file-name diary-file)))
845 diary-entries-list
836 (append diary-entries-list 846 (append diary-entries-list
837 (diary-list-entries original-date number))) 847 (diary-list-entries original-date number)))
838 (with-current-buffer (find-buffer-visiting diary-file) 848 (with-current-buffer (find-buffer-visiting diary-file)