]> code.delx.au - gnu-emacs/commitdiff
(what-page): Make sure we don't inf-loop if
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 16 Sep 2009 13:15:10 +0000 (13:15 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 16 Sep 2009 13:15:10 +0000 (13:15 +0000)
page-delimiter matches the empty string.

lisp/ChangeLog
lisp/textmodes/page.el

index 3a63754b137d5ba613dcaeb4067bf2ff20f467fe..37e4facd8a3021aad547aaf5370fa7766cc00583 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/page.el (what-page): Make sure we don't inf-loop if
+       page-delimiter matches the empty string.
+
 2009-09-16  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/bytecomp.el (byte-compile-not-obsolete-vars): Rename from
index 79976459ff650f873d20e3e06c7ccf5c80e323d4..7f52cf56ff8bf336c2999acb685c03821f6dbd48 100644 (file)
@@ -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