summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2010-09-28 21:00:50 -0700
committerGlenn Morris <rgm@gnu.org>2010-09-28 21:00:50 -0700
commitd0de6cba6f2bc6ed9358a8f56fb25421e0e3471b (patch)
tree622bf154606e3c94ba46d01e89902f9af1c4d6d5 /lisp
parentc2828614add492327092a24cc5ec15ff84b4b8ee (diff)
downloademacs-d0de6cba6f2bc6ed9358a8f56fb25421e0e3471b.tar.gz
emacs-d0de6cba6f2bc6ed9358a8f56fb25421e0e3471b.tar.bz2
emacs-d0de6cba6f2bc6ed9358a8f56fb25421e0e3471b.zip
Minor diary include improvement.
* lisp/calendar/diary-lib.el (diary-include-other-diary-files): Trap some recursive includes.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/calendar/diary-lib.el16
2 files changed, 12 insertions, 7 deletions
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 <rgm@gnu.org>
+ * 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 <yamaoka@jpl.org>
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)