bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33384: [PATCH] Fix zone.el when window is at the bottom of the buffe


From: Eli Zaretskii
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

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]