From: Stefan Monnier Date: Wed, 16 Sep 2009 13:15:10 +0000 (+0000) Subject: (what-page): Make sure we don't inf-loop if X-Git-Tag: emacs-pretest-23.1.90~1293 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8f38189e4f1856e006611cc8c83fd88fc788e86d;p=emacs.git (what-page): Make sure we don't inf-loop if page-delimiter matches the empty string. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3a63754b137..37e4facd8a3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-09-16 Stefan Monnier + + * textmodes/page.el (what-page): Make sure we don't inf-loop if + page-delimiter matches the empty string. + 2009-09-16 Glenn Morris * emacs-lisp/bytecomp.el (byte-compile-not-obsolete-vars): Rename from diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el index 79976459ff6..7f52cf56ff8 100644 --- a/lisp/textmodes/page.el +++ b/lisp/textmodes/page.el @@ -153,6 +153,8 @@ thus showing a page other than the one point was originally in." (opoint (point))) (goto-char (point-min)) (while (re-search-forward page-delimiter opoint t) + (if (= (match-beginning 0) (match-end 0)) + (forward-char 1)) (setq count (1+ count))) (message "Page %d, line %d" count