Jean-Philippe Bernardy wrote:
> I think you should add a field "onLoad :: Action" in the Mode record
> in Yi.Buffer.Misc.
> It would be better to use YiM if it wasn't for the dependency cycle mess.
> 
> Hope this helps
> -- JP

Thanks for the help, but I see two (potential) problems with that:
1. Some modules/functions directly set the mode to some hardcoded Mode
structure(like `interactive' in Yi.Mode.Interactive) which can't be
practically changed in yi.hs. Having the mode hooks depend on everything
else to use the modeTable from Config wouldn't be such a good idea in my
opinion.
2. That way it is less simple to add a mode hook in the configuration,
since one has to figure out what the default mode structure for that
mode is, change it, add it to the modeTable and one probably also wants
to remove the old mode structure from (modeTable defaultConfig). Using
nubBy with the modeNames on the resulting list isn't hard though, but it
clutters up the config.

Besides, I think there's a conceptual point here: Is it really intended
that something as basic as `Action',`Yi' or `YiM' is in the _Keymap_
module? As that example shows, these data types aren't limited to things
related to keyboard input as putting them in Keymap might suggest. So I
would be in favor of moving these data types to a different, more basic,
module, since similar issues might arise for future modifications as
well. (And it would make more sense from my point of view)
Would this refactoring cause any significant problems I'm overlooking here?

--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
[email protected]
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---

Reply via email to