Tue 13 Aug 2013 05:21:18 AM UTC, comment #8:
Works here, thank you.
|
Tue 13 Aug 2013 02:02:44 AM UTC, comment #7:
I am pretty sure the histdata_t field was not being used. I pushed the following changeset to fix this.
http://hg.savannah.gnu.org/hgweb/octave/rev/06824c3b1ff3
|
Thu 08 Aug 2013 03:12:57 PM UTC, comment #6:
I see the latter was noticed already: https://savannah.gnu.org/bugs/?39728
|
Thu 08 Aug 2013 03:10:56 PM UTC, comment #5:
Oh yeah, thanks. I sort of recalled there was some type of configuration for history, but in "help history" there is no mention of it. Perhaps the function "history_control" should be mentioned there, i.e.,
("ignoreboth" should be deprecated, in my opinion. It's confusing and/or meaningless if a third option is added.)
I also notice that when configuring history_control("ignorespace:ignoredups") that the GUI history window still includes those so it doesn't behave exactly the same as the history.
|
Thu 08 Aug 2013 11:44:02 AM UTC, comment #4:
I don't think a history line is data, a history line can have data associated with it. It doesn't appear that we use that feature, but I'm not sure.
Line numbers are definitely used, compare these three invocations:
If you want to ignore lines that are nothing but spaces, use
Put that into your octaverc. This will actually not record any line that starts with a single space. This is a standard readline history feature compatible with bash and other readline programs.
|
Thu 08 Aug 2013 06:45:54 AM UTC, comment #3:
Or maybe
I'm not sure what is all in the history list.
|
Thu 08 Aug 2013 06:38:13 AM UTC, comment #2:
OK. Thanks for finding that. The code could even possibly introduce line numbers, or possibly introduce a * character if the history line is data, not a command. Are these some remnant features? Looking at the "help history", there is only an option to suppress line numbers (-q), so that would suggest at one time the default was for line numbers to appear. Perhaps all these possible clarifications were deactivated at one time. It is really only the commands that the GUI should be displaying.
Perhaps we could ask the list if anyone recalls or sees a reason to keep the following:
as opposed to just:
There is something else that should be kept out of the history, in my opinion, whitespace lines with no command. In the GUI, try typing spaces and hitting return. There are whitespace lines showing up in the history.
|
Thu 08 Aug 2013 05:24:48 AM UTC, comment #1:
Confirmed, has nothing to do with the GUI. Here's the section of code that inserts the space you are seeing:
http://hg.savannah.gnu.org/hgweb/octave/file/efd8963f925f/liboctave/util/oct-rl-hist.c#l291
If I'm not missing anything, I don't see the history data member (application-specific data) being used by Octave, so that could be simplified and removed.
|
Thu 08 Aug 2013 02:25:46 AM UTC, original submission:
When a command is typed at the GUI command line window it appears nicely aligned to the left of the history window. However, upon exiting and relaunching, those same commands now have an extra white space between the left margin and the command. It would be much nicer for that white space to not be introduced.
I have confirmed that this white space is being introduced at the Octave core, not the GUI, by testing the following alteration:
I investigated a bit into the core and I see oct-hist.cc and cmd-hist.cc handle this. However, it may not be that this is where the issue lies, e.g., reading the history back in.
In fact, it looks as though the issue is when the command is placed in the history buffer (and I'm renaming the title appropriately and changing this from a GUI issue). Try the following:
Perhaps that space is added to make the up-arrow recall naturally have a single white space character between the right-arrow character and the command, but my feeling is that the history shouldn't have the extra white space in that way. The user never typed in that white space. Instead, that white space should be added as part of the code that recalls the command.
I suspect that when the command is processed by Octave core it sends the command to the GUI history window, but it also places it in it's own history with the white space. But this is odd because recalling a command from history by typing the up-arrow and then hitting return does not put a white space at the front of the latest GUI history list. Is that white space being removed when pulled from the history buffer before processing? Strange.
|