unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35943: 26.2; `count-lines-page' gives wrong line count (off by one)
@ 2019-05-28 12:40 Stefan Kangas
  2019-05-28 12:49 ` Noam Postavsky
  2019-05-28 20:25 ` Juri Linkov
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Kangas @ 2019-05-28 12:40 UTC (permalink / raw)
  To: 35943

There seems to be an off by one error in `count-lines-page'.

Steps to reproduce:

1. Run emacs -Q

2. Evaluate the following in the scratch buffer:

(with-temp-buffer
  (insert "Page 1/3
^L
Page 2/3
^L
Page 3/3")
  (forward-page)
  (count-lines-page))

NB. Convert "^L" to the actual control characters.

3. Result:

"Page has 2 lines (2 + 0)"

4. Expected result:

"Page has 1 lines (1 + 0)"

Thanks,
Stefan Kangas

In GNU Emacs 26.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2019-04-13 built on joffe
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description:    Debian GNU/Linux 9.9 (stretch)





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-05-29 13:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-28 12:40 bug#35943: 26.2; `count-lines-page' gives wrong line count (off by one) Stefan Kangas
2019-05-28 12:49 ` Noam Postavsky
2019-05-29  8:43   ` Stefan Kangas
2019-05-29 11:17     ` Noam Postavsky
2019-05-29 11:41       ` Stefan Kangas
2019-05-29 13:50       ` Drew Adams
2019-05-28 20:25 ` Juri Linkov
2019-05-29  9:40   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).