Subject: bug#75521: scratch/igc: Delete unused macro DEFVAR_LISP_NOPROX

From: Gerd Möllmann <[email-masked]>
Date: Mon, 13 Jan 2025 14:30:03 +0100

Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <[email-masked]> writes:

> "Eli Zaretskii" <[email-masked]> writes:
>
>>> Cc: [email-masked]
>>> Date: Sun, 12 Jan 2025 22:36:12 +0000
>>> From:  Pip Cet via "Bug reports for GNU Emacs,
>>>  the Swiss army knife of text editors" <[email-masked]>
>>>
>>> Also on master, the single user of DEFVAR_LISP_NOPRO is questionable:
>>> font.c doesn't staticpro Vfont_weight_table because it appears in
>>> font_style_table, but then font_style_table is sometimes modified so it
>>> points to a new vector, and I don't see how Vfont_weight_table is
>>> protected then.
>>
>> According to this comment:
>>
>>   /* Vector of Vfont_weight_table, Vfont_slant_table, and Vfont_width_table. */
>>   static Lisp_Object font_style_table;
>>
>> Vfont_weight_table is actually an element of font_style_table, and
>> that one is protected:
>
> But then font_style_table is sometimes modified so it points to
> (i.e. contains as its element) a new vector, and I don't see how
> Vfont_weight_table is protected then.
>
> Pip

BTW, this is _exactly_ how the old GCPRO macro was used. "We don't need
to GCPRO this local variable here because it's already protected by
something else". Horrible nightmare! That caused me such pain debugging
that I added conservative stack marking, split off the SDATA from
strings and so on. I'd hope Emacs overcomes this.