# HG changeset patch # User Karl Heuer # Date 877025371 0 # Node ID 9c4fd611c3ec4967e0d5a9f67300467e2112797f # Parent 694a165b5b0da7a13df7059e0848395322dd1745 (narrow-to-page): Check whether forward-page actually set the match data. diff -r 694a165b5b0d -r 9c4fd611c3ec lisp/textmodes/page.el --- a/lisp/textmodes/page.el Thu Oct 16 18:07:23 1997 +0000 +++ b/lisp/textmodes/page.el Thu Oct 16 18:09:31 1997 +0000 @@ -100,13 +100,17 @@ (setq adjust 1))) (forward-page (- arg adjust))))) ;; Find the end of the page. + (set-match-data nil) (forward-page) ;; If we stopped due to end of buffer, stay there. ;; If we stopped after a page delimiter, put end of restriction ;; at the beginning of that line. - (if (save-excursion - (goto-char (match-beginning 0)) ; was (beginning-of-line) - (looking-at page-delimiter)) + ;; Before checking the match that was found, + ;; verify that forward-page actually set the match data. + (if (and (match-beginning 0) + (save-excursion + (goto-char (match-beginning 0)) ; was (beginning-of-line) + (looking-at page-delimiter))) (beginning-of-line)) (narrow-to-region (point) (progn