Fix minor bug in M-x narrow-to-page that caused the last line of the
authorChris Hanson <org/chris-hanson/cph>
Mon, 6 Jan 1992 20:28:30 +0000 (20:28 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 6 Jan 1992 20:28:30 +0000 (20:28 +0000)
last page in a buffer to be excluded from the narrowing region if it
did not end in newline.

v7/src/edwin/lincom.scm

index 692ac66efbaf90283c4fc752920a93fef60fe7a1..6b99cf2bb9ae7a1e4a4b67464819bd7836e067a9 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/lincom.scm,v 1.117 1991/11/26 07:53:05 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/lincom.scm,v 1.118 1992/01/06 20:28:30 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
@@ -105,14 +105,14 @@ transposed."
 
 (define-command forward-page
   "Move forward to page boundary.  With arg, repeat, or go back if negative.
-A page boundary is any string in Page Delimiters, at a line's beginning."
+A page boundary is any line whose beginning matches the regexp page-delimiter."
   "p"
   (lambda (argument)
     (move-thing forward-page argument 'FAILURE)))
 
 (define-command backward-page
   "Move backward to page boundary.  With arg, repeat, or go fwd if negative.
-A page boundary is any string in Page Delimiters, at a line's beginning."
+A page boundary is any line whose beginning matches the regexp page-delimiter."
   "p"
   (lambda (argument)
     (move-thing backward-page argument 'FAILURE)))
@@ -148,9 +148,14 @@ A page boundary is any string in Page Delimiters, at a line's beginning."
                           (mark1+ start)
                           start))
                     (let ((end* (line-start end 0)))
-                      (if (mark< end* point)
-                          end
-                          end*))))))
+                      (if (and (mark<= point end*)
+                               (mark= (re-match-forward
+                                       (ref-variable page-delimiter)
+                                       end*
+                                       end)
+                                      end))
+                          end*
+                          end))))))
 \f
 (define-command count-lines-page
   "Report number of lines on current page."