From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Menu bar items structure Date: Thu, 17 Nov 2022 09:49:53 +0200 Message-ID: <83iljednq6.fsf@gnu.org> References: <87pmdmkdrh.fsf@elite.giraud> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30665"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Manuel Giraud Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 17 08:51:04 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovZfr-0007ik-FU for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Nov 2022 08:51:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovZf1-0005t5-8i; Thu, 17 Nov 2022 02:50:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovZeq-0005r1-DW for emacs-devel@gnu.org; Thu, 17 Nov 2022 02:50:01 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovZep-0002KV-5H; Thu, 17 Nov 2022 02:49:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=4SfJbJGkEIgRgBnIhZXxmeDAp/WGaOHkyoVCSc7G17k=; b=TS8INRPY8JfQ Q64OnN6eJXgGXllfk+d3Wg4kEB+Pa92Z7r+gaPsTzGdNx5Wtod/DasBuD0c0bt1uf8jkibP1z8Dm+ hucbtIQUYD80WSupOXq27OMth57ZSyGvibCJql+2Y7ofmJoZtgzaW0B8NT1IHu70dENKGFvVSSxzP AkxQF+/4t2ApZ5YapvYo7xuVhlPDOFRxQUPxo7RQFwCQremH4tCsresJleWZNNkE81VwLyT7ZK0jU /XCtsYjmza9mM3cEF5/IeytuhXaQfZ45Ed0Ysa1E0XzgDKhHEpfxSUz+KftavhcckRQ5ib3QnAswK QYXql0SKHZ86pUmG2hYN3A==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovZei-0002Yu-V5; Thu, 17 Nov 2022 02:49:56 -0500 In-Reply-To: <87pmdmkdrh.fsf@elite.giraud> (message from Manuel Giraud on Wed, 16 Nov 2022 18:30:58 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300021 Archived-At: > From: Manuel Giraud > 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?