[slime-cvs] CVS slime

mbaringer mbaringer at common-lisp.net
Mon Feb 4 17:35:08 UTC 2008


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv3104

Modified Files:
	swank.lisp swank-scl.lisp swank-sbcl.lisp swank-openmcl.lisp 
	swank-lispworks.lisp swank-ecl.lisp swank-corman.lisp 
	swank-cmucl.lisp swank-clisp.lisp swank-backend.lisp 
	swank-allegro.lisp swank-abcl.lisp ChangeLog 
Log Message:
Drop second argument from inspect-for-emacs


--- /project/slime/cvsroot/slime/swank.lisp	2008/02/04 16:35:39	1.525
+++ /project/slime/cvsroot/slime/swank.lisp	2008/02/04 17:35:03	1.526
@@ -2692,8 +2692,7 @@
     (set-pprint-dispatch '(cons (member function)) nil)
     (princ-to-string list)))
 
-(defmethod inspect-for-emacs ((object cons) inspector)
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((object cons))
   (if (consp (cdr object))
       (inspect-for-emacs-list object)
       (inspect-for-emacs-simple-cons object)))
@@ -2753,8 +2752,7 @@
  a hash table or array to show by default. If table has more than
  this then offer actions to view more. Set to nil for no limit." )
 
-(defmethod inspect-for-emacs ((ht hash-table) inspector)
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((ht hash-table))
   (values (prin1-to-string ht)
           (append
            (label-value-line*
@@ -2806,8 +2804,7 @@
 		      (progn (format t "How many elements should be shown? ") (read))))
 		 (swank::inspect-object thing)))))
 
