A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01122.html below:

Re: Menu bar items structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] 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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4