CLIM mail archive

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

Re: Completion Query



>From: Scott McKay <swm@harlequin.com>
>Date: Mon, 14 Feb 94 17:17:31 EST
>Subject: Completion Query
>   Date:     Mon, 14 Feb 94 16:47:02 EST
>   From: Nichael Cramer <ncramer@BBN.COM>
>   [CLIM-2/ALLEGRO/SPARC]
>
>   In short I would like "activation" behavior something like the following:
>   #\Space ==> "Complete as far as possible" (i.e. do the "normal" completion
>		thing).
>   #\Return ==> "Accept whatever I've got, as is."
>
>   (Basically I want it to work more or less like the pathname completion does
>   on Find-File in Gnumacs.)
>
>Which of the completion functions are you using?

Essentially, I'm doing the following:

(clim:define-presentation-method clim:accept ((TYPE my-prestype) STREAM
VIEW &key DEFAULT DEFAULT-TYPE)
  VIEW DEFAULT DEFAULT-TYPE
  (clim:complete-input
   STREAM
   #'(lambda (STRING ACTION)
       (clim:complete-from-possibilities
	STRING 
	*MY-POSSIBILITIES*
	nil
	:action ACTION
	))
     ;;; :allow-any-input t
   )
  )

>I think you want to use #\Return as your activation gesture, and
>#\Space as a "partial completer" (known as the "delimiter" in some opf
>the completion functions).

Scott

As always, thanks; but this doesn't seem to really address the problem I'm
trying to solve (perhaps I'm missing the point).

1] If I understand "partial completers" or "delimiters" they define the
delimiters for "sub-strings" on which completion is allowed.  For exmample
defining "-" as a "delimiter" would allow me to type "F-B-B" when I want to
complete on the name "FOO-BAR-BAZ".

I use this feature, but it doesn't seem to help with the problem described
above. 

2] Furthermore, using any of the activation gestures in the standard way
still leaves the "unwanted completion" problem.

For example, suppose "FOOBAR" is a completable name.  If I type "FOO" and
hit return, I'd like to get *only* "FOO" back.  However, the way it works
now, I automatically get the (completed) "FOOBAR".

Again, the behavior I'm trying to achieve is something like the following:
If I type "FOO" and hit (say) space, I'd expect it to complete to "FOOBAR"
(but not neccessarily return the value).  On the other hand if I type "FOO"
and hit return, I'd like it to return just "FOO".

Using the example code above, the _only_ thing I can get it to return is a
fully completed symbol-name.

N





Main Index | Thread Index