Subject: bug#28527: unexpected behaviour of char-after if argument is marker that don't point to the current buffer

From: Eli Zaretskii <[email-masked]>
Date: Wed, 20 Sep 2017 18:51:27 +0300

> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
> 	HTML_MESSAGE,RP_MATCHES_RCVD,T_DKIM_INVALID autolearn=disabled version=3.3.2
> Resent-From: Fritz Stelzer <[email-masked]>
> Original-Sender: "Debbugs-submit" <[email-masked]>
> Resent-CC: [email-masked]
> Resent-Sender: [email-masked]
> From: Fritz Stelzer <[email-masked]>
> Date: Wed, 20 Sep 2017 15:29:07 +0200
> 
> When the argument for char-after is a marker, the function gets bytepos from the buffer the marker is pointing
> to by calling marker_byte_position. But then pos_byte is compared to BEGV_BYTE and ZV_BYTE that use the
> current buffer. At the end of the function, pos_byte is passed to FETCH_CHAR, which also operates on the
> current buffer.

This is according to the documentation, which explicitly says the
position is looked up in the current buffer.  So this sounds like an
intentional and documented behavior.