From: Eli Zaretskii <eliz@gnu.org>
To: deb0ch <thomas.de.beauchene@gmail.com>
Cc: thomas.de.beauchene@gmail.com, 33384@debbugs.gnu.org
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 [thread overview]
Message-ID: <83a7m976rw.fsf@gnu.org> (raw)
In-Reply-To: <20181114154802.16132-1-thomas.de.beauchene@gmail.com> (message from deb0ch on Wed, 14 Nov 2018 16:48:02 +0100)
> From: deb0ch <thomas.de.beauchene@gmail.com>
> Date: Wed, 14 Nov 2018 16:48:02 +0100
> Cc: deb0ch <thomas.de.beauchene@gmail.com>
>
> (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.
next prev parent reply other threads:[~2018-11-16 8:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
[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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83a7m976rw.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=33384@debbugs.gnu.org \
--cc=thomas.de.beauchene@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.