Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1D1BfS-0006pZ-HZ for mharc-grub-devel@gnu.org; Tue, 15 Feb 2005 17:59:42 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D1BfP-0006pB-8A for grub-devel@gnu.org; Tue, 15 Feb 2005 17:59:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D1BfO-0006ou-J1 for grub-devel@gnu.org; Tue, 15 Feb 2005 17:59:38 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D1BZz-0005Vv-Sd for grub-devel@gnu.org; Tue, 15 Feb 2005 17:54:03 -0500 Received: from [212.43.237.68] (helo=kotoba.storever.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D1B4y-0000md-0Y for grub-devel@gnu.org; Tue, 15 Feb 2005 17:22:00 -0500 Received: from ASSP-nospam (localhost [127.0.0.1]) by kotoba.storever.com (Postfix) with ESMTP id 85DB5FEA0E01 for ; Tue, 15 Feb 2005 23:21:59 +0100 (CET) Received: from 127.0.0.1 ([127.0.0.1] helo=localhost) by ASSP-nospam ; 15 Feb 05 22:21:59 -0000 From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Tue, 15 Feb 2005 23:23:09 +0100 User-Agent: KMail/1.7.1 References: <200502142225.36773.okuji@enbug.org> <42125A96.2060402@yahoo.fr> In-Reply-To: <42125A96.2060402@yahoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200502152323.09524.okuji@enbug.org> Subject: Re: some design issues X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2005 22:59:39 -0000 On Tuesday 15 February 2005 21:24, Vincent Pelletier wrote: > Isn't it already present ? No. > There is a "nested" variable passed to menu main function, that > should do the trick (leaving a menu which is nested would give back > the control to the calling menu, which would redraw itself). It is a different thing. The question is, for example, how to add a new menu entry into current menu. Suppose this command: entry "foo" { } The command "entry" should be an ordinary command. I don't want to make it special like "title" in GRUB Legacy. Then, this command must be able to access a menu variable. So, one way is to define the function like this: grub_err_t grub_cmd_entry (struct grub_arg_list *state, int argc, char **args, grub_context_t context) { grub_menu_add_entry (context->menu, ...); ... } Another way is: grub_err_t grub_cmd_entry (struct grub_arg_list *state, int argc, char **args) { grub_context_t context = grub_get_context (); grub_menu_add_entry (context->menu, ...); ... } Okuji