[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Improve the use of GNU readline
From: |
Thomas Walter |
Subject: |
Re: Improve the use of GNU readline |
Date: |
Tue, 13 Apr 1999 10:41:15 +0200 |
>>>>> "John" == John W Eaton <address@hidden> writes:
John> On 7-Apr-1999, Thomas Walter <address@hidden> wrote:
John> | has anybody investigated some time on the use of GNU readline in
John> | 'octave' ?
John> |
John> | The improvement I mean is to add a new entry in the history only if
John> | the current line has changed compared with the previous line.
John> I don't know of anyone who has done this. If anyone is interested in
John> working on it, I think it would be best to do something similar to the
John> HISTCONTROL feature from bash, though it might be better to use a
John> regular expression match instead of a shell pattern match.
Currently I do not know anything about this feature.
My idea about adding new entries to the history list is this:
Nothing with regular expressions and / or shell pattern.
+ Read a new command line
+ Compare this line with the top most entry in the history list
+ If they differ add it to the history else don't.
For speed string compare may slow down your response:
+ first compare the first characters of the two strings
+ if they are equal
convert the first 4 characters of each string to an unsigend
32-bit integer and compare them
+ if this is still equal do a string compare
I would give it a try, but I'm not so familiar with C++ and the
affected code to do the changes.
Bye
Thomas
--
"Beweiss" fuer die These: 'Alle ungeraden Zahlen sind prim.'
3, 5, 7, 11, alle sind ungerade und prim.
9 ist ist ein irrelevanter Messfehler.
==> Bingo! 8-))))))
----------------------------------------------
Dipl. Phys. Thomas Walter
Inst. f. Physiklische Chemie II
Egerlandstr. 3 Tel.: ++9131-85 27326 / 27330
91058 Erlangen, Germany email: address@hidden