-(defmethod inspect-for-emacs ((array array) inspector)
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((array array))
   (values "An array."
           (append
            (label-value-line*
@@ -2825,8 +2822,7 @@
            (loop for i below (or *slime-inspect-contents-limit* (array-total-size array))
                  append (label-value-line i (row-major-aref array i))))))
 
-(defmethod inspect-for-emacs ((char character) inspector)
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((char character))
   (values "A character."
           (append 
            (label-value-line*
@@ -2894,14 +2890,14 @@
   (list :action label (assign-index (list lambda refreshp)
                                     *inspectee-actions*)))
 
-(defun inspect-object (object &optional (inspector *default-inspector*))
+(defun inspect-object (object)
   (push (setq *inspectee* object) *inspector-stack*)
   (unless (find object *inspector-history*)
     (vector-push-extend object *inspector-history*))
   (let ((*print-pretty* nil)            ; print everything in the same line
         (*print-circle* t)
         (*print-readably* nil))
-    (multiple-value-bind (_ content) (inspect-for-emacs object inspector)
+    (multiple-value-bind (_ content) (inspect-for-emacs object)
       (declare (ignore _))
       (list :title (with-output-to-string (s)
                      (print-unreadable-object (object s :type t :identity t)))
--- /project/slime/cvsroot/slime/swank-scl.lisp	2007/12/22 13:24:49	1.14
+++ /project/slime/cvsroot/slime/swank-scl.lisp	2008/02/04 17:35:03	1.15
@@ -1740,7 +1740,7 @@
                                   :key #'symbol-value)))
           (format t ", type: ~A" type-symbol))))))
 
-(defmethod inspect-for-emacs ((o t) (inspector backend-inspector))
+(defmethod inspect-for-emacs ((o t))
   (cond ((di::indirect-value-cell-p o)
          (values (format nil "~A is a value cell." o)
                  `("Value: " (:value ,(c:value-cell-ref o)))))
@@ -1759,8 +1759,7 @@
                 (loop for value in parts  for i from 0 
                       append (label-value-line i value))))))
 
-(defmethod inspect-for-emacs ((o function) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o function))
   (let ((header (kernel:get-type o)))
     (cond ((= header vm:function-header-type)
            (values (format nil "~A is a function." o)
@@ -1789,8 +1788,7 @@
            (call-next-method)))))
 
 
-(defmethod inspect-for-emacs ((o kernel:code-component) (_ backend-inspector))
-  (declare (ignore _))
+(defmethod inspect-for-emacs ((o kernel:code-component))
   (values (format nil "~A is a code data-block." o)
           (append 
            (label-value-line* 
@@ -1817,8 +1815,7 @@
                          (ash (kernel:%code-code-size o) vm:word-shift)
                          :stream s))))))))
 
-(defmethod inspect-for-emacs ((o kernel:fdefn) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o kernel:fdefn))
   (values (format nil "~A is a fdenf object." o)
           (label-value-line*
            ("name" (kernel:fdefn-name o))
@@ -1827,8 +1824,7 @@
                         (sys:int-sap (kernel:get-lisp-obj-address o))
                         (* vm:fdefn-raw-addr-slot vm:word-bytes))))))
 
-(defmethod inspect-for-emacs ((o array) (inspector backend-inspector))
-  inspector
+(defmethod inspect-for-emacs ((o array))
   (cond ((kernel:array-header-p o)
          (values (format nil "~A is an array." o)
                  (label-value-line*
@@ -1847,8 +1843,7 @@
                   (:header (describe-primitive-type o))
                   (:length (length o)))))))
 
-(defmethod inspect-for-emacs ((o simple-vector) (inspector backend-inspector))
-  inspector
+(defmethod inspect-for-emacs ((o simple-vector))
   (values (format nil "~A is a vector." o)
           (append 
            (label-value-line*
--- /project/slime/cvsroot/slime/swank-sbcl.lisp	2008/01/17 05:53:44	1.187
+++ /project/slime/cvsroot/slime/swank-sbcl.lisp	2008/02/04 17:35:03	1.188
@@ -1006,7 +1006,7 @@
 (defimplementation make-default-inspector ()
   (make-instance 'sbcl-inspector))
 
-(defmethod inspect-for-emacs ((o t) (inspector backend-inspector))
+(defmethod inspect-for-emacs ((o t))
   (declare (ignore inspector))
   (cond ((sb-di::indirect-value-cell-p o)
          (values "A value cell." (label-value-line*
@@ -1019,8 +1019,7 @@
                (values text (loop for value in parts  for i from 0
                                   append (label-value-line i value))))))))
 
-(defmethod inspect-for-emacs ((o function) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o function))
   (let ((header (sb-kernel:widetag-of o)))
     (cond ((= header sb-vm:simple-fun-header-widetag)
 	   (values "A simple-fun."
@@ -1041,8 +1040,7 @@
                                   i (sb-kernel:%closure-index-ref o i))))))
 	  (t (call-next-method o)))))
 
-(defmethod inspect-for-emacs ((o sb-kernel:code-component) (_ backend-inspector))
-  (declare (ignore _))
+(defmethod inspect-for-emacs ((o sb-kernel:code-component))
   (values (format nil "~A is a code data-block." o)
           (append
            (label-value-line*
@@ -1070,22 +1068,18 @@
                          (ash (sb-kernel:%code-code-size o) sb-vm:word-shift)
                          :stream s))))))))
 
-(defmethod inspect-for-emacs ((o sb-ext:weak-pointer) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o sb-ext:weak-pointer))
   (values "A weak pointer."
           (label-value-line*
            (:value (sb-ext:weak-pointer-value o)))))
 
-(defmethod inspect-for-emacs ((o sb-kernel:fdefn) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o sb-kernel:fdefn))
   (values "A fdefn object."
           (label-value-line*
            (:name (sb-kernel:fdefn-name o))
            (:function (sb-kernel:fdefn-fun o)))))
 
-(defmethod inspect-for-emacs :around ((o generic-function)
-                                      (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs :around ((o generic-function))
   (multiple-value-bind (title contents) (call-next-method)
     (values title
             (append
--- /project/slime/cvsroot/slime/swank-openmcl.lisp	2007/10/22 08:19:58	1.120
+++ /project/slime/cvsroot/slime/swank-openmcl.lisp	2008/02/04 17:35:03	1.121
@@ -795,8 +795,7 @@
 	(string (gethash typecode *value2tag*))
 	(string (nth typecode '(tag-fixnum tag-list tag-misc tag-imm))))))
 
-(defmethod inspect-for-emacs ((o t) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o t))
   (let* ((i (inspector::make-inspector o))
 	 (count (inspector::compute-line-count i))
 	 (lines 
@@ -814,7 +813,7 @@
                 (pprint o s)))
             lines)))
 
-(defmethod inspect-for-emacs :around ((o t) (inspector backend-inspector))
+(defmethod inspect-for-emacs :around ((o t))
   (if (or (uvector-inspector-p o)
           (not (ccl:uvectorp o)))
       (call-next-method)
@@ -834,8 +833,7 @@
   (:method ((object t)) nil)
   (:method ((object uvector-inspector)) t))
 
-(defmethod inspect-for-emacs ((uv uvector-inspector) 
-                              (inspector backend-inspector))
+(defmethod inspect-for-emacs ((uv uvector-inspector) )
   (with-slots (object)
       uv
     (values (format nil "The UVECTOR for ~S." object)
@@ -855,7 +853,7 @@
 		(cellp (ccl::closed-over-value-p value)))
 	   (list label (if cellp (ccl::closed-over-value value) value))))))
 
-(defmethod inspect-for-emacs ((c ccl::compiled-lexical-closure) (inspector t))
+(defmethod inspect-for-emacs ((c ccl::compiled-lexical-closure))
   (declare (ignore inspector))
   (values
    (format nil "A closure: ~a" c)
--- /project/slime/cvsroot/slime/swank-lispworks.lisp	2007/11/24 08:18:59	1.93
+++ /project/slime/cvsroot/slime/swank-lispworks.lisp	2008/02/04 17:35:03	1.94
@@ -629,20 +629,15 @@
 (defimplementation make-default-inspector ()
   (make-instance 'lispworks-inspector))
 
-(defmethod inspect-for-emacs ((o t) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o t))
   (lispworks-inspect o))
 
-(defmethod inspect-for-emacs ((o function) 
-                              (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o function))
   (lispworks-inspect o))
 
 ;; FIXME: slot-boundp-using-class in LW works with names so we can't
 ;; use our method in swank.lisp.
-(defmethod inspect-for-emacs ((o standard-object) 
-                              (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o standard-object))
   (lispworks-inspect o))
 
 (defun lispworks-inspect (o)
--- /project/slime/cvsroot/slime/swank-ecl.lisp	2008/01/19 15:09:33	1.11
+++ /project/slime/cvsroot/slime/swank-ecl.lisp	2008/02/04 17:35:03	1.12
@@ -248,13 +248,7 @@
 
 ;;;; Inspector
 
-(defclass ecl-inspector (inspector)
-  ())
-
-(defimplementation make-default-inspector ()
-  (make-instance 'ecl-inspector))
-
-(defmethod inspect-for-emacs ((o t) (inspector backend-inspector))
+(defmethod inspect-for-emacs ((o t))
   ; ecl clos support leaves some to be desired
   (cond
     ((streamp o)
--- /project/slime/cvsroot/slime/swank-corman.lisp	2007/08/23 19:03:37	1.11
+++ /project/slime/cvsroot/slime/swank-corman.lisp	2008/02/04 17:35:03	1.12
@@ -399,9 +399,7 @@
               collect (funcall callback e)
               collect ", ")))
 
-(defmethod inspect-for-emacs ((class standard-class)
-                              (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((class standard-class))
   (values "A class."
           `("Name: " (:value ,(class-name class))
             (:newline)
@@ -438,9 +436,8 @@
                   '("#<N/A (class not finalized)>"))
             (:newline))))
 
-(defmethod inspect-for-emacs ((slot cons) (inspector backend-inspector))
+(defmethod inspect-for-emacs ((slot cons))
   ;; Inspects slot definitions
-  (declare (ignore inspector))
   (if (eq (car slot) :name)
       (values "A slot." 
               `("Name: " (:value ,(swank-mop:slot-definition-name slot))
@@ -457,9 +454,7 @@
                                              (:newline)))
       (call-next-method)))
   
-(defmethod inspect-for-emacs ((pathname pathnames::pathname-internal)
-                              inspector)
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((pathname pathnames::pathname-internal))
   (values (if (wild-pathname-p pathname)
               "A wild pathname."
               "A pathname.")
@@ -475,7 +470,7 @@
                               (not (probe-file pathname)))
                     (label-value-line "Truename" (truename pathname))))))
 
-(defmethod inspect-for-emacs ((o t) (inspector backend-inspector))
+(defmethod inspect-for-emacs ((o t))
   (cond ((cl::structurep o) (inspect-structure o))
 	(t (call-next-method))))
 
--- /project/slime/cvsroot/slime/swank-cmucl.lisp	2007/11/30 13:10:40	1.175
+++ /project/slime/cvsroot/slime/swank-cmucl.lisp	2008/02/04 17:35:03	1.176
@@ -1869,7 +1869,7 @@
                                   :key #'symbol-value)))
           (format t ", type: ~A" type-symbol))))))
 
-(defmethod inspect-for-emacs ((o t) (inspector backend-inspector))
+(defmethod inspect-for-emacs ((o t))
   (cond ((di::indirect-value-cell-p o)
          (values (format nil "~A is a value cell." o)
                  `("Value: " (:value ,(c:value-cell-ref o)))))
@@ -1887,8 +1887,7 @@
                 (loop for value in parts  for i from 0 
                       append (label-value-line i value))))))
 
-(defmethod inspect-for-emacs ((o function) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o function))
   (let ((header (kernel:get-type o)))
     (cond ((= header vm:function-header-type)
            (values (format nil "~A is a function." o)
@@ -1915,9 +1914,7 @@
           (t
            (call-next-method)))))
 
-(defmethod inspect-for-emacs ((o kernel:funcallable-instance)
-                              (i backend-inspector))
-  (declare (ignore i))
+(defmethod inspect-for-emacs ((o kernel:funcallable-instance))
   (values 
    (format nil "~A is a funcallable-instance." o)
    (append (label-value-line* 
@@ -1926,8 +1923,7 @@
             (:layout  (kernel:%funcallable-instance-layout o)))
            (nth-value 1 (cmucl-inspect o)))))
 
-(defmethod inspect-for-emacs ((o kernel:code-component) (_ backend-inspector))
-  (declare (ignore _))
+(defmethod inspect-for-emacs ((o kernel:code-component))
   (values (format nil "~A is a code data-block." o)
           (append 
            (label-value-line* 
@@ -1954,8 +1950,7 @@
                          (ash (kernel:%code-code-size o) vm:word-shift)
                          :stream s))))))))
 
-(defmethod inspect-for-emacs ((o kernel:fdefn) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o kernel:fdefn))
   (values (format nil "~A is a fdenf object." o)
           (label-value-line*
            ("name" (kernel:fdefn-name o))
@@ -1964,8 +1959,7 @@
                         (sys:int-sap (kernel:get-lisp-obj-address o))
                         (* vm:fdefn-raw-addr-slot vm:word-bytes))))))
 
-(defmethod inspect-for-emacs ((o array) (inspector backend-inspector))
-  inspector
+(defmethod inspect-for-emacs ((o array))
   (if (typep o 'simple-array)
       (call-next-method)
       (values (format nil "~A is an array." o)
@@ -1980,8 +1974,7 @@
                (:displaced-p (kernel:%array-displaced-p o))
                (:dimensions (array-dimensions o))))))
 
-(defmethod inspect-for-emacs ((o simple-vector) (inspector backend-inspector))
-  inspector
+(defmethod inspect-for-emacs ((o simple-vector))
   (values (format nil "~A is a simple-vector." o)
           (append 
            (label-value-line*
--- /project/slime/cvsroot/slime/swank-clisp.lisp	2007/08/23 19:03:37	1.64
+++ /project/slime/cvsroot/slime/swank-clisp.lisp	2008/02/04 17:35:04	1.65
@@ -627,12 +627,7 @@
 
 ;;;; Inspecting
 
-(defclass clisp-inspector (backend-inspector) ())
-
-(defimplementation make-default-inspector () (make-instance 'clisp-inspector))
-
-(defmethod inspect-for-emacs ((o t) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((o t))
   (let* ((*print-array* nil) (*print-pretty* t)
          (*print-circle* t) (*print-escape* t)
          (*print-lines* custom:*inspect-print-lines*)
--- /project/slime/cvsroot/slime/swank-backend.lisp	2007/09/10 15:39:05	1.126
+++ /project/slime/cvsroot/slime/swank-backend.lisp	2008/02/04 17:35:04	1.127
@@ -840,26 +840,10 @@
 
 ;;;; Inspector
 
-(defclass inspector ()
-  ()
-  (:documentation "Super class of inspector objects.
-
-Implementations should sub class in order to dispatch off of the
-inspect-for-emacs method."))
-
-(defclass backend-inspector (inspector) ())
-
-(definterface make-default-inspector ()
-  "Return an inspector object suitable for passing to inspect-for-emacs.")
-
-(defgeneric inspect-for-emacs (object inspector)
+(defgeneric inspect-for-emacs (object)
   (:documentation
    "Explain to Emacs how to inspect OBJECT.
 
-The argument INSPECTOR is an object representing how to get at
-the internals of OBJECT, it is usually an implementation specific
-class used simply for dispatching to the proper method.
-
 Returns two values: a string which will be used as the title of
 the inspector buffer and a list specifying how to render the
 object for inspection.
@@ -880,12 +864,11 @@
 
  NIL - do nothing."))
 
-(defmethod inspect-for-emacs ((object t) (inspector t))
+(defmethod inspect-for-emacs ((object t))
   "Generic method for inspecting any kind of object.
 
 Since we don't know how to deal with OBJECT we simply dump the
 output of CL:DESCRIBE."
-  (declare (ignore inspector))
   (values 
    "A value."
    `("Type: " (:value ,(type-of object)) (:newline)
--- /project/slime/cvsroot/slime/swank-allegro.lisp	2007/09/26 23:15:41	1.98
+++ /project/slime/cvsroot/slime/swank-allegro.lisp	2008/02/04 17:35:04	1.99
@@ -564,13 +564,7 @@
 
 ;;;; Inspecting
 
-(defclass acl-inspector (backend-inspector) ())
-
-(defimplementation make-default-inspector ()
-  (make-instance 'acl-inspector))
-
-(defmethod inspect-for-emacs ((f function) inspector)
-  inspector
+(defmethod inspect-for-emacs ((f function))
   (values "A function."
           (append
            (label-value-line "Name" (function-name f))
@@ -579,17 +573,13 @@
              (when doc
                `("Documentation:" (:newline) ,doc))))))
 
-(defmethod inspect-for-emacs ((o t) (inspector backend-inspector))
-  inspector
+(defmethod inspect-for-emacs ((o t))
   (values "A value." (allegro-inspect o)))
 
-(defmethod inspect-for-emacs ((o function) (inspector backend-inspector))
-  inspector
+(defmethod inspect-for-emacs ((o function))
   (values "A function." (allegro-inspect o)))
 
-(defmethod inspect-for-emacs ((o standard-object) 
-                              (inspector backend-inspector))
-  inspector
+(defmethod inspect-for-emacs ((o standard-object))
   (values (format nil "~A is a standard-object." o) (allegro-inspect o)))
 
 (defun allegro-inspect (o)
--- /project/slime/cvsroot/slime/swank-abcl.lisp	2007/10/22 08:36:32	1.44
+++ /project/slime/cvsroot/slime/swank-abcl.lisp	2008/02/04 17:35:04	1.45
@@ -421,14 +421,7 @@
 
 ;;;; Inspecting
 
-(defclass abcl-inspector (backend-inspector) ())
-
-(defimplementation make-default-inspector ()
-  (make-instance 'abcl-inspector))
-
-(defmethod inspect-for-emacs ((slot mop::slot-definition) 
-                              (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((slot mop::slot-definition))
   (values "A slot." 
           `("Name: " (:value ,(mop::%slot-definition-name slot))
             (:newline)
@@ -443,8 +436,7 @@
             "  Function: " (:value ,(mop::%slot-definition-initfunction slot))
             (:newline))))
 
-(defmethod inspect-for-emacs ((f function) (inspector backend-inspector))
-  (declare (ignore inspector))
+(defmethod inspect-for-emacs ((f function))
   (values "A function."
           `(,@(when (function-name f)
                     `("Name: " 
@@ -461,7 +453,7 @@
 
 #|
 
-(defmethod inspect-for-emacs ((o t) (inspector backend-inspector))
+(defmethod inspect-for-emacs ((o t))
   (let* ((class (class-of o))
          (slots (mop::class-slots class)))
     (values (format nil "~A~%   is a ~A" o class)
--- /project/slime/cvsroot/slime/ChangeLog	2008/02/04 16:36:28	1.1279
+++ /project/slime/cvsroot/slime/ChangeLog	2008/02/04 17:35:04	1.1280
@@ -1,3 +1,15 @@
+2008-02-04  Marco Baringer  <mb at bese.it>
+
+
+	* swank-abcl.lisp, swank-allegro.lisp, swank-backend.lisp,
+	swank-clisp.lisp, swank-cmucl.lisp, swank-corman.lisp,
+	swank-ecl.lisp, swank-lispworks.lisp, swank-openmcl.lisp,
+	swank-sbcl.lisp, swank-scl.lisp, swank.lisp,
+	contrib/swank-fancy-inspector.lisp: Remove second argument from
+	swank:inspect-for-emacs. This functionality, choosing an inspector
+	at runtime, was never actually used and is, now, needless
+	complexity.
+
 2008-02-04  Helmut Eller  <heller at common-lisp.net>
 
 	Simpler code to bind 0-9 in the debugger.




More information about the slime-cvs mailing list