[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Menu bar items structure

From: Po Lu
Subject: Re: Menu bar items structure
Date: Thu, 17 Nov 2022 16:42:27 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Manuel Giraud <manuel@ledu-giraud.fr>
>> Date: Wed, 16 Nov 2022 18:30:58 +0100
>> AFAIU, those items are stored as a flat array.  So there are many usage
>> of this magical "4" number in keyboard.c and *term.c to walk this array.
>> So I guess my question is: could (should?) it not be done with a proper
>> struct?  Maybe it is historical or maybe I'm missing something?
> I'm not sure how you intended to use a C 'struct' in this case.
> Menu-bar items is a Lisp vector, so how do you replace it with a C
> struct and still allow Lisp to populate a menu?

I suggest not trying to change the internal menu representation.

As it is, it allows easily creating very deeply nested menus, and
garbage collection of menu items "just works".

When working on the Haiku port, I tried to represent the menu bar
contents in some more intuitive format, which led to garbage collection
issues and C stack overflows with somewhat deeply nested menus.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]