From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83tvkgu7cf.fsf@gnu.org> References: <20181114154802.16132-1-thomas.de.beauchene@gmail.com> <83a7m976rw.fsf@gnu.org> <838t1tuls2.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1542397995 27666 195.159.176.226 (16 Nov 2018 19:53:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2018 19:53:15 +0000 (UTC) Cc: 33384@debbugs.gnu.org To: Thomas de Beauchene Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 16 20:53:10 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNkAw-00076j-AB for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Nov 2018 20:53:10 +0100 Original-Received: from localhost ([::1]:46831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNkD2-0002mh-O2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Nov 2018 14:55:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNkCu-0002mP-AM for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 14:55:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNkCl-0004bO-Ui for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 14:55:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52541) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNkCk-0004XZ-7N for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 14:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gNkCk-0005oN-31 for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 14:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Nov 2018 19:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33384 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 33384-submit@debbugs.gnu.org id=B33384.154239804622273 (code B ref 33384); Fri, 16 Nov 2018 19:55:02 +0000 Original-Received: (at 33384) by debbugs.gnu.org; 16 Nov 2018 19:54:06 +0000 Original-Received: from localhost ([127.0.0.1]:56799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNkBq-0005nB-Do for submit@debbugs.gnu.org; Fri, 16 Nov 2018 14:54:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNkBo-0005mh-If for 33384@debbugs.gnu.org; Fri, 16 Nov 2018 14:54:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNkBf-00048h-H5 for 33384@debbugs.gnu.org; Fri, 16 Nov 2018 14:53:59 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNkBf-00048d-Du; Fri, 16 Nov 2018 14:53:55 -0500 Original-Received: from [176.228.60.248] (port=3432 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gNkBf-0007mF-3u; Fri, 16 Nov 2018 14:53:55 -0500 In-reply-to: (message from Thomas de Beauchene on Fri, 16 Nov 2018 18:54:20 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152461 Archived-At: [Please use "Reply to All" to reply.] > From: Thomas de Beauchene > 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.