changeset 48312:67f6a633fe52

calendar/diary-lib.el (make-diary-entry): Allow for local variables at end of diary file.
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 14 Nov 2002 14:09:41 +0000
parents fb6393f7b62a
children 85a91bbe8e45
files lisp/calendar/diary-lib.el
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/diary-lib.el	Thu Nov 14 14:09:36 2002 +0000
+++ b/lisp/calendar/diary-lib.el	Thu Nov 14 14:09:41 2002 +0000
@@ -1457,7 +1457,15 @@
 If omitted, NONMARKING defaults to nil and FILE defaults to diary-file."
   (find-file-other-window
    (substitute-in-file-name (if file file diary-file)))
+  (widen)
   (goto-char (point-max))
+  (when (let ((case-fold-search t))
+          (search-backward "Local Variables:"
+                           (max (- (point-max) 3000) (point-min))
+                           t))
+    (beginning-of-line)
+    (insert "\n")
+    (previous-line 1))
   (insert
    (if (bolp) "" "\n")
    (if nonmarking diary-nonmarking-symbol "")