This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [bug] readline completion


karlheg@inetarena.com (Karl M. Hegbloom) writes:

>  There are other problems with it also.  You can call `readline' with
>  a prompt for it to print, but you cannot give it a default string to
>  poke in behind the prompt.

One hack I noticed wasn't working in the guile snapshots is dynamic
prompts --- that is every time guile thinks readline is about to
prompt you, it calls a prompt generator. 

>  I'd think we'd like to have something that works like the emacs
>  minibuffer functions, where you can specify a prompt, a default, and
>  also a history list variable.  It would be good, perhaps, to also be
>  able to specify a readtable (aka syntax-table).

Specifying a prompt is possible; you just set the right global
variable before you call readline.  Defaults would be handy.  A
history list would also be handy.  The current interface is designed
to be simple, though; it's supposed to be dropped into (eg) telnet or
FTP clients without rewriting them.  So it would be worth providing
the current interface by using defaults. 

>  What's best?  To go straight to readline itself and try to learn how
>  to add that functionality there, or just bypass it and write in guile 
>  or libguile?  YTMAWBK [1] -- I've a long way to go before I can do
>  that work myself.

Hacking readline is attractive, since bash could profit from it as
well.  IIRC, it's not too complicated, although I've looked mainly at
the interface rather than the guts. 

>  I guess while we're on the subject...  Have you ever used `zsh'?
>  It's got a really neat multi-line editor.  You can use the uparrow
>  like you can in `bash', but it will let you edit multiline commands.
>  Zsh also has great extended globbing features.

ISTR bash can be made to do that with an appropriate setting.  zsh is
my shell on a couple machines but I haven't *really* used it (you know
how it is with Un*x).  It would be nice if the code from zsh was
modular enough that we could plunder it for guile.  Is it?

> Footnotes: 
> [1]  You Tell Me And We'll Both Know

Andrew