unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
To: rob.rosetti@gmail.com
Cc: guile-user ML <guile-user@gnu.org>
Subject: Re: How to flush history ?
Date: Wed, 26 Aug 2009 22:38:40 +0100	[thread overview]
Message-ID: <87tyzuntlr.fsf@arudy.ossau.uklinux.net> (raw)
In-Reply-To: <1250355695.27999.10.camel@ubuntu> (Roberto Rosetti's message of "Sat\, 15 Aug 2009 19\:01\:35 +0200")

Roberto Rosetti <rob.rosetti@gmail.com> writes:

> 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. 

Well I wasn't aware of it before, but I just looked at
guile-readline/readline.c and noticed that there is a write-history
primitive:

SCM_DEFINE (scm_write_history, "write-history", 1, 0, 0, 
            (SCM file),
"")
#define FUNC_NAME s_scm_write_history
{
  char *filename;
  SCM ret;

  filename = scm_to_locale_string (file);
  ret = scm_from_bool (!write_history (filename));
  free (filename);
  return ret;
}
#undef FUNC_NAME

Is that a solution for you?

Regards,
        Neil





      reply	other threads:[~2009-08-26 21:38 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
2009-08-26 21:38     ` Neil Jerram [this message]

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=87tyzuntlr.fsf@arudy.ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    --cc=guile-user@gnu.org \
    --cc=rob.rosetti@gmail.com \
    /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).