slang-users mailing list

[2015 Date Index] [2015 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-users] Re: slsh_readline


John E. Davis <jed@xxxxxxxxxxx> wrote:

> Morten Bo Johansen <mbj@xxxxxxxxxxx> wrote:
> > Is it possible to construct a prompt with slsh_readline that
> > emulates the jed function,
> >
> >   String read_mini (String prompt, String dflt, String init);
> 
> I looked into seeing what it would take to add this feature, but the
> most straightforward way would break both ABI and API compatibility.  So
> the feature will have to wait until version 3.
> 
> Instead, you can try the following approach which stuffs the history
> buffer with the init string.  This assumes that you are using slang's
> readline and not GNU's.
> 
> In the example below, "foobar" will get added to the history.  If you
> want to edit it, press the UP arrow.  I had hoped for a better
> solution, but this one is the least kludgy.
[...]

It is a very good solution and actually preferable to the one I
asked for. For spell checking one would probably want the
misspelled word pushed onto the editing field in most, but not
all cases. This way the user has a choice. It just needs to be
documented.

Thank you very much!

Morten
_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.


[2015 date index] [2015 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]