From bug-request at octave dot org Tue Mar 29 14:39:02 2005 Subject: Re: Option -H is ignored on GNU Octave, version 2.1.57 From: Luiz Angelo Daros de Luca To: "John W. Eaton" Cc: bug at octave dot org Date: Tue, 29 Mar 2005 14:31:29 -0600 --nextPart9054174.kR5IXI7J8i Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline So, now its OCTAVE_HISTFILE that doesn't work :-)=20 OCTAVE_HISTSIZE is ok # export OCTAVE_HISTFILE=3D/tmp/test # export OCTAVE_HISTSIZE=3D123 # octave GNU Octave, version 2.1.57 (x86_64-mandrake-linux-gnu). Copyright (C) 2004 John W. Eaton. This is free software; see the source code for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or =46ITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'. Additional information about Octave is available at http://www.octave.org. Please contribute if you find this software useful. =46or more information, visit http://www.octave.org/help-wanted.html Report bugs to (but first, please read http://www.octave.org/bugs.html to learn how to write a helpful report). octave:1> history_file history_file =3D /root/.octave_hist octave:2> history_size history_size =3D 123 Em Ter 29 Mar 2005 14:58, John W. Eaton escreveu: > On 29-Mar-2005, Luiz Angelo Daros de Luca wrote: > | According to its help, the option -H or -- avoids octave to save its > | history file. But even using it, it still writes in the file. > | > | # octave --help > | GNU Octave, version 2.1.57 (x86_64-mandrake-linux-gnu). > | Copyright (C) 2004 John W. Eaton. > | (...) > | --no-history, -H Don't save commands to the history list > | (..) > > Perhaps the wording could be better. This just means that Octave will > not add commands to the history list, not that it won't try to write > the contents of the list when it exits. When I start Octave with -H, > the history list does not grow and the contents of the history file > are unchanged after exiting, so I think this option is working > properly. > > Starting Octave with -H sets the initial value of the built-in > variable "saving_history" to false. You can later change that to > true, then back to false, so when Octave exits, it is not sufficient > to simply check the value of "saving_history" and not write the > history file if the value is false. > > If you want to avoid touching the history file when Octave exits, then > set the built-in variable history_file to "/dev/null". > > It might be nice if the readline library did not write to the history > file if the history list has not changed, but it might not be a > trivial change. I can think of a number of sticky problems associated > with trying to get this right. For example, in addition to noting a > change in the history list, you will have to keep track of the file > that was used to initialize the list and only skip writing if there > have been no changes to the list and the file used for writing is the > same as the file used for reading. If you want this feature, then I > suggest submitting a patch for readline. > > jwe =2D-=20 Luiz Angelo Daros de Luca luizd at inf dot ufsc dot br ICQ : 19290419 I Know, "Where you wanted to go today", but I decided to stop here instead! MS Windows=20 --nextPart9054174.kR5IXI7J8i Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBCSbr2Ib+VUvsnWJYRAidLAJ93mZPc4AwZ4mCbKZI+71qQAIYjvgCgxJpf uawOFvcCLKCtQszMEuhoojM= =V7+M -----END PGP SIGNATURE----- --nextPart9054174.kR5IXI7J8i-- ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------