[slime-devel] More features by default
Madhu
enometh at meer.net
Fri Jan 9 04:10:31 UTC 2009
* Martin Simmons <200901081912.n08JC9sM006644 at higson.cam.lispworks.com> :
Wrote on Thu, 8 Jan 2009 19:12:09 GMT:
|>>>>> On Mon, 29 Dec 2008 15:09:56 +0100, knobo said:
|>
|> Luis Oliveira wrote:
|> > Zach Beane <xach at xach.com> writes:
|> >
|> >> I disagree. I think the default slime setup should have no contribs
|> >> loaded, not the arbitrary slime-fancy kitchen sink of contribs loaded.
|> >
|> > Perhaps we could agree on another set of contribs then?
|> >
|> Ok, then please don't load slime-fancy by default, as it does not work
|> with LispWorks, without applying some patches by Johannes Grødem and
|> Peder O. Klingenberg that can be found on this list dated back in 2007.
|> It would be very difficult for newcomers to find out that it is
|> slime-fancy that is the problem.
|>
|> I don't know why these patches are not approved for inclusion yet.
|
| I tried loading CVS HEAD slime-fancy into LispWorks 5.1.2 and I've not seen
| any errors yet. The REPL, completion and source location work as expected,
| but I've not tested everything. Can you post links to the patches please?
Here is what I load into slime after slime loads (I'm still using older
slime and have not updated to CVS HEAD) but the first issue is likely
unchanged.
#||
BASED ON SUGGESTIONS:
From: Johannes Groedem <johs at netfonds.no>
Newsgroups: gmane.lisp.slime.devel
Subject: Re: fancy inspector problems
Date: Mon, 17 Sep 2007 15:40:40 +0200
Archived-At: <http://permalink.gmane.org/gmane.lisp.slime.devel/6696>
||#
;;;
;;; patch swank-lispworks.lisp
;;;
(in-package "SWANK-BACKEND")
;; we have imported '(slot-boundp-using-class slot-value-using-class)
;; from :clos into swank-mop via import-swank-mop-symbols. i.e.
;; (import '(clos::slot-value-using-class) :swank-mop)
;; (import '(clos::slot-boundp-using-class) :swank-mop)
(assert
(eq 'clos::slot-value-using-class 'swank-mop::slot-value-using-class))
(assert
(eq 'clos::slot-boundp-using-class 'swank-mop::slot-boundp-using-class))
(when (eq 'clos::slot-value-using-class 'swank-mop::slot-value-using-class)
(unintern 'swank-mop::slot-value-using-class :swank-mop))
(export 'swank-mop::slot-value-using-class :swank-mop)
(when (eq 'clos::slot-boundp-using-class 'swank-mop::slot-boundp-using-class)
(unintern 'swank-mop::slot-boundp-using-class :swank-mop))
(export 'swank-mop::slot-boundp-using-class :swank-mop)
(defun swank-mop:slot-boundp-using-class (class object slotd)
(clos::slot-boundp-using-class class object
(clos:slot-definition-name slotd)))
(defun swank-mop:slot-value-using-class (class object slotd)
(clos::slot-value-using-class class object
(clos:slot-definition-name slotd)))
;;;
;;; 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)))))))))
More information about the slime-devel
mailing list