Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1GWuds-0004ld-AR for mharc-grub-devel@gnu.org; Mon, 09 Oct 2006 08:54:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GWudr-0004jp-3s for grub-devel@gnu.org; Mon, 09 Oct 2006 08:53:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GWudn-0004eP-8Y for grub-devel@gnu.org; Mon, 09 Oct 2006 08:53:58 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GWudn-0004eI-2B for grub-devel@gnu.org; Mon, 09 Oct 2006 08:53:55 -0400 Received: from [212.27.42.35] (helo=smtp5-g19.free.fr) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GWulL-0003pT-8S for grub-devel@gnu.org; Mon, 09 Oct 2006 09:01:43 -0400 Received: from imp2-g19.free.fr (imp2-g19.free.fr [212.27.42.2]) by smtp5-g19.free.fr (Postfix) with ESMTP id 78906275A7 for ; Mon, 9 Oct 2006 14:52:23 +0200 (CEST) Received: by imp2-g19.free.fr (Postfix, from userid 33) id 747F0AC19; Mon, 9 Oct 2006 14:52:23 +0200 (CEST) Received: from 129.184.84.11 ([129.184.84.11]) by imp2-g19.free.fr (IMP) with HTTP for ; Mon, 09 Oct 2006 14:52:23 +0200 Message-ID: <1160398343.452a46075ecea@imp2-g19.free.fr> Date: Mon, 09 Oct 2006 14:52:23 +0200 From: tgingold@free.fr To: The development of GRUB 2 References: <87fye2swwa.fsf@xs4all.nl> In-Reply-To: <87fye2swwa.fsf@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 User-Agent: Internet Messaging Program (IMP) 3.2.5 X-Originating-IP: 129.184.84.11 Content-Transfer-Encoding: quoted-printable Subject: Re: Scripting (IMPORTANT!) 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: Mon, 09 Oct 2006 12:53:59 -0000 Quoting Marco Gerards : Hi, a few remarks: [...] > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Menu entries > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Menu entries are added with `menuentry' (or its alias `@'). It's > important to notice this is not a command. Because it's part of the > scripting syntax, it can have unique features. A menuentry is like a > function, especially because it can have arguments! > > Syntax: menuentry "Entry name" [arguments...] { body } It would be nice to be able to add properties to a menuentry. My first idea is a logo property. I think this could be done through a new command such as: logo "Entry name" filename > Make sure the entry name is properly escaped, otherwise spaces can not > be included and will be seen as separator. The arguments will become > semi-variables like #1, #2, etc. These can be used so one menuentry > can be used as a template for a lot of menuentries. This can best be > explained with an example: > > (inside loop that sets i =3D 1...x) > @ "Partition $i" $i { linux /vmlinuz root=3D/dev/hda#{1} } Why not substituing variable at creation (unsubstitued one can be escaped= ) ? Eg: @ "Partition $i" { linux /vmlinux root=3D/dev/hda$1 prefix=3D$$prefix= } Humm maybe too complex ? Tristan.