unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13429: 24.2; `window-end' returns point after last point in window
@ 2013-01-13 22:12 Nathan Trapuzzano
  2013-01-14  3:47 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Trapuzzano @ 2013-01-13 22:12 UTC (permalink / raw)
  To: 13429

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





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

* bug#13429: 24.2; `window-end' returns point after last point in window
  2013-01-13 22:12 bug#13429: 24.2; `window-end' returns point after last point in window Nathan Trapuzzano
@ 2013-01-14  3:47 ` Eli Zaretskii
  2021-07-15  9:23   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2013-01-14  3:47 UTC (permalink / raw)
  To: Nathan Trapuzzano; +Cc: 13429

> From: Nathan Trapuzzano <nbtrap@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.





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

* bug#13429: 24.2; `window-end' returns point after last point in window
  2013-01-14  3:47 ` Eli Zaretskii
@ 2021-07-15  9:23   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-15  9:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Nathan Trapuzzano, 13429

Eli Zaretskii <eliz@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





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

end of thread, other threads:[~2021-07-15  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-13 22:12 bug#13429: 24.2; `window-end' returns point after last point in window Nathan Trapuzzano
2013-01-14  3:47 ` Eli Zaretskii
2021-07-15  9:23   ` Lars Ingebrigtsen

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).