all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: 35943@debbugs.gnu.org
Subject: bug#35943: 26.2; `count-lines-page' gives wrong line count (off by one)
Date: Tue, 28 May 2019 14:40:11 +0200	[thread overview]
Message-ID: <CADwFkmmN0CO1cMLyPzq-KSKyyg9Yc8pEeGwrn-y42chMOEK58Q@mail.gmail.com> (raw)

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)





             reply	other threads:[~2019-05-28 12:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28 12:40 Stefan Kangas [this message]
2019-05-28 12:49 ` bug#35943: 26.2; `count-lines-page' gives wrong line count (off by one) 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmmN0CO1cMLyPzq-KSKyyg9Yc8pEeGwrn-y42chMOEK58Q@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=35943@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.