Re: Readline completion example?

Jean Louis <[email protected]>
Newsgroups gmane.lisp.clisp.general
Message-ID <[email protected]>
On Sat, Feb 18, 2017 at 11:35:27PM +0100, Pascal Bourguignon wrote:
> It looks like rl_completion_entry_function is not mentionned in
> clisp/modules/readline/readline.lisp and that no variable
> readline:completion-entry-function is present in the readline
> package.
> 
> Indeed, I don’t see how to specify the completions with the API
> defined in readline.lisp Perhaps it correspond to an older readline
> library version that didn’t have it? Perhaps the mechanism is
> preempted by clisp, since we can see that in the terminal, clisp has
> completion on the the symbol names (operators, variables), and shows
> the documentation of the operator when they are complete.
> 
> See init_streamvars in stream.d:
>   rl_attempted_completion_function = &lisp_completion_matches;
>   rl_completion_entry_function = &lisp_completion_more;
> 
> they call lisp_completion, which calls (SYS::COMPLETION text start end) in complete.lisp
> 
> So this would be the definitive example, and you could override this
> function, (unlocking the SYSTEM package to do so).  I guess your
> overriding function could determine whether you’re completing lisp
> input or user input and call the original sys::complete to complete
> lisp input.
> 
> It would be nice to provide a patch to this sys::completion with a
> hook so that applications may provide their own completions. (I
> would make it a per-stream hook).
> 
> -- 
> __Pascal J. Bourguignon__

I did review complete.lisp -- for me is too complex to start with
it. I am rather for user based example, not CLISP based which is for
developers. 

Jean

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.