Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
b69863f2
Commit
b69863f2
authored
Jan 12, 1996
by
Richard M. Stallman
Browse files
(forward-page): Simplify how we avoid getting stuck when moving backwards.
parent
1caf38eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
lisp/textmodes/page.el
lisp/textmodes/page.el
+10
-12
No files found.
lisp/textmodes/page.el
View file @
b69863f2
...
...
@@ -42,19 +42,17 @@ A page boundary is any line whose beginning matches the regexp
(
goto-char
(
point-max
)))
(
setq
count
(
1-
count
)))
(
while
(
and
(
<
count
0
)
(
not
(
bobp
)))
;; In case the page-delimiter matches the null string,
;; don't find a match without moving.
(
and
(
save-excursion
(
re-search-backward
page-delimiter
nil
t
))
(
=
(
match-end
0
)
(
point
))
(
goto-char
(
match-beginning
0
)))
(
forward-char
-1
)
(
let
(
result
(
end
(
point
)))
;; If we find a match that ends where we started searching,
;; look for another one.
(
while
(
and
(
setq
result
(
re-search-backward
page-delimiter
nil
t
))
(
=
(
match-end
0
)
end
))
;; Just search again.
)
(
if
result
;; We found one--move to the end of it.
(
goto-char
(
match-end
0
))
;; We found nothing--go to beg of buffer.
(
goto-char
(
point-min
))))
(
if
(
re-search-backward
page-delimiter
nil
t
)
;; We found one--move to the end of it.
(
goto-char
(
match-end
0
))
;; We found nothing--go to beg of buffer.
(
goto-char
(
point-min
)))
(
setq
count
(
1+
count
))))
(
defun
backward-page
(
&optional
count
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment