[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: .octave_hist content

From: Jordi Gutiérrez Hermoso
Subject: Re: .octave_hist content
Date: Tue, 11 Jan 2011 05:13:40 -0600

On 11 January 2011 03:57, CdeMills <address@hidden>
> Would it be possible, for the history file, to store:
> - statement last execution time
> - statement value

This is already possible, sort of, with
history_timestamp_format_string, but that only gives the timestamp for
a batch of commands since you started the Octave session.

> This way, something repeated a big number of times would only
> 'consume' one line in the history file.

I'm suprirsed it's not already implemented, actually. History and line
editing in Octave are largely modeled on bash (the source code even
says it was "stolen" from bash), and bash has a HISTCONTROL
environment variable that lets you set options that do exactly that.
It has an ignoredups option that doesn't save duplicate history lines
and erasedups instead saves previous matching history lines. I think
you want the ignoredups option. There is additionally a HISTFILESIZE
variable that lets you control how large you want your history.

Given how Octave's history editing is based on bash and bash already
implements what you want, it may be possible to port more of bash's
history-manipulating code into Octave. Do you need help understanding
Octave's or bash's source code in order to accomplish this?

- Jordi G. H.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]