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

Helmut Eller heller at common-lisp.net
Sat Apr 17 09:34:11 UTC 2004


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

Modified Files:
	slime.el 
Log Message:
(slime-merge-notes): Use mapconcat instead of of (concat
(slime-intersperse (mapcar ....)))

(slime-intersperse): Handle empty lists.



Date: Sat Apr 17 05:34:10 2004
Author: heller

Index: slime/slime.el
diff -u slime/slime.el:1.263 slime/slime.el:1.264
--- slime/slime.el:1.263	Thu Apr 15 07:07:42 2004
+++ slime/slime.el	Sat Apr 17 05:34:10 2004
@@ -1840,7 +1840,7 @@
   (when (and (not (get-buffer-window (current-buffer) t))
              (< start end))
     (display-buffer (current-buffer))))
-
+      
 (defun slime-flush-output ()
   (while (accept-process-output nil 0 20)))
 
@@ -2640,9 +2640,9 @@
 
 (defun slime-merge-notes (notes)
   "Merge NOTES together. Keep the highest severity, concatenate the messages."
-  (let* ((new-severity (reduce #'slime-most-severe notes :key #'slime-note.severity))
-         (messages (mapcar #'slime-note.message notes))
-         (new-message (apply #'concat (slime-intersperse "\n" messages))))
+  (let* ((new-severity (reduce #'slime-most-severe notes
+                               :key #'slime-note.severity))
+         (new-message (mapconcat #'slime-note.message notes "\n")))
     (let ((new-note (copy-list (car notes))))
       (setf (getf new-note :message) new-message)
       (setf (getf new-note :severity) new-severity)
@@ -2650,8 +2650,10 @@
 
 (defun slime-intersperse (element list)
   "Intersperse ELEMENT between each element of LIST."
-  (cons (car list)
-        (mapcan (lambda (x) (list element x)) list)))
+  (if (null list) 
+      '()
+    (cons (car list)
+          (mapcan (lambda (x) (list element x)) (cdr list)))))
 
 (defun slime-notes-in-same-location-p (a b)
   (equal (slime-note.location a) (slime-note.location b)))





More information about the slime-cvs mailing list