Subject: Re: bug#26837: Wrong file in "autoloading failed to define" error

From: Eli Zaretskii <[email-masked]>
Date: Tue, 09 May 2017 22:12:48 +0300

> From: Glenn Morris <[email-masked]>
> Date: Tue, 09 May 2017 14:39:24 -0400
> Cc: [email-masked]
> 
> I think it was the lexical-binding thing. Following seems to work:
> 
> --- i/src/lread.c
> +++ w/src/lread.c
> @@ -1885,7 +1885,7 @@ PREDICATE can also be an integer to pass to the faccessat(2) function,
>        /* On the first cycle, we can easily test here
>  	 whether we are reading the whole buffer.  */
>        if (b && first_sexp)
> -	whole_buffer = (PT == BEG && ZV == Z);
> +	whole_buffer = (BUF_PT (b) == BUF_BEG (b) && BUF_ZV (b) == BUF_Z (b));

You are saying that set_buffer_internal didn't do its job?  Of that
the call was bypassed?