Subject: function/variable name completion via rlwrap
From: Camm Maguire
Date: 15 Dec 2005 09:04:27 -0500
Greetings!
Robert Dodier writes:
> Hi Camm,
>
> > I see -- you mean maxima and lisp functions in the maxima package,
> > but using lisp like syntax. This is correct.
>
> Sorry, I wasn't clear enough. In Maxima built w/ GCL,
> when I type readt it completes to READTABLE.
> Likewise forma completes to FORMAT.
> Other strings complete to other symbols in the LISP package.
> It doesn't recognize symbols which exist in Maxima
> (such as $SAVE and $EXPAND) but not in Lisp.
>
> > Would it be useful to provide a user hook to tailor readline
> > completion from within GCL?
>
> Well, maybe not, since it wouldn't address readline
> capabilities for other Lisp flavors. But thanks for asking.
>
Ah yes, I had forgotten about this. Sometime ago, I put the following
in GCL for maxima's benefit:
-- Variable: *READLINE-PREFIX*
Package:SI
A string implicitly prepended to input text for use in readline
command completion. If this string contains one or more colons,
it is used to specify the default package and internal/external
setting for searched symbols in the case that the supplied text
itself contains no explicit package specification. If this string
contains characters after the colon(s), or contains no colons at
all, it is treated as a symbol name prefix. In this case, the
prefix is matched first, then the supplied text, and the
completion returned is relative to the supplied text itself, i.e.
contains no prefix. For example, the setting "maxima::$" will
complete input text "int" according to the internal symbols in the
maxima package of the form "maxima::$int...", and return
suggestions to the user of the form "int...".
We could easily turn this into some sort of user callable function,
but even at present, for what it may be worth, you can complete maxima
functions only on top of GCL, AFAICS.
i.e.
:lisp (setq si::*readline-prefix* "maxima::$")
Take care,
> All the best,
> Robert Dodier
>
> _______________________________________________
> Maxima mailing list
> Maxima@math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
>
--
Camm Maguire camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah