[slime-cvs] CVS update: slime/slime.el

Helmut Eller heller at common-lisp.net
Tue Feb 17 21:47:04 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv31552

Modified Files:
	slime.el 
Log Message:
(slime-length>): New function.
(slime-compiler-notes-to-tree): Don't collapse if there is only one
kind of notes.
Date: Tue Feb 17 16:47:03 2004
Author: heller

Index: slime/slime.el
diff -u slime/slime.el:1.209 slime/slime.el:1.210
--- slime/slime.el:1.209	Mon Feb 16 16:38:26 2004
+++ slime/slime.el	Tue Feb 17 16:47:03 2004
@@ -2337,13 +2337,20 @@
       (replace-match " "))
     (buffer-string)))
 
+(defun slime-length> (list n)
+  "Test if (length LIST) is greater than N."
+  (while (and (> n 0) list)
+    (setq list (cdr list))
+    (decf n))
+  list)
+
 (defun slime-compilation-finished (result buffer show-notes-buffer)
   (let ((notes (slime-compiler-notes)))
     (with-current-buffer buffer
       (multiple-value-bind (result secs) result
         (slime-show-note-counts notes secs)
         (slime-highlight-notes notes)))
-    (when (and show-notes-buffer (< 1 (length notes)))
+    (when (and show-notes-buffer (slime-length> notes 1))
       (slime-list-compiler-notes notes))
     ;;(let ((xrefs (slime-xrefs-for-notes notes)))
     ;;  (when (> (length xrefs) 1) ; >1 file
@@ -2431,16 +2438,19 @@
   (make-slime-tree :item (slime-note.short-message note)
                    :plist (list 'note note)))
 
-(defun slime-tree-for-severity (severity notes)
+(defun slime-tree-for-severity (severity notes collapsed-p)
   (make-slime-tree :item (format "%s (%d)" 
                                  (slime-severity-label severity)
                                  (length notes))
-                   :kids (mapcar #'slime-tree-for-note notes)))
+                   :kids (mapcar #'slime-tree-for-note notes)
+                   :collapsed-p collapsed-p))
 
 (defun slime-compiler-notes-to-tree (notes)
-  (let ((kids (let ((alist (slime-alistify notes #'slime-note.severity #'eq)))
+  (let ((kids (let* ((alist (slime-alistify notes #'slime-note.severity #'eq))
+                     (collapsed-p (slime-length> alist 1)))
                 (loop for (severity . notes) in alist
-                      collect (slime-tree-for-severity severity notes)))))
+                      collect (slime-tree-for-severity severity notes 
+                                                       collapsed-p)))))
     (make-slime-tree :item (format "All (%d)"  (length notes))
                      :kids kids :collapsed-p nil)))
 





More information about the slime-cvs mailing list