Subject: bug#48264: [PATCH v3 03/15] Add and use BUFFER_DEFAULT_VALUE_P

From: Eli Zaretskii <[email-masked]>
Date: Fri, 07 May 2021 16:42:28 +0300

> From: Spencer Baugh <[email-masked]>
> Cc: [email-masked]
> Date: Fri, 07 May 2021 09:38:20 -0400
> 
> > It's the other way around here: the test "if (idx > 0)" is clear,
> > whereas "if (BUFFER_DEFAULT_VALUE_P (offset))" makes me go look up the
> > definition of the macro, because the name is not expressive enough,
> > and the argument "offset" doesn't help, either.
> 
> Sure; what about the name "BUFFER_VAR_HAS_DEFAULT_VALUE_P"?

Much better.  Maybe BVAR_HAS_DEFAULT_VALUE_P? it's shorter.

> "idx > 0" is only clear if one has memorized how all the different
> pieces of DEFVAR_PER_BUFFER metadata (such as the index) work.  But I
> don't think a casual reader would have done that.

Sure; but the number of such places is small, and we could have a
comment there explaining the semantics.