CLIM mail archive


Anybody else hitting completion errors on accept?

    Date: Mon, 30 Dec 1991 13:08 EST
    From: Curt Eggemeyer <>

    I'm on a SPARC using CLIM 1.0 in the Allegro lisp environment.  Has anybody
    else noticed this problem with read-token?

    In CLIM there is a completion bug on accept methods of presentation types.
    Below is a simple example of a problem that I am having with accept using
    various presentation types.

    (define-your-application-command (com-test :name t)
            ((number 'integer :default 100 :display-default t :provide-default t))

    You die when you hit the completion character (on my particular machine, #\tab)
    to get the default value into the input buffer to edit on.  However, if you hit
    #\return or #\newline then this accept will work and take the default.  But I
    need the ability to throw the default into the input buffer for editting because
    I have extensive time presentation types (they are in the form of
    1991-365/12:31:23.045) in which the user (being their typical lazy self) would
    prefer to take the default and perform inline edits to it with fewer keystrokes
    rather than typing the input from scratch.  In my accept time methods I use the
    read-token function and get exactly the same type of error as the example above

In the command processor, hitting the Space key or the Input Editor's
history yank command (control-meta-Y, or is it Escape control-Y under
Allegro?)  should yank the default into the input buffer.  I recently
also fixed a bug that caused a blowout when you typed a completion
character to non-completing types such as INTEGER.

    However, I notice that if you do it in the form of ...

    (define-your-application-command (com-test :name t) ()
            (accept 'integer :default 100 :display-default t :provide-default t))

    Then CLIM will beep at you when you hit the completion character and not allow
    you to throw the default into the input buffer.  If the user is not permitted to
    edit on the default, then it seems to me that this is a capability that CLIM
    should be required to support.

control-meta-Y (or is it Escape control-Y?) will work here.

    With that in mind, how can I get around this shortcoming of CLIM within my own
    accept methods with read-token?  I am trying to avoid going down to the level of
    using read-gesture and manually manipulating the input buffer via my own accept
    method.  Below is a simplified example of how I am using the read-token

The following works for me, in conjunction with Input Editor's history
yank command.

(define-presentation-type timex () :history t)

(define-presentation-method presentation-typep (object (type timex))
  (stringp object))

(define-presentation-method accept ((type timex) stream (view textual-view) &key default)
  (read-token stream))

(define-presentation-method present (object (type timex) stream (view textual-view) &key)
  (write-token object stream))

The key bindings for the input editor commands for the various Lisp
implementations are as follows, according to my sources.  On Genera,
they are the same as Genera's input editor command bindings.

Input editor command     Franz Allegro   Lucid Common Lisp   Mac Common Lisp
 No op                   control-g       control-g           control-g
 Forward char            control-f       control-f           control-f
 Forward word            Escape f        meta-f              meta-f
 Backward char           control-b       control-b           control-b
 Backward word           Escape b        meta-b              meta-b
 Beginning of buffer     Escape <        meta-<              meta-<
 End of buffer           Escape >        meta->              meta->
 Beginning of line       control-a       control-a           control-a
 End of line             control-e       control-e           control-e
 Next line               control-n       control-n           control-n
 Previous line           control-p       control-p           control-p
 Rubout char             Rubout          Rubout              Rubout
 Rubout word             Escape Rubout   meta-Rubout         meta-Rubout
 Delete char             control-d       control-d           control-d
 Delete word             Escape d        meta-d              meta-d
 Clear input             control-u       ctrl-meta-Rubout    ctrl-meta-Rubout
 Kill line               control-k       control-k           control-k
 Open new line           control-o       control-o           control-o
 Transpose chars         control-t       control-t           control-t
 Show arglist            ctl-x ctl-a     control-shift-A     control-shift-A
 Show value              ctl-x ctl-v     control-shift-V     control-shift-V
 Yank from kill ring     control-y       control-y           control-y
 Yank from history       Escape ctrl-y   ctrl-meta-y         ctrl-meta-y
 Yank next               Escape y        meta-y              meta-y
 Scroll forward          control-v       control-v           control-v
 Scroll backward         Escape V        meta-v              meta-v
 <numeric argument>      ctrl-<number>   ctrl-<number>       ctrl-<number>


Main Index | Thread Index