[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#33384: [PATCH] Fix zone.el when window is at the bottom of the buffe
From: |
Eli Zaretskii |
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 |
[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.