From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Roberto Rosetti Newsgroups: gmane.lisp.guile.user Subject: Re: How to flush history ? Date: Sat, 15 Aug 2009 19:01:35 +0200 Message-ID: <1250355695.27999.10.camel@ubuntu> References: <1249204942.25578.5.camel@ubuntu> <87ws56yt04.fsf@arudy.ossau.uklinux.net> Reply-To: rob.rosetti@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1250355707 5925 80.91.229.12 (15 Aug 2009 17:01:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Aug 2009 17:01:47 +0000 (UTC) To: guile-user ML Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Aug 15 19:01:39 2009 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1McMdP-0004GM-6n for guile-user@m.gmane.org; Sat, 15 Aug 2009 19:01:39 +0200 Original-Received: from localhost ([127.0.0.1]:56220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McMdO-0006u9-PG for guile-user@m.gmane.org; Sat, 15 Aug 2009 13:01:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1McMd9-0006sQ-JG for guile-user@gnu.org; Sat, 15 Aug 2009 13:01:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1McMd4-0006ol-VV for guile-user@gnu.org; Sat, 15 Aug 2009 13:01:23 -0400 Original-Received: from [199.232.76.173] (port=55185 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McMd4-0006oi-Ql for guile-user@gnu.org; Sat, 15 Aug 2009 13:01:18 -0400 Original-Received: from ey-out-1920.google.com ([74.125.78.146]:15117) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1McMd4-0000aj-A5 for guile-user@gnu.org; Sat, 15 Aug 2009 13:01:18 -0400 Original-Received: by ey-out-1920.google.com with SMTP id 5so620049eyb.24 for ; Sat, 15 Aug 2009 10:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:reply-to:to :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=H/s4wJYHIxfDJ4dtqYwYyfpp8DxBIjhUIlqVVZVC9hc=; b=ZxN1JgwfFyovo13JSiLCNmZW6qXLBT7gKfqjGqnTaU0y6E8FioBDsfmkh4nZA1XBo3 JvGgHm2BunuKAFjUmro6IfI6s5DXEJsRL3lSV22Klu5aP3g80ZQzRts96QaswcuLTz1V 1jCAII4eoo3rBoKu7lHF5gLiCeek3WW/+3fdg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:reply-to:to:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=kRnPjUEjrSRTBFKlZjeuXS2em9cWrxLe+yeU2wbT5j1a1rSue/wLtBA5gEHGXGK8E+ tTZjN2KsTDNYPbnZpQsU9/yvG1i11PkZ/H8oddRATFPFAd5LJuv+McU3TIRGYi1dwRmI yMAOHAUPepabJXrfxS/G7IjtCgbFnFqW5g16k= Original-Received: by 10.216.53.133 with SMTP id g5mr673142wec.160.1250355676158; Sat, 15 Aug 2009 10:01:16 -0700 (PDT) Original-Received: from ?192.168.0.5? (host123-20-dynamic.48-82-r.retail.telecomitalia.it [82.48.20.123]) by mx.google.com with ESMTPS id i34sm8799446gve.13.2009.08.15.10.01.13 (version=SSLv3 cipher=RC4-MD5); Sat, 15 Aug 2009 10:01:14 -0700 (PDT) In-Reply-To: <87ws56yt04.fsf@arudy.ossau.uklinux.net> X-Mailer: Evolution 2.22.3.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7409 Archived-At: On friday, 14/08/2009 alle 22.39 +0100, Neil Jerram writes: > > > Hi all, > > > > I'm wondering how to flush the recent readline history to a file. I need this > > feature for an educational project. > > The purpose is to permit the REPL user to save his entire history with a simple ..... > Hi Roberto, > > The readline history is already saved to a file, ~/.guile_history. > Does that provide what you need? > > (I'm not sure offhand if it is saved after every line is entered, or > when you quit Guile; but maybe that difference is not important for > you anyway.) > Neil Well, thanks for the answer Neil. I know about the existence of ~/.guile_history, but my problem is more complex: I need a hook to the history buffer, like a port or something. A way to flush the history to its file at a given command. Just to grab everything written before and then manipulate (a copy of) the history file. For the moment, I've written a simple wrapper for readline, that process the input and save every command to a specific text file, after checking it for correctness. An alternate solution may be to change the GUILE_HISTORY envrironment variable at run-time, but I thing it's not an elegant solution at all. Rob -- Roberto Rosetti OpenPGP Public key: 30575161