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

On Mon, Feb 9, 2009 at 6:30 PM, Daniel Schoepe <[email protected]> wrote:
>
> I'm currently trying to implement something like Emacs' mode-hooks(So
> that a user-specified function is run when setting a mode) by adding a
> Map String (YiM ()) or Map String (AnyMode -> YiM AnyMode) field to the
> Config structure, but that introduces the problem of needing the type
> YiM, which is defined in Yi.Keymap, in Yi.Config. Since Yi.Keymap
> depends on Yi.Config, just importing it would create a dependency cycle.
> I tried adding this type to Keymap.hs-boot, but this causes the
> NewtypeDeriving in Keymap.hs for YiM to fail(I also tried using
> standalone deriving and listing the instances in Keymap.hs-boot, but
> that didn't change anything).
> Would it be acceptable to move these types(Action,Yi,YiM,YiVar) to
> another module to avoid this problem or is there some way to get them to
> work in Keymap.hs-boot?
> Maybe I'm going completely in the wrong direction about that mode hook
> feature, so if that's the case, please suggest a better way to implement
> such behaviour.
>
> >
>

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

Reply via email to