Hello,
The attached patch makes slime-echo-arglist detect (make-instance 'quoted-symbol ...) forms and uses the quoted symbol to find the class and present the initargs and initforms in the mini-buffer. For example:
CL-USER> (defclass foo () ((a :initarg :initarg-a :initform nil) (b :initarg :initarg-b) c)) #<STANDARD-CLASS FOO> CL-USER> (make-instance<space> ;; minibuffer displays: (make-instance class &rest initargs)
CL-USER> (make-instance 'foo<space> ;; minibuffer displays: (make-instance 'foo &key (initarg-a nil) initarg-b)
The code is a bit ugly, specially on the elisp side. My elisp-fu being very weak doesn't help. Suggestions on how to improve that are most welcome!
BTW, the ChangeLog's encoding seems to be latin-1, wouldn't utf-8 be better?
Luís Oliveira luismbo@gmail.com writes:
The attached patch makes slime-echo-arglist detect (make-instance 'quoted-symbol ...) forms and uses the quoted symbol to find the class and present the initargs and initforms in the mini-buffer.
The implementation of C-c C-s (slime-complete-form) already contains a more general version of this. It handles MAKE-INSTANCE and DEFMETHOD. I am looking into making use of this code to handle the echo area arglist display as well.
Matthias Koeppe mkoeppe+slime@mail.math.uni-magdeburg.de writes:
The implementation of C-c C-s (slime-complete-form) already contains a more general version of this. It handles MAKE-INSTANCE and DEFMETHOD. I am looking into making use of this code to handle the echo area arglist display as well.
Btw, maybe it would be a good idea not to show
"(make-instance 'foo &key (foo bar) baz)"
But show
"(make-instance class &rest initargs) Initargs: (foo bar) baz"
Or something like this. Any suggestions?
Luís Oliveira luismbo@gmail.com writes:
Matthias Koeppe mkoeppe+slime@mail.math.uni-magdeburg.de writes:
The implementation of C-c C-s (slime-complete-form) already contains a more general version of this. It handles MAKE-INSTANCE and DEFMETHOD. I am looking into making use of this code to handle the echo area arglist display as well.
Btw, maybe it would be a good idea not to show
"(make-instance 'foo &key (foo bar) baz)"
But show
"(make-instance class &rest initargs) Initargs: (foo bar) baz"
Or something like this. Any suggestions?
Hm, not sure. I have turned on font locking of the echo area arglist, so the keywords should be visible enough. Or are you concerned with the fact that we are mixing formal and actual arguments? I don't think it creates confusion.
Also, as I promised, I have now implemented the improved echo are arglist display of DEFMETHOD.
Matthias