On Fri, Nov 28, 2008 at 4:36 PM, Gwern Branwen <[EMAIL PROTECTED]> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> On Fri, Nov 28, 2008 at 1:17 AM, Jeff Wheeler  wrote:
>> On Nov 28, 2008, at 12:03 AM, Gwern Branwen wrote:
>>
>>> This leaves me another question. So far I can't figure out how to
>>> simply invoke a mode on a buffer. I mean, in Emacs one might create a
>>> new buffer, and then do M-x ireader-mode, or whatever. But in Yi, the
>>> only mechanism I see to get into my incremental reader mode is to add
>>> a config line like:
>>>
>>>>   modeTable = AnyMode bestHaskellMode : AnyMode
>>>> IReader.ireaderMode : modeTable defaultConfig,
>>>
>>> But the problem with that is that each mode registers file suffixes
>>> they should be used for (I chose 'irtxt', seemed reasonable & unlikely
>>> to be used), and so one has to open up a file of that name. You can't
>>> do M-x ireaderMode. I am unsure why.
>>
>> M-x setAnyMode iReaderMode, and don't associate it with any file
>> types. This is defined in Yi.Misc.
>>
>> Hope that helps. :)
>>
>> Jeff Wheeler
>
> I'm certain there must be something I'm missing here. Your M-x works,
> I mean, but I was really hoping to just be able to do M-x ireadmode or
> whatever (more discoverable). I tried to do the non-minibuffer version
> of that command, defining:
>
>> ireadMode ::  BufferM ()
>> ireadMode = setAnyMode $ AnyMode ireaderMode
>
> and then going into Main.hs (where all the minibuffer commands seem to
> be defined) and adding:
>
>>    , ("ireadMode"              , box ireadMode)
>
> But nevertheless, M-x i only ever shows 'insertB' as an option -
> despite insertB being used in Main.hs, as far as I can tell, the exact
> same way as ireadMode and having the same return type of BufferM ().
>
This should work, I'd say you were not running the code that corresponds to
the source somehow (this can be easy to miss since yi recompiles itself and
launches that copy of the bin).

-- JP

--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
yi-devel@googlegroups.com
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---

Reply via email to