[slime-devel] More features by default

Martin Simmons martin at lispworks.com
Thu Jan 15 17:32:22 UTC 2009


>>>>> On Fri, 09 Jan 2009 09:40:31 +0530, Madhu  said:
> 
> ;;;
> ;;; patch fancy-inspector
> ;;;
> 
> (in-package :swank)
> (defgeneric inspect-slot-for-emacs (class object slot)
>   (:method (class object slot)
>            (let ((slot-name (swank-mop:slot-definition-name slot))
>                  (boundp (swank-mop:slot-boundp-using-class class object slot)))
>              `(,@(if boundp
>                      `((:value ,(swank-mop:slot-value-using-class class object slot)))
>                      `("#<unbound>"))
>                " "
>                (:action "[set value]"
>                 ,(lambda () (with-simple-restart
>                                 (abort "Abort setting slot ~S" slot-name)
>                               (let ((value-string (eval-in-emacs
>                                                    `(condition-case c
>                                                      (slime-read-object
>                                                       ,(format nil "Set slot ~S to (evaluated) : " slot-name))
>                                                      (quit nil)))))
>                                 (when (and value-string
>                                            (not (string= value-string "")))
>                                   (setf (swank-mop:slot-value-using-class class object slot)
>                                         (eval (read-from-string value-string))))))))
>                ,@(when boundp
>                    `(" " (:action "[make unbound]"
>                           ,(lambda () (swank-mop:slot-makunbound-using-class class object slot)))))))))

I didn't use this part of the patch because it looks like it is only needed to
fix package issues.

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/




More information about the slime-devel mailing list