From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id B930C7ED34 for ; Thu, 5 Jul 2012 06:25:52 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of aaron678@gmail.com) identity=pra; client-ip=209.85.214.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="aaron678@gmail.com"; x-sender="aaron678@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of aaron678@gmail.com designates 209.85.214.182 as permitted sender) identity=mailfrom; client-ip=209.85.214.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="aaron678@gmail.com"; x-sender="aaron678@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ob0-f182.google.com) identity=helo; client-ip=209.85.214.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="aaron678@gmail.com"; x-sender="postmaster@mail-ob0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhwBAA4W9U/RVda2kGdsb2JhbABFFqYJB5B7CCIBAQEBBwsNBxQEI4IYAQEBBBICLAEtCwEDDAEFBQsNDSEiEgEFAQoSBhMSEIdbAwsLmzIJA48UhSwnAwpKiH4BBQyLLYVeYAOVN4ESjRQ+gVSCRg X-IronPort-AV: E=Sophos;i="4.77,528,1336341600"; d="scan'208";a="165650050" Received: from mail-ob0-f182.google.com ([209.85.214.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 05 Jul 2012 06:25:51 +0200 Received: by obbun3 with SMTP id un3so22427804obb.27 for ; Wed, 04 Jul 2012 21:25:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=ri252dBVTXMVZKjuf+O/4I3D0eHSFVw4OWeJ2aqi4YU=; b=iMOKRU8gemJuObGtulHF02QFOzptGNwzvhGLilA2fgkFhvyHf5zoF5xoih9pwjOyWU oUQT/RozVPVyS7qaIGCzGSGkCDzTRUabiI9ze2tjOtAdN05VRG5N01qfRnzvdF/H05Cd FUETnw8QtgG2+pbT/eeUZK69AiOmadzOM749xYCvOnGUIdJRyDYFqnOkpNIGDkqC69Sl sYS604hC88wi6zmORKe3cs5PTboba0XgLFnK/l6HBWMIxizUJyZAqwcpS1kjvGA6H2Ij 4Uc66sVwwOLjj/AuNo4CTmZwN01b1BUpKTqVztA85U4oO0MQXQ6GI+taXW125TkV1WJz K7Fg== Received: by 10.60.20.136 with SMTP id n8mr25038103oee.54.1341462350743; Wed, 04 Jul 2012 21:25:50 -0700 (PDT) MIME-Version: 1.0 Sender: aaron678@gmail.com Received: by 10.76.114.133 with HTTP; Wed, 4 Jul 2012 21:25:30 -0700 (PDT) In-Reply-To: References: <91B9F38E-6553-42A5-AA63-F715983C3136@in.tum.de> From: Aaron Bohannon Date: Thu, 5 Jul 2012 00:25:30 -0400 X-Google-Sender-Auth: DF__iZfoeFsQ_seW0pJFT58v8nQ Message-ID: To: =?ISO-8859-1?Q?Markus_W=2E_Wei=DFmann?= Cc: OCaml List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] ocaml top-level line editing script 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 wr= ote: > 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=DFmann" > 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 >>> >>> >> >> -- >> Markus Wei=DFmann, M.Sc. >> Technische Universit=E4t M=FCnchen >> Institut f=FCr Informatik >> Boltzmannstr. 3 >> D-85748 Garching >> Germany >> http://wwwknoll.in.tum.de/ >>