[Top][All Lists]

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

Re: [PATCH] Split of normal mode (version 2)

From: Bean
Subject: Re: [PATCH] Split of normal mode (version 2)
Date: Fri, 10 Apr 2009 13:17:54 +0800

On Fri, Apr 10, 2009 at 7:49 AM, Yoshinori K. Okuji <address@hidden> wrote:
> On Tuesday 07 April 2009 01:39:23 Bean wrote:
>> Hi,
>> This is another update of the patch.
>> 1, Now completion.c is in menu.mod, and menu_viewer.c is in misc.mod,
>> the reason for the switch is to allow configfile to depend on misc.mod
>> only.
> I think the name "misc.mod" is ugly. Can you think about a better name?


Perhaps lib.mod, or helper.mod ?

>> 2, Auto generate handler.lst file, which contain module information
>> for handlers. normal.mod uses it to register commands to set active
>> handler, for example:
>> menu_viewer.text
>> terminal_output.gfxterm
> Great.
>> 3, configfile now support an optional parameter to specify the script
>> engine, for example:
>> configfile /aa.cfg sh
>> When configfile returns, the script engine would be restored to the
>> previous value. This is useful for switching script engine. For
>> example, you can parse a file in another language, then switch back to
>> sh for the rest of grub.cfg.
> I object to the syntax, but not to the idea. "configfile" is GRUB-specific, so
> it might be acceptable. But IIRC the underlying function is shared
> with "source", right? In Bourne Shell, "source FILE ARG" means that the file
> FILE is executed with a positional argument ARG. So it is not intuitive to
> specify a parser this way.

Yeah, I don't like the syntax either, but we need to find a way to
distinguish between the "configfile" and "source". "source" operates
on the current environment, while "configfile" create a new

> I proposed using a shebang some days ago. Was it so bad?

I like that idea too, but it needs to change grub_file_getline a
little bit as currently it treats lines starting with '#' as comment,
so we don't have a chance to examine the contents behind it.

Perhaps we can combine this with configfile/source. For example, when
it reads a file starts with #!, it automatically switch parser, and
restore back to the original parser on exit. This way, we don't need
to hack the configfile/source command at all.


reply via email to

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