From: Chris Hanson Date: Mon, 6 Jan 1992 20:28:30 +0000 (+0000) Subject: Fix minor bug in M-x narrow-to-page that caused the last line of the X-Git-Tag: 20090517-FFI~10021 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=819a3d078c463c6925650bc90ff5173171eeedc9;p=mit-scheme.git Fix minor bug in M-x narrow-to-page that caused the last line of the last page in a buffer to be excluded from the narrowing region if it did not end in newline. --- diff --git a/v7/src/edwin/lincom.scm b/v7/src/edwin/lincom.scm index 692ac66ef..6b99cf2bb 100644 --- a/v7/src/edwin/lincom.scm +++ b/v7/src/edwin/lincom.scm @@ -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)))))) (define-command count-lines-page "Report number of lines on current page."