unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Roberto Rosetti <rob.rosetti@gmail.com>
To: guile-user ML <guile-user@gnu.org>
Subject: Re: How to flush history ?
Date: Sat, 15 Aug 2009 19:01:35 +0200	[thread overview]
Message-ID: <1250355695.27999.10.camel@ubuntu> (raw)
In-Reply-To: <87ws56yt04.fsf@arudy.ossau.uklinux.net>

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





  reply	other threads:[~2009-08-15 17:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-02  9:22 How to flush history ? Roberto Rosetti
2009-08-14 21:39 ` Neil Jerram
2009-08-15 17:01   ` Roberto Rosetti [this message]
2009-08-26 21:38     ` Neil Jerram

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=1250355695.27999.10.camel@ubuntu \
    --to=rob.rosetti@gmail.com \
    --cc=guile-user@gnu.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).