Lisp HUG Maillist Archive

arglist on space

MCL and ilisp have a feature that automatically shows the arglist at 
the bottom of the editor buffer when a space is typed after a 
function call. Is there something similar in LispWorks? I can't seem 
to find it.

Thanks,

John DeSoi, Ph.D.


Re: arglist on space

Unable to parse email body. Email id is 1020

Re: arglist on space

Unable to parse email body. Email id is 1022

Re: arglist on space

An alternative method below. I prefer this because it gives immediate 
feedback when you are typing - you know right away if you have 
mistyped a function name because the arglist does not show up. This 
version just looks at symbols after "(" -- it was distracting to see 
the arglist after typing "if" in a comment :). The original version 
would only show the arglist for functions in other packages if they 
had a package qualifier. That is resolved in this function using 
find-symbol.

I could not find a documented way to get the package for the point, 
but I did find editor::buffer-package-to-use in the editor source. Is 
there a better method?

One other question. All the Lisp editors I have used indent the if 
and else forms of an if expression at the same level. LispWorks 
out-dents the else form. Is there an easy way to change that?

Thanks,

John DeSoi, Ph.D.


=====


(editor:defcommand  "Insert Space and Show Arglist" (p)
      "Display the argument list in the echo area a while after 
inserting Space to the right of the function."
      "Display the argument list."
   (editor:self-insert-command p #\Space)
   (editor:with-point ((temp1 (editor:current-point))
                       (temp2 (editor:current-point)))
     (when (editor:form-offset temp1 -1)
       (editor:character-offset temp1 -1)
       (let ((str (editor:points-to-string temp1 temp2)))
         (when (eq #\( (schar str 0))
           (setf str (nstring-upcase (subseq str 1 (1- (length str)))))
           (let ((x (find-symbol str (editor::buffer-package-to-use temp1))))
             (if (and x (fboundp x))
                 (editor:function-arglist-command nil x)
               (editor:message ""))))))))

(editor:bind-key "Insert Space and Show Arglist" #\Space :mode "Lisp")
(editor:bind-key "Insert Space and Show Arglist" #\Space :mode "Execute")


Re: arglist on space

Unable to parse email body. Email id is 1042

Updated at: 2020-12-10 09:00 UTC