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

Dan Barlow dbarlow at common-lisp.net
Thu Dec 11 04:57:34 UTC 2003


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

Modified Files:
	ChangeLog slime.el 
Log Message:
Significantly more friendly display of compiler notes when there
are multiple buffers involved

Date: Wed Dec 10 23:57:33 2003
Author: dbarlow

Index: slime/ChangeLog
diff -u slime/ChangeLog:1.149 slime/ChangeLog:1.150
--- slime/ChangeLog:1.149	Wed Dec 10 21:20:49 2003
+++ slime/ChangeLog	Wed Dec 10 23:57:33 2003
@@ -16,9 +16,8 @@
 	* slime.el (slime-find-asd, slime-load-system): new command
 	to compile and load an ASDF system with all the usual compiler
 	notes and stuff
-	(slime-compilation-finished): minimally handle multiple file
-	compiles, by printing the names of all files with notes in the
-	echo area
+	(slime-compilation-finished): if more than one file has new 
+	errors/notes, create an xref buffer to show them all
 	(slime-remove-old-overlays): bug fix: now removes overlays even
 	at start of buffer
 	(slime-overlay-note): do nothing quietly if


Index: slime/slime.el
diff -u slime/slime.el:1.138 slime/slime.el:1.139
--- slime/slime.el:1.138	Wed Dec 10 21:19:24 2003
+++ slime/slime.el	Wed Dec 10 23:57:33 2003
@@ -2085,23 +2085,34 @@
          (slime-note-count-string "note" notes)
          (if secs (format "[%s secs]" secs) ""))))
 
+(defun slime-xrefs-for-notes (notes)
+  (flet ((note-file (n) (cadr (assq :file (cdr (getf n :location))))))
+    (let ((xrefs))
+      (dolist (note notes)
+        (let ((file (assoc (note-file note) xrefs))
+              (node
+               (cons  (format "%s: %s" 
+                              (getf note :severity)
+                              (replace-regexp-in-string 
+                               "[^[:graph:]]+" " "
+                               (subseq (getf note :message) 0 )))
+                      (getf note :location))))
+          (when (note-file note)
+            (if file
+                (push node (cdr file))
+                (setf xrefs (acons (note-file note) (list node) xrefs))))))
+      xrefs)))
+
 (defun slime-compilation-finished (result 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)))
-    (let* ((locations (mapcar (lambda (n) (getf n :location)) notes))
-           (files (remove-duplicates
-                   (mapcar (lambda (l) 
-                             (let ((f (assq :file (cdr l))))
-                               (and f (cadr f))))
-                           locations)
-                   :test 'equal)))
-      ;; we need a better way of showing the resulting notes if there
-      ;; was >1 of them
-      ;; (slime-show-definitions "Compiler notes" locations)
-      (message "files with notes: %s" files) )))
+    (let ((xrefs (slime-xrefs-for-notes notes)))
+      (when (> (length xrefs) 1) ; >1 file
+        (slime-show-xrefs
+         xrefs 'definition "Compiler notes" (slime-buffer-package))))))
 
 (defun slime-compilation-finished-continuation ()
   (lexical-let ((buffer (current-buffer)))





More information about the slime-cvs mailing list