help-grub
[Top][All Lists]
Advanced

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

Re: Exporting a variable to use it in a submenu or menuentry function ?


From: Andrei Borzenkov
Subject: Re: Exporting a variable to use it in a submenu or menuentry function ?
Date: Wed, 10 Feb 2016 21:32:16 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

10.02.2016 21:15, Arbiel (gmx) пишет:
> If "new context" means "new displayed menu", what happens then when
> escaping a submenu to return to the previously displayed menu ? Do you
> have, in the submenu, to export back the variables ?
> 

As I already said

> Variables created in new context are lost when
> context is destroyed (e.g. you exit submenu).

May be I should have used "variables *set*".

There is no way to propagate variables back to previous context.

> Le 10/02/2016 17:56, Andrei Borzenkov a écrit :
>> 10.02.2016 14:34, Arbiel (gmx) пишет:
>>> Hi
>>>
>>> Is it necessary to export a variable, set in the configuration file, to
>>> be able to use it in a menuentry ?
>> No, if it is set in the same variable context.
>>
>>> Does it matter whether the menuentry
>>> is embedded or not in a submenu function ?
>>>
>> Yes. Submenu runs in new variable context. Each context has completely
>> separate set of variables. When new context is created, exported
>> variables are copied in new context. Without any exports new context
>> would start empty. Variables created in new context are lost when
>> context is destroyed (e.g. you exit submenu).
>>
>> I do not know what was the rationale for this. Personally I find it
>> rather confusing.
>>
>> I have in mind documenting but cannot decide in which part of manual it
>> fits :)
>>
> 
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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