From: deb0ch <thomas.de.beauchene@gmail.com>
To: 33384@debbugs.gnu.org
Cc: deb0ch <thomas.de.beauchene@gmail.com>
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 [thread overview]
Message-ID: <20181114154802.16132-1-thomas.de.beauchene@gmail.com> (raw)
(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)
next reply other threads:[~2018-11-14 15:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-14 15:48 deb0ch [this message]
2018-11-16 8:42 ` bug#33384: [PATCH] Fix zone.el when window is at the bottom of the buffer 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
[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=20181114154802.16132-1-thomas.de.beauchene@gmail.com \
--to=thomas.de.beauchene@gmail.com \
--cc=33384@debbugs.gnu.org \
/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).