On 12-Feb-2009, Thomas Weber wrote: | Am Mittwoch, den 11.02.2009, 17:55 +0100 schrieb Rafael Laboissiere: | > * Thomas Weber <thomas.weber.m...@gmail.com> [2009-02-11 13:34]: | > | > > I don't think so. Seems to me like octave is accessing .octave_hist | > > despite the --no-history flag. Snippet from | > > $ strace -f octave --no-history | > > | > > open("/home/weber/.octave_hist", O_RDONLY) = 3 | > > open("/home/weber/.octave_hist", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 3 | > > | > > I seem to remember that this came up once already, but can't find it | > > currently. | > | > Is this an upstream bug? | | If it's a bug, yes. It seems that --no-history only influences the | saving of the new command at the end of an Octave session. | | Then again, it seems logical to read it, so you can scroll the history | of past commands. I'm not sure that fixing the current corner-case of | non-readable .octave_hist file is worth the effort.
The option --no-history is supposed to mean no history at all. What I see is that the history file is not read, and commands are not saved to the history list, but then the history (an empty list) is still saved to the history file when Octave exits, wiping out whatever was there before. I checked in the following change. Thanks, jwe
# HG changeset patch # User John W. Eaton <j...@octave.org> # Date 1234548184 18000 # Node ID afbfd7f4fd931c9460102aec3eb073f78839276e # Parent 767ed8cc6634851b239e3b181fa18fd7984c2678 toplev.cc (do_octave_atexit): only save history if Vsaving_history is true diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-02-13 John W. Eaton <j...@octave.org> + + * toplev.cc (do_octave_atexit): Only save history if + Vsaving_history is true. + 2009-02-12 John W. Eaton <j...@octave.org> * data.cc, ov-base-diag.h, ov-base-mat.h, ov-base-scalar.h, diff --git a/src/toplev.cc b/src/toplev.cc --- a/src/toplev.cc +++ b/src/toplev.cc @@ -984,7 +984,8 @@ octave_history_write_timestamp (); - command_history::clean_up_and_save (); + if (Vsaving_history) + command_history::clean_up_and_save (); close_files ();