Next: , Previous: , Up: Contributed Packages   [Contents][Index]


8.5 Compound Completion

The package slime-c-p-c provides a different symbol completion algorithm, which performs completion “in parallel” over the hyphen-delimited sub-words of a symbol name. 5 Formally this means that “a-b-c” can complete to any symbol matching the regular expression “^a.*-b.*-c.*” (where “dot” matches anything but a hyphen). Examples give a more intuitive feeling:

The variable slime-c-p-c-unambiguous-prefix-p specifies where point should be placed after completion. E.g. the possible completions for f-o are finish-output and force-output. By the default point is moved after the f, because that is the unambiguous prefix. If slime-c-p-c-unambiguous-prefix-p is nil, point moves to the end of the inserted text, after the o in this case.

In addition, slime-c-p-c provides completion for character names (mostly useful for Unicode-aware implementations):

CL-USER> #\Sp<TAB>

Here SLIME will usually complete the character to #\Space, but in a Unicode-aware implementation, this might provide the following completions:

Space                              Space
Sparkle                            Spherical_Angle
Spherical_Angle_Opening_Left       Spherical_Angle_Opening_Up

The package slime-c-p-c also provides context-sensitive completion for keywords. Example:

CL-USER> (find 1 '(1 2 3) :s<TAB>

Here SLIME will complete :start, rather than suggesting all ever-interned keywords starting with :s.

C-c C-s
M-x slime-complete-form

Looks up and inserts into the current buffer the argument list for the function at point, if there is one. More generally, the command completes an incomplete form with a template for the missing arguments. There is special code for discovering extra keywords of generic functions and for handling make-instance, defmethod, and many other functions. Examples:

(subseq "abc" <C-c C-s>
  --inserts--> start [end])
(find 17 <C-c C-s>
  --inserts--> sequence :from-end from-end :test test
               :test-not test-not :start start :end end
               :key key)
(find 17 '(17 18 19) :test #'= <C-c C-s>
  --inserts--> :from-end from-end
               :test-not test-not :start start :end end
               :key key)
(defclass foo () ((bar :initarg :bar)))
(defmethod print-object <C-c C-s>
  --inserts-->   (object stream)
               body...)
(defmethod initialize-instance :after ((object foo) &key blub))
(make-instance 'foo <C-c C-s>
  --inserts--> :bar bar :blub blub initargs...)

Footnotes

(5)

This style of completion is modelled on completer.el by Chris McConnell. That package is bundled with ILISP.


Next: , Previous: , Up: Contributed Packages   [Contents][Index]