Subject: Re: bug#78813: feature/igc: [PATCH] Make the array face_attr_sym readonly

From: Helmut Eller <[email-masked]>
Date: Sun, 22 Jun 2025 20:25:44 +0200

On Sat, Jun 21 2025, Eli Zaretskii wrote:

>> From: Helmut Eller <[email-masked]>
>> Cc: Pip Cet <[email-masked]>,  [email-masked]
>> Date: Fri, 20 Jun 2025 20:29:40 +0200
>> 
>> On Fri, Jun 20 2025, Eli Zaretskii wrote:
>> 
>> > Thanks, but I asked about this change on its own, not as part of some
>> > effort (which AFAIU is on the igc branch, not on master).  IOW,
>> > suppose we release Emacs 31 without the MPS support (something I hope
>> > will not need to happen, but just for the sake of this sub-thread):
>> > what would that change give us, considering the fact that this code
>> > was there since Emacs 21?
>> 
>> It would add some minor protection against accidental modifications of
>> the face_attr_sym array.
>
> How can it be accidentally modified?  It's a static array not exposed
> to Lisp.

I was thinking about accidental modification from C.

[...]
> Initialization using C initializers is used for simple values like
> scalars.  The LISP_INITIALLY stuff should be used only very sparingly
> and if strictly necessary, because it is very confusing at first
> sight.  So I'd very much prefer that we kept the current conventions
> for initializing complex variables, especially variables with Lisp
> values.

This doesn't make much sense to me.  But your project, your rules.

So you can close this bug.

Helmut