Re: Creating a new mode

2012-03-12 Thread Jeremy Wall
Has anyone tried using cabal-dev with yi yet? It's on my list of things to try here soon. On Mon, Mar 12, 2012 at 8:02 AM, Jean-Philippe Bernardy wrote: >> ~/yi is the git clone root) there is a folder src but it >> contains {executable, library, parsertest, tests}. Does the >> Makefile need upda

Re: Creating a new mode

2012-03-12 Thread Jean-Philippe Bernardy
> ~/yi is the git clone root) there is a folder src but it > contains {executable, library, parsertest, tests}. Does the > Makefile need updating? What's the usual development cycle for > you guys? I used to use the HackerMain, but not any more. I just "cabal install" every time. I think the next

Re: Creating a new mode

2012-03-07 Thread Paul van der Walt
On Wed, Mar 07, 2012 at 16:21:32 +0100, quoth Jean-Philippe Bernardy: > I'd say it's very likely that you are actually not using the mode > "myModeGen" but something else. Oh geez, that was it. Somehow, even though I was running ./dist/build/yi/yi it was grabbing an old version of myModeGen. It s

Re: Creating a new mode

2012-03-07 Thread Jean-Philippe Bernardy
I'd say it's very likely that you are actually not using the mode "myModeGen" but something else. Certainly the code that you show cannot explain the error you describe. It's puzzling that you have an unused argument in myModeGen, making me guess you have other versions of this code lying around.

Creating a new mode

2012-03-07 Thread Paul van der Walt
Dear all, For a few hours now, I've been playing around trying to make a new mode for Yi. The problem is, it breaks when I try to load a Unicode file with certain characters. For example, I've made a mode which basically only consists of the following: myModeGen _myBinding = fundamentalMode {

Re: Creating a new mode/app: incremental reading

2008-11-28 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Nov 28, 2008 at 11:19 AM, Jean-Philippe Bernardy wrote: > 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

Re: Creating a new mode/app: incremental reading

2008-11-28 Thread Jean-Philippe Bernardy
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 fig

Re: Creating a new mode/app: incremental reading

2008-11-28 Thread Gwern Branwen
-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

Re: Creating a new mode/app: incremental reading

2008-11-27 Thread Jeff Wheeler
On Nov 28, 2008, at 12:17 AM, Jeff Wheeler wrote: > M-x setAnyMode iReaderMode, and don't associate it with any file > types. This is defined in Yi.Misc. By the way, I don't know of any way to do this from the Vim keybindings which I prefer. :yi setAnyMode works, but I cannot seem to get Yi

Re: Creating a new mode/app: incremental reading

2008-11-27 Thread Jeff Wheeler
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 int

Re: Creating a new mode/app: incremental reading

2008-11-27 Thread Gwern Branwen
OK, so I've finished up my mode. It seems to work well, although obviously still very alpha and fragile (and there's a strange consequence of my error-catching which creates an empty article). Whew. This leaves me another question. So far I can't figure out how to simply invoke a mode on a buffer

Re: Creating a new mode/app: incremental reading

2008-11-27 Thread Jean-Philippe Bernardy
On Thu, Nov 27, 2008 at 10:53 PM, nicolas. pouillard <[EMAIL PROTECTED]> wrote: > > Excerpts from Gwern Branwen's message of Thu Nov 27 22:50:31 +0100 2008: >> > On Thu, Nov 27, 2008 at 3:22 AM, Gwern Branwen <[EMAIL PROTECTED]> wrote: >> >> On Wed, Nov 26, 2008 at 5:03 PM, Gwern Branwen wrote: >

Re: Creating a new mode/app: incremental reading

2008-11-27 Thread nicolas . pouillard
Excerpts from Gwern Branwen's message of Thu Nov 27 22:50:31 +0100 2008: > > On Thu, Nov 27, 2008 at 3:22 AM, Gwern Branwen <[EMAIL PROTECTED]> wrote: > >> On Wed, Nov 26, 2008 at 5:03 PM, Gwern Branwen wrote: > >>> setBufferContents doesn't seem to exist. At least, recursive grep > >>> can't fin

Re: Creating a new mode/app: incremental reading

2008-11-27 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Thu, Nov 27, 2008 at 2:24 AM, Jean-Philippe Bernardy wrote: -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEAREKAAYFAkkvFh8ACgkQvpDo5Pfl1oKuZQCfamk8/ptaKf2enU1+aehIXfRs Wa8An16DCrU2NlHY6Ot2hbLxda2nr+Iw =2n8V -END PGP SIG

Re: Creating a new mode/app: incremental reading

2008-11-26 Thread Jean-Philippe Bernardy
On Thu, Nov 27, 2008 at 3:22 AM, Gwern Branwen <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > On Wed, Nov 26, 2008 at 5:03 PM, Gwern Branwen wrote: >> setBufferContents doesn't seem to exist. At least, recursive grep >> can't find anything but setBuffer. > >

Re: Creating a new mode/app: incremental reading

2008-11-26 Thread Jean-Philippe Bernardy
On Wed, Nov 26, 2008 at 11:03 PM, Gwern Branwen <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > On Wed, Nov 26, 2008 at 4:18 PM, Jean-Philippe Bernardy wrote: > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.9 (GNU/Linux) > > iEYEAREKAAYFAkktx7oACgkQvpDo5

Re: Creating a new mode/app: incremental reading

2008-11-26 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Wed, Nov 26, 2008 at 5:03 PM, Gwern Branwen wrote: > setBufferContents doesn't seem to exist. At least, recursive grep > can't find anything but setBuffer. OK, so I found two ways to do this: > setBufferContents :: (MonadEditor m) => String ->

Re: Creating a new mode/app: incremental reading

2008-11-26 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Wed, Nov 26, 2008 at 4:18 PM, Jean-Philippe Bernardy wrote: -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEAREKAAYFAkktx7oACgkQvpDo5Pfl1oJehACcC5Xv/voypK9dyE2oq1ovRCQr 260AnA/qHX2hv/IDahTo2gD24oSt+kpD =m7/c -END PGP SIG

Re: Creating a new mode/app: incremental reading

2008-11-26 Thread Jean-Philippe Bernardy
It seems you're on the right track concerning keybindings and such. Random tips: * You can rebind a key globally though the defaultKeymap field * Use 'io' to lift IO to YiM; * functions to manipulate buffers are in Editor.hs (mostly). * You can use setBufferContents to overwrite the contents of t

Creating a new mode/app: incremental reading

2008-11-26 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello all. So recently I resolved to write, in some sort of Haskell way, an 'incremental reading' utility. For details, see . The summarized version is that an incremental reader is essentially an editor* which has the user read a small portion of a