aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-04-22 14:04:43 +0200
committerLars Ingebrigtsen2022-04-22 14:35:30 +0200
commit3aaed2e1ccfcc230f813d3fe7867a7abc5b22109 (patch)
tree34e98286f256f1c2a4f05323af4bda8efbed6a89 /test
parentf2f9e8dc76cdc7433624ee7e88ec5380a5b06902 (diff)
downloademacs-3aaed2e1ccfcc230f813d3fe7867a7abc5b22109.tar.gz
emacs-3aaed2e1ccfcc230f813d3fe7867a7abc5b22109.zip
Fix problem with (narrow-to-page 1) with point at point-max
* lisp/textmodes/page.el (forward-page): Make this work more consistently if point is on bol (bug#20663).
Diffstat (limited to 'test')
-rw-r--r--test/lisp/textmodes/page-tests.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lisp/textmodes/page-tests.el b/test/lisp/textmodes/page-tests.el
index 596f3a6ceb7..b7217e69f0c 100644
--- a/test/lisp/textmodes/page-tests.el
+++ b/test/lisp/textmodes/page-tests.el
@@ -80,6 +80,17 @@
80 (narrow-to-page 2) 80 (narrow-to-page 2)
81 (should (equal (buffer-string) "baz")) 81 (should (equal (buffer-string) "baz"))
82 (narrow-to-page -1) 82 (narrow-to-page -1)
83 (should (equal (buffer-string) "bar\n"))
84
85 (widen)
86 (goto-char (point-min))
87 (narrow-to-page)
88 (should (equal (buffer-string) "foo\n"))
89 (goto-char (point-max))
90 (narrow-to-page 2)
91 (should (equal (buffer-string) "baz"))
92 (goto-char (point-max))
93 (narrow-to-page -1)
83 (should (equal (buffer-string) "bar\n")))) 94 (should (equal (buffer-string) "bar\n"))))
84 95
85(ert-deftest page-tests-count-lines-page () 96(ert-deftest page-tests-count-lines-page ()
@@ -100,4 +111,5 @@
100 (forward-page) 111 (forward-page)
101 (should (equal (page--what-page) '(3 4))))) 112 (should (equal (page--what-page) '(3 4)))))
102 113
114
103;;; page-tests.el ends here 115;;; page-tests.el ends here