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 10:42:27 +0200 Message-ID: <83a7m976rw.fsf@gnu.org> References: <20181114154802.16132-1-thomas.de.beauchene@gmail.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1542357676 26453 195.159.176.226 (16 Nov 2018 08:41:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2018 08:41:16 +0000 (UTC) Cc: thomas.de.beauchene@gmail.com, 33384@debbugs.gnu.org To: deb0ch Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 16 09:41:12 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 1gNZge-0006n8-9B for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Nov 2018 09:41:12 +0100 Original-Received: from localhost ([::1]:42761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNZik-0002IM-Tr for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Nov 2018 03:43:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNZie-0002I5-MD for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 03:43:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNZiX-0004K6-IB for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 03:43:15 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50440) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNZiP-0004IX-Vm for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 03:43:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gNZiP-00081Z-Pk for bug-gnu-emacs@gnu.org; Fri, 16 Nov 2018 03:43:01 -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 08:43:01 +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.154235777230825 (code B ref 33384); Fri, 16 Nov 2018 08:43:01 +0000 Original-Received: (at 33384) by debbugs.gnu.org; 16 Nov 2018 08:42:52 +0000 Original-Received: from localhost ([127.0.0.1]:54698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNZiG-000817-2Y for submit@debbugs.gnu.org; Fri, 16 Nov 2018 03:42:52 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNZiE-00080q-4K for 33384@debbugs.gnu.org; Fri, 16 Nov 2018 03:42:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNZhz-0003ya-Oh for 33384@debbugs.gnu.org; Fri, 16 Nov 2018 03:42:41 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNZho-0003pt-Mx; Fri, 16 Nov 2018 03:42:25 -0500 Original-Received: from [176.228.60.248] (port=1546 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gNZho-00009P-B4; Fri, 16 Nov 2018 03:42:24 -0500 In-reply-to: <20181114154802.16132-1-thomas.de.beauchene@gmail.com> (message from deb0ch on Wed, 14 Nov 2018 16:48:02 +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:152444 Archived-At: > From: deb0ch > Date: Wed, 14 Nov 2018 16:48:02 +0100 > Cc: deb0ch > > (window-end) returns the size of the buffer + 1 when the end of the > buffer is inside the window, whereas to get the end of the > buffer (buffer-substring) needs the size of the buffer and will throw > an error if given anything greater. Can you please elaborate on the actual problem you saw in zone.el, and perhaps show a recipe to reproduce that problem? Your reasoning about buffer-substring and window-end, as written, is incorrect: buffer-substring returns the text between START and END _excluding_ END, so passing EOB position, which is one more than the buffer size, is perfectly correct, since the first character's position is 1, not zero. And indeed, if I do this: emacs -Q M-: (buffer-substring (window-start) (window-end)) RET I get the full text of the *scratch* buffer and no errors. Also, running "M-x zone" on *scratch* doesn't signal any errors I could spot. So I wonder what practical problems did you see in zone.el and why. Thanks.