aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman1994-09-15 03:21:56 +0000
committerRichard M. Stallman1994-09-15 03:21:56 +0000
commit944fa80ad339e452041b83f6a1325431f49f7822 (patch)
treeccc954867eb4e01d410e7e868afb95abe1cf6cfb /lisp/textmodes
parentad656bdc4ece20f0662b5877b3de6c20afb9f868 (diff)
downloademacs-944fa80ad339e452041b83f6a1325431f49f7822.tar.gz
emacs-944fa80ad339e452041b83f6a1325431f49f7822.zip
(forward-page): If we find a match that ends where we
started searching, look for another one.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/page.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el
index dc86e6997be..d84d7f5a07b 100644
--- a/lisp/textmodes/page.el
+++ b/lisp/textmodes/page.el
@@ -43,9 +43,18 @@ A page boundary is any line whose beginning matches the regexp
43 (setq count (1- count))) 43 (setq count (1- count)))
44 (while (and (< count 0) (not (bobp))) 44 (while (and (< count 0) (not (bobp)))
45 (forward-char -1) 45 (forward-char -1)
46 (if (re-search-backward page-delimiter nil t) 46 (let (result (end (point)))
47 (goto-char (match-end 0)) 47 ;; If we find a match that ends where we started searching,
48 (goto-char (point-min))) 48 ;; look for another one.
49 (while (and (setq result (re-search-backward page-delimiter nil t))
50 (= (match-end 0) end))
51 ;; Just search again.
52 )
53 (if result
54 ;; We found one--move to the end of it.
55 (goto-char (match-end 0))
56 ;; We found nothing--go to beg of buffer.
57 (goto-char (point-min))))
49 (setq count (1+ count)))) 58 (setq count (1+ count))))
50 59
51(defun backward-page (&optional count) 60(defun backward-page (&optional count)