[slime-devel] Re: slime-toggle-trace-fdefinition (C-c C-t)

Antonio Menezes Leitao aml at gia.ist.utl.pt
Fri Mar 11 00:49:01 UTC 2005


I found what seems to be two small bugs in the new trace code.  I
include the patch.

Index: slime.el
===================================================================
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.467
diff -u -r1.467 slime.el
--- slime.el	10 Mar 2005 18:43:58 -0000	1.467
+++ slime.el	11 Mar 2005 00:36:16 -0000
@@ -5412,12 +5412,12 @@
             (slime-read-from-minibuffer "(Un)trace: " (prin1-to-string n)))
            ((:defgeneric n)
             (let* ((name (prin1-to-string n))
-                   (answer (slime-read-from-minibuffer "(Un)trace: " n)))
+                   (answer (slime-read-from-minibuffer "(Un)trace: " name)))
               (cond ((and (string= name answer)
                           (y-or-n-p (concat "(Un)trace also all " 
                                             "methods implementing " 
                                             name "? ")))
-                     (prin1-to-string `(:defgeneric ,name)))
+                     (prin1-to-string `(:defgeneric ,n)))
                     (t
                      answer))))
            ((:defmethod &rest _)
@@ -5480,7 +5480,7 @@
                 (slime-in-expression-p `(,name)))
            ;; looks like a regular call
            (let ((toplevel (ignore-errors (slime-parse-toplevel-form))))
-             (cond ((slime-in-expression-p `(setf *))  ;a setf-call
+             (cond ((slime-in-expression-p `(setf (*)))  ;a setf-call
                     (if toplevel
                         `(:call ,toplevel (setf ,name))
                       `(setf ,name)))


I think that there are also bugs in the allegro trace code.  The
following patch isn't very well tested but I've been using the patched
version in the last few days without problems.

Index: swank-allegro.lisp
===================================================================
RCS file: /project/slime/cvsroot/slime/swank-allegro.lisp,v
retrieving revision 1.71
diff -u -r1.71 swank-allegro.lisp
--- swank-allegro.lisp	4 Mar 2005 23:44:17 -0000	1.71
+++ swank-allegro.lisp	11 Mar 2005 00:42:37 -0000
@@ -690,11 +690,13 @@
 ;; <name> can be a normal name or a (setf name)
 
 (defimplementation toggle-trace (spec)
-  (ecase (car spec) 
+  (ecase (car spec)
+    ((setf) 
+     (toggle-trace-aux spec))
     (:defgeneric (toggle-trace-generic-function-methods (second spec)))
     ((setf :defmethod :labels :flet) 
      (toggle-trace-aux (process-fspec-for-allegro spec)))
-    (:call 
+    (:call
      (destructuring-bind (caller callee) (cdr spec)
        (toggle-trace-aux callee 
                          :inside (list (process-fspec-for-allegro caller)))))))
@@ -718,7 +720,7 @@
            (dolist (method methods (format nil "~S is now untraced." name))
              (excl:funtrace (mop:method-function method))))
           (t
-           (eval `(trace ,name))
+           (eval `(trace (,name)))
            (dolist (method methods (format nil "~S is now traced." name))
              (excl:ftrace (mop:method-function method)))))))
 


Best regards,

António Leitão.




More information about the slime-devel mailing list