Subject: Re: bug#48264: [PATCH v3 08/15] Set non-buffer-local BVARs to Qunbound

From: Eli Zaretskii <[email-masked]>
Date: Fri, 07 May 2021 13:37:53 +0300

> From: Spencer Baugh <[email-masked]>
> Date: Thu,  6 May 2021 17:33:39 -0400
> Cc: Spencer Baugh <[email-masked]>
> 
> --- a/src/buffer.c
> +++ b/src/buffer.c
> @@ -54,8 +54,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
>     defined with DEFVAR_PER_BUFFER, that have special slots in each buffer.
>     The default value occupies the same slot in this structure
>     as an individual buffer's value occupies in that buffer.
> -   Setting the default value also goes through the alist of buffers
> -   and stores into each buffer that does not say it has a local value.  */
> +*/

This is a spurious change, please undo it.

> @@ -1107,8 +1109,7 @@ BUFFER_CHECK_INDIRECTION (struct buffer *b)
>     that have special slots in each buffer.
>     The default value occupies the same slot in this structure
>     as an individual buffer's value occupies in that buffer.
> -   Setting the default value also goes through the alist of buffers
> -   and stores into each buffer that does not say it has a local value.  */
> +*/

Likewise.

> +INLINE Lisp_Object
> +bvar_get (struct buffer *b, ptrdiff_t offset)
   ^^^^^^^^
How about calling this buffer_local_value instead? or maybe
bvar_get_value?

> @@ -1511,7 +1519,7 @@ KILL_PER_BUFFER_VALUE (struct buffer *b, int offset)
>  {
>    int idx = PER_BUFFER_IDX (offset);
>    SET_PER_BUFFER_VALUE_P (b, idx, 0);
> -  set_per_buffer_value (b, offset, per_buffer_default (offset));
> +  set_per_buffer_value (b, offset, Qunbound);
>  }

Hmm... I'm probably missing something here: what about per-buffer
variables that do have default values? how's that implemented in this
new implementation?