From: Karl Heuer Date: Thu, 10 Sep 1998 16:03:07 +0000 (+0000) Subject: (mark-sexp-diary-entries): Avoid infinite loop when X-Git-Tag: emacs-20.4~1717 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=94d1817dffc53403bf790a7eb55d25a8ec726ea8;p=emacs.git (mark-sexp-diary-entries): Avoid infinite loop when sexp entry ends at end of file with no newline. --- 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)