GNU bug report logs - #13429
24.2; `window-end' returns point after last point in window

Previous Next

Package: emacs;

Reported by: Nathan Trapuzzano <nbtrap <at> nbtrap.com>

Date: Sun, 13 Jan 2013 22:15:02 UTC

Severity: wishlist

Found in version 24.2

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13429 in the body.
You can then email your comments to 13429 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13429; Package emacs. (Sun, 13 Jan 2013 22:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nathan Trapuzzano <nbtrap <at> nbtrap.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 13 Jan 2013 22:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2; `window-end' returns point after last point in window
Date: Sun, 13 Jan 2013 17:12:59 -0500
The current doc-string for `window-end' states that the function returns
the ``position at which display currently ends in WINDOW''. I understand
this to mean, more or less, the greatest position visible in
WINDOW. However, even if that's an incorrect interpretation, the
behavior of this function is inconsistent under seemingly any
interpretation.

For example, when a given window is displaying a buffer that overflows
the window, a call to `window-end' will return the greatest visible
position **plus one**. Whereas, when the buffer does not overflow the window
(i.e., when the window displays the end of the buffer, including any
blank lines at the end), `window-end' returns just the greatest visible
position, the same thing that `point-max' would return.

As I say, this behavior seems inconsistent under any interpretation of
the documentation. If it is in fact a bug, the code should be rectified;
but in either case, the documentation should be clarified, because if
there is a correct interpretation that I'm missing, it's not obvious.

Nathan

In GNU Emacs 24.2.1 (x86_64-unknown-linux-gnu)
 of 2013-01-13 on Nathan-GNU
Configured using:
 `configure '--prefix=/usr' '--sysconfdir=/etc' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--without-x' '--without-sound'
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
 --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2'
 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13429; Package emacs. (Mon, 14 Jan 2013 03:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 13429 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
Cc: 13429 <at> debbugs.gnu.org
Subject: Re: bug#13429: 24.2;
	`window-end' returns point after last point in window
Date: Mon, 14 Jan 2013 05:47:39 +0200
> From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
> Date: Sun, 13 Jan 2013 17:12:59 -0500
> 
> The current doc-string for `window-end' states that the function returns
> the ``position at which display currently ends in WINDOW''. I understand
> this to mean, more or less, the greatest position visible in
> WINDOW.

This interpretation is incorrect.

> For example, when a given window is displaying a buffer that overflows
> the window, a call to `window-end' will return the greatest visible
> position **plus one**.

This is what is meant by "position at which display ends".
Suggestions for how to describe that better are welcome.

> Whereas, when the buffer does not overflow the window
> (i.e., when the window displays the end of the buffer, including any
> blank lines at the end), `window-end' returns just the greatest visible
> position, the same thing that `point-max' would return.

This is still consistent: there's no character at position returned by
point-max.  The last position visible in the window is one less that
the returned value in this case as well.




Severity set to 'wishlist' from 'minor' Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Mon, 30 Sep 2019 16:39:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13429; Package emacs. (Thu, 15 Jul 2021 09:24:02 GMT) Full text and rfc822 format available.

Message #13 received at 13429 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Nathan Trapuzzano <nbtrap <at> nbtrap.com>, 13429 <at> debbugs.gnu.org
Subject: Re: bug#13429: 24.2; `window-end' returns point after last point in
 window
Date: Thu, 15 Jul 2021 11:23:33 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> For example, when a given window is displaying a buffer that overflows
>> the window, a call to `window-end' will return the greatest visible
>> position **plus one**.
>
> This is what is meant by "position at which display ends".
> Suggestions for how to describe that better are welcome.

I've added an extra sentence to the doc string in Emacs 28 to try to
clarify this.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 13429 <at> debbugs.gnu.org and Nathan Trapuzzano <nbtrap <at> nbtrap.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 15 Jul 2021 09:24:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 12 Aug 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.