diff options
| author | Richard M. Stallman | 1996-11-06 22:42:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-11-06 22:42:41 +0000 |
| commit | cb70d91574753271039abb2abae7f314b5d97ba9 (patch) | |
| tree | dafeb3c7a057efe5c4d9dfd07d4f29f009993c9e | |
| parent | 22819cd94f1338130cd1c97f64a6b3451f5b82cd (diff) | |
| download | emacs-cb70d91574753271039abb2abae7f314b5d97ba9.tar.gz emacs-cb70d91574753271039abb2abae7f314b5d97ba9.zip | |
(narrow-to-page): With negative arg, move back one extra
page unless we start right after a page delimiter.
| -rw-r--r-- | lisp/textmodes/page.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el index aecfbd698d7..2cc0533535d 100644 --- a/lisp/textmodes/page.el +++ b/lisp/textmodes/page.el | |||
| @@ -89,7 +89,16 @@ thus showing a page other than the one point was originally in." | |||
| 89 | (if (> arg 0) | 89 | (if (> arg 0) |
| 90 | (forward-page arg) | 90 | (forward-page arg) |
| 91 | (if (< arg 0) | 91 | (if (< arg 0) |
| 92 | (forward-page (1- arg)))) | 92 | (let ((adjust 0) |
| 93 | (opoint (point))) | ||
| 94 | ;; If we are not now at the beginning of a page, | ||
| 95 | ;; move back one extra time, to get to the start of this page. | ||
| 96 | (save-excursion | ||
| 97 | (beginning-of-line) | ||
| 98 | (or (and (looking-at page-delimiter) | ||
| 99 | (eq (match-end 0) opoint)) | ||
| 100 | (setq adjust 1))) | ||
| 101 | (forward-page (- arg adjust))))) | ||
| 93 | ;; Find the end of the page. | 102 | ;; Find the end of the page. |
| 94 | (forward-page) | 103 | (forward-page) |
| 95 | ;; If we stopped due to end of buffer, stay there. | 104 | ;; If we stopped due to end of buffer, stay there. |