From: Juanma Barranquero Date: Thu, 14 Nov 2002 14:09:41 +0000 (+0000) Subject: calendar/diary-lib.el (make-diary-entry): Allow for local variables at end of X-Git-Tag: ttn-vms-21-2-B4~12463 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b8f2671f3560a413ab1fdbee369e78a17b4cc76f;p=emacs.git calendar/diary-lib.el (make-diary-entry): Allow for local variables at end of diary file. --- diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 2d16fe515ef..0b058a3bdfa 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -1457,7 +1457,15 @@ Do nothing if DATE or STRING is nil." 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 "")