From 94d1817dffc53403bf790a7eb55d25a8ec726ea8 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Thu, 10 Sep 1998 16:03:07 +0000 Subject: [PATCH] (mark-sexp-diary-entries): Avoid infinite loop when sexp entry ends at end of file with no newline. --- lisp/calendar/diary-lib.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 615040deba4..65f34c64474 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -842,7 +842,8 @@ is marked. See the documentation for the function `list-sexp-diary-entries'." (setq entry-start (point)) (re-search-forward "\^M\\|\n" nil t) (while (looking-at " \\|\^I") - (re-search-forward "\^M\\|\n" nil t)) + (or (re-search-forward "\^M\\|\n" nil t) + (re-search-forward "$" nil t))) (backward-char 1) (setq entry (buffer-substring-no-properties entry-start (point))) (while (string-match "[\^M]" entry) -- 2.39.2