From help-request at octave dot org Thu Sep 23 09:57:18 2004 Subject: Re: What does the exit command do? From: "John W. Eaton" To: Francesco Potorti` Cc: octave help mailing list Date: Thu, 23 Sep 2004 10:56:21 -0400 On 23-Sep-2004, Francesco Potorti` wrote: | > OCTAVE_HISTFILE=/dev/null octave -qH myfunction.m | | In my humble opinion, this should be the normal behaviour when Octave is | called with -h. | | What I mean is: when Octave is called with option -h, it shouldn't touch | the history file. The reason that this is not the way things work is because -h only implies an initial value of "saving_history" to be "false". Later in the session the value of "saving_history" can be changed to "true". Then I think the expected behavior would be to save commands to the history file. Or, you could start with it set to true and set it to false part way through the session. In that case, you would probably still want to save the differences in the history list that is in memory. I think the proper way to implement this feature is at the level of the history library. If the history list has not changed, then no attempt needs to be made to save it. Octave could probably attempt to keep track of this information, but I think it more logically belongs inside the history library. Perhaps I'm missing something obvious, but I don't see a simple way to ask the history library (part of GNU readline) whether the history has been modified. If someone can show me how to get this information from the history library or get the feature added to the readline library, then I would be happy to change Octave so that it avoids saving the history file if it has not been modified. Thanks, jwe ------------------------------------------------------------- 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 -------------------------------------------------------------