[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] ANN: scheme-complete.el - smart tab completion

From: Alex Shinn
Subject: [Chicken-users] ANN: scheme-complete.el - smart tab completion
Date: Tue, 16 Oct 2007 17:39:02 +0900

scheme-complete.el is a single function that can be used with any
Emacs scheme mode.  It provides real-time, lexical-scope aware
type inferencing tab-completion for any R5RS scheme, with
extensibility for implementation-specific features (currently only
Chicken and Gauche are customized).

For example, given the text

  (string-ref (n^

where the cursor is represented by ^, typing tab (or whatever you
bind the completion function to) would know that in the default
R5RS environment the only possible completion of a procedure
returning a string and beginning with "n" is number->string and
would complete that for you automatically.


  (let ((len (string-length str)))
    (string-ref str (- ^

completing would fill in "len" as the only possible completion
since a number is required as an argument to "-" and all the
standard R5RS bindings are procedures and syntax.

Relying on this completion for known type procedures is a handy
way to avoid type errors, even before the compilation.  In more
general cases it's just nice to basic have pruning, such as not
completing syntax in a non-operator position.

Currently completion inside strings does filename completion,
though this may be made for flexible in the future.  For Chicken
and Gauche, completing after "(use " will complete on all
currently installed modules.

Also includes optional eldoc-mode support, to flash a docstring
for the current function.

All parsing is done real-time (I've had no speed issues yet), and
is very careful to handle incomplete input gracefully.

Available at, with
setup instructions at the top of the file.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]