bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#35943: 26.2; `count-lines-page' gives wrong line count (off by one)


From: Noam Postavsky
Subject: bug#35943: 26.2; `count-lines-page' gives wrong line count (off by one)
Date: Tue, 28 May 2019 08:49:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Stefan Kangas <stefan@marxist.se> writes:

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

You can use "\C-l" for this.

> 3. Result:
>
> "Page has 2 lines (2 + 0)"
>
> 4. Expected result:
>
> "Page has 1 lines (1 + 0)"

The page starts right after the page separator, so with some more annotation:

(with-temp-buffer
  (insert "Page 1/3 line 1
\C-l page 2, line 1
Page 2/3, line 2
\C-l, page 3, line 1
Page 3/3, line 2")
  (forward-page)
  (count-lines-page))

You can see that pages 2 and 3 both have two lines.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]