# HG changeset patch # User Richard M. Stallman # Date 847320161 0 # Node ID 521d5794ac2b9559cce77824017ce23983e6079c # Parent 84440bd95727213c1fd1d0df76bd68c6de3ae615 (narrow-to-page): With negative arg, move back one extra page unless we start right after a page delimiter. diff -r 84440bd95727 -r 521d5794ac2b lisp/textmodes/page.el --- a/lisp/textmodes/page.el Wed Nov 06 19:51:38 1996 +0000 +++ b/lisp/textmodes/page.el Wed Nov 06 22:42:41 1996 +0000 @@ -89,7 +89,16 @@ (if (> arg 0) (forward-page arg) (if (< arg 0) - (forward-page (1- arg)))) + (let ((adjust 0) + (opoint (point))) + ;; If we are not now at the beginning of a page, + ;; move back one extra time, to get to the start of this page. + (save-excursion + (beginning-of-line) + (or (and (looking-at page-delimiter) + (eq (match-end 0) opoint)) + (setq adjust 1))) + (forward-page (- arg adjust))))) ;; Find the end of the page. (forward-page) ;; If we stopped due to end of buffer, stay there.