unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33384: [PATCH] Fix zone.el when window is at the bottom of the buffer
@ 2018-11-14 15:48 deb0ch
  2018-11-16  8:42 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: deb0ch @ 2018-11-14 15:48 UTC (permalink / raw)
  To: 33384; +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.
---
 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)






^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-18 19:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-14 15:48 bug#33384: [PATCH] Fix zone.el when window is at the bottom of the buffer deb0ch
2018-11-16  8:42 ` 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

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).