From: Glenn Morris Date: Wed, 29 Sep 2010 04:00:50 +0000 (-0700) Subject: Minor diary include improvement. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~47^2~15 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d0de6cba6f2bc6ed9358a8f56fb25421e0e3471b;p=emacs.git Minor diary include improvement. * lisp/calendar/diary-lib.el (diary-include-other-diary-files): Trap some recursive includes. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b645e41f5d5..24a359cea77 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2010-09-29 Glenn Morris + * calendar/diary-lib.el (diary-include-other-diary-files): + Trap some recursive includes. + * calendar/appt.el (appt-activate): Check diary file. 2010-09-29 Katsumi Yamaoka diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 219e489a2eb..ae244e0a1b6 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -848,16 +848,18 @@ the variable `diary-include-string'." (diary-list-entries-hook 'diary-include-other-diary-files) (diary-display-function 'ignore) (diary-including t) - diary-hook diary-list-include-blanks) + diary-hook diary-list-include-blanks efile) (if (file-exists-p diary-file) (if (file-readable-p diary-file) (unwind-protect - (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))) + (if (member (setq efile (expand-file-name diary-file)) + diary-included-files) + (error "Recursive diary include for %s" diary-file) + (setq diary-included-files + (append diary-included-files (list efile)) + diary-entries-list + (append diary-entries-list + (diary-list-entries original-date number)))) (with-current-buffer (find-buffer-visiting diary-file) (diary-unhide-everything))) (beep)