From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: deb0ch Newsgroups: gmane.emacs.bugs Subject: bug#33384: [PATCH] Fix zone.el when window is at the bottom of the buffer Date: Wed, 14 Nov 2018 16:48:02 +0100 Message-ID: <20181114154802.16132-1-thomas.de.beauchene@gmail.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1542212417 32016 195.159.176.226 (14 Nov 2018 16:20:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2018 16:20:17 +0000 (UTC) Cc: deb0ch To: 33384@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 14 17:20: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 1gMxtk-0008Dw-4r for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Nov 2018 17:20:12 +0100 Original-Received: from localhost ([::1]:32993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMxvp-00054o-VX for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Nov 2018 11:22:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMxvZ-00053W-Tz for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2018 11:22:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMxvV-0006Xk-VT for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2018 11:22:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48195) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMxvV-0006XW-S7 for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2018 11:22:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gMxvV-0004BY-Na for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2018 11:22:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: deb0ch Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Nov 2018 16:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33384 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.154221247516029 (code B ref -1); Wed, 14 Nov 2018 16:22:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Nov 2018 16:21:15 +0000 Original-Received: from localhost ([127.0.0.1]:52453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gMxuk-0004AT-P0 for submit@debbugs.gnu.org; Wed, 14 Nov 2018 11:21:15 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gMxPz-0003Oy-Jd for submit@debbugs.gnu.org; Wed, 14 Nov 2018 10:49:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMxPt-0003hf-Rc for submit@debbugs.gnu.org; Wed, 14 Nov 2018 10:49:22 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48530) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gMxPt-0003hW-Od for submit@debbugs.gnu.org; Wed, 14 Nov 2018 10:49:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMxPq-0004jQ-E7 for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2018 10:49:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMxPn-0003bM-A6 for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2018 10:49:18 -0500 Original-Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:40713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMxPn-0003a7-1E for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2018 10:49:15 -0500 Original-Received: by mail-wr1-x442.google.com with SMTP id p4so8659797wrt.7 for ; Wed, 14 Nov 2018 07:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=pcwhVEIogH6+9nY/MIJYkCmo9DWUSTbnucXP65KQrx0=; b=hILoQAVM+7cYPCqQQjzxYPbni0MgollZrfkBFkSQFcmPmEL3P8rS3D8wKfgSTHbkbF HzlzjYRlbkpmjKaepVYtuc3cFEfs43NIVk/h7I1GzOWihAaQ2Zs4FOYWfRw8HyPr+5fY 2EC7G3Ak+DA+IAxqs3mI0WIkZtNO9jCFu2sv5fbu7ozJ9XCzDkPyy5froswhLT3QlI8/ hPNBkaznZBd9+K4pQQXBuJiR8Duc0CTecFqBkim5YwTT3w3Qb9g7imRPOS0Aa9MQVpCD GG2VLFsSNtLNyV5WggzllgMfFUjPpXBL9NRGzxnYNHaVgaqCd79OS9GgDOXHmFEyAhDK FvXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pcwhVEIogH6+9nY/MIJYkCmo9DWUSTbnucXP65KQrx0=; b=JYQIR8YMVhKWcQ/MOjDc5Z+Be/0wOUkzUv4JSYyQqAV4QzdyScgILSDGgksnArNdmi +kJduqpi8Pi1EI2Akx6Teegoa2v7TBFwDZ4Da8i0r7R16QmWBhvPYu3BpnHi/mwnBU/K MnPxWhyx3xSx995VJhvW9w7HWghPO8W57nLfoyJl4uJZx8vBZ8qB0UC1TmQ9b18TmNDj BITmOF+tSJGA4/G0LQOuRKIyHqL6Y5JFtBqBMqnqA923Y1+iQL69VTMAhbbaZbLQEkXR 4mptitg76M5hXGsgjLwlPAi7n8uAzGYDZ+j1meTVaRd+cE9j/9YmWkeRTFCvgv2q0ugy 89yg== X-Gm-Message-State: AGRZ1gJX9/svj948nHyG8w3211BkZtFAkOvE1IO10q/a7hHKF8iIMLBV OEeVifWc5ah9iZFWOJEWK7GLJSFW X-Google-Smtp-Source: AJdET5c+QNYu0lquVmORMhaF68HxrnS2/+vjtsO9mYdU+xcMrerGoK7N4iEzfRQOk81X/vz1jfBdmA== X-Received: by 2002:a5d:4012:: with SMTP id n18-v6mr2346262wrp.185.1542210553301; Wed, 14 Nov 2018 07:49:13 -0800 (PST) Original-Received: from localhost.localdomain ([80.215.241.76]) by smtp.gmail.com with ESMTPSA id y2-v6sm40049304wrh.53.2018.11.14.07.49.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Nov 2018 07:49:12 -0800 (PST) X-Mailer: git-send-email 2.15.1 (Apple Git-101) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Wed, 14 Nov 2018 11:21:13 -0500 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:152389 Archived-At: (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. --- lisp/play/zone.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/play/zone.el b/lisp/play/zone.el index 4584d26f38..90340e74e9 100644 --- a/lisp/play/zone.el +++ b/lisp/play/zone.el @@ -109,7 +109,7 @@ If the element is a function or a list of a function and a number, (save-window-excursion (let ((f (selected-frame)) (outbuf (get-buffer-create "*zone*")) - (text (buffer-substring (window-start) (window-end))) + (text (buffer-substring (window-start) (1- (window-end)))) (wp (1+ (- (window-point) (window-start))))) (put 'zone 'orig-buffer (current-buffer)) -- 2.15.1 (Apple Git-101)