caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Aaron Bohannon <bohannon@seas.upenn.edu>
To: "Markus W. Weißmann" <markus.weissmann@in.tum.de>
Cc: OCaml List <caml-list@inria.fr>
Subject: Re: [Caml-list] ocaml top-level line editing script
Date: Thu, 5 Jul 2012 00:25:30 -0400	[thread overview]
Message-ID: <CANghcebVyApDK8Dy0KFKWwNc5WP_P5gMSOXY_vE1-pt4WGYC2A@mail.gmail.com> (raw)
In-Reply-To: <CANghceYt7w_300NBN+svBWeNJkSnNHD08tABCaPth6q=3i5SXQ@mail.gmail.com>

Being able to edit the input in vim is really nice.  Unfortunately,
rlwrap seems to erase the line breaks when it records the input in
it's history (zsh remembers them).

 - Aaron
i
On Wed, Jul 4, 2012 at 9:46 PM, Aaron Bohannon <bohannon@seas.upenn.edu> wrote:
> Ah.  Thanks for the tip.  I figured there must have been a more
> well-engineered way to do what I wanted to do....
>
>  - Aaron
>
> On Wed, Jul 4, 2012 at 1:56 PM, "Markus W. Weißmann"
> <markus.weissmann@in.tum.de> wrote:
>> rlwrap? [1] Its probably already available through your favorite package manger.
>>
>>
>> -Markus
>>
>> [1] http://utopia.knoware.nl/~hlub/uck/rlwrap/
>>
>> On 4 Jul 2012, at 19:06, Aaron Bohannon wrote:
>>
>>> Hi,
>>>
>>> One thing that is missing from the OCaml top level loop is line
>>> editing features.  I used to use a wrapper program called "ledit" that
>>> added readline support, but I never seem to have it installed on my
>>> machine when I need it, and moreover, I have started to get used to
>>> the more flexible line editing of zsh.
>>>
>>> After some poking around, I found that it's fairly straightforward to
>>> wrap any REPL with a zsh script and get zsh line editing capabilities,
>>> which includes multi-line support (e.g., so you can fix a typo you
>>> made three lines back).
>>>
>>> I'm attaching the script I hacked together, in case it is useful to
>>> anyone else.  It works great for me, but it was not written to be
>>> generic and robust, so YMMV.  You must use ctrl-D to exit cleanly -- I
>>> didn't bother adding support for "#quit".  I'm sure someone could make
>>> many improvements to it if they had more patience for zsh scripting
>>> than I do.
>>>
>>> - Aaron
>>>
>>> --
>>> Caml-list mailing list.  Subscription management and archives:
>>> https://sympa-roc.inria.fr/wws/info/caml-list
>>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>>>
>>> <zcaml>
>>
>> --
>> Markus Weißmann, M.Sc.
>> Technische Universität München
>> Institut für Informatik
>> Boltzmannstr. 3
>> D-85748 Garching
>> Germany
>> http://wwwknoll.in.tum.de/
>>

  reply	other threads:[~2012-07-05  4:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04 17:06 Aaron Bohannon
2012-07-04 17:56 ` "Markus W. Weißmann"
2012-07-05  1:46   ` Aaron Bohannon
2012-07-05  4:25     ` Aaron Bohannon [this message]
2012-07-04 18:24 ` rixed
2012-07-04 21:19   ` Anthony Tavener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANghcebVyApDK8Dy0KFKWwNc5WP_P5gMSOXY_vE1-pt4WGYC2A@mail.gmail.com \
    --to=bohannon@seas.upenn.edu \
    --cc=caml-list@inria.fr \
    --cc=markus.weissmann@in.tum.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).