unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Thomas de Beauchene <thomas.de.beauchene@gmail.com>
Cc: 33384@debbugs.gnu.org
Subject: bug#33384: [PATCH] Fix zone.el when window is at the bottom of the buffer
Date: Fri, 16 Nov 2018 21:53:52 +0200	[thread overview]
Message-ID: <83tvkgu7cf.fsf@gnu.org> (raw)
In-Reply-To: <CAK=xY6+yTP8BeEQn6z4hFJYFVfVzcFhHsryHwwAzeAE10SHTKw@mail.gmail.com> (message from Thomas de Beauchene on Fri, 16 Nov 2018 18:54:20 +0100)

[Please use "Reply to All" to reply.]

> From: Thomas de Beauchene <thomas.de.beauchene@gmail.com>
> Date: Fri, 16 Nov 2018 18:54:20 +0100
> 
> I got to the bottom of it and isolated the minimal reproduction steps.
> (window-end) will return one more than it should if there is an overlay on
> the
> buffer that goes past the end of the window. You can see by yourself very
> easily
> with the following piece of code (the defun is for convenience, this is the
> content of a file that I put in the -l option):
> 
> (switch-to-buffer "*scratch*")
> (insert "123")
> (setq some-overlay (make-overlay (point-max) (point-max) nil t t))
> (overlay-put some-overlay 'after-string (apply 'concat (make-list 34
> "\n*")))
> 
> (defun blah ()
>   (interactive)
>   (message "window height = %s - window-end = %s" (window-height)
> (window-end)))

That's because you need to call window-end with 2nd argument non-nil,
if you want to be sure you get the accurate value.  I've just made
such a change in zone.el, so it shouldn't hit these problems anymore.





  parent reply	other threads:[~2018-11-16 19:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 15:48 bug#33384: [PATCH] Fix zone.el when window is at the bottom of the buffer deb0ch
2018-11-16  8:42 ` Eli Zaretskii
     [not found]   ` <CAK=xY6KH5Y4WQnNo3-vLx77CuGtmPnkMTTQoH4Sbe5TE2NTsLw@mail.gmail.com>
2018-11-16 14:42     ` Eli Zaretskii
     [not found]       ` <CAK=xY6+yTP8BeEQn6z4hFJYFVfVzcFhHsryHwwAzeAE10SHTKw@mail.gmail.com>
2018-11-16 19:53         ` Eli Zaretskii [this message]
     [not found]           ` <CAK=xY6K3SDCivYiadnAvxC_mrH6-hkQK+6VnOpt+QCRoDVGMsA@mail.gmail.com>
2018-11-18 19:43             ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83tvkgu7cf.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=33384@debbugs.gnu.org \
    --cc=thomas.de.beauchene@gmail.com \
    /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 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).