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

Luke Gorrie lgorrie at common-lisp.net
Fri Dec 12 01:51:30 UTC 2003


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

Modified Files:
	slime.el ChangeLog 
Log Message:
(slime-one-line-ify): New function to convert multi-line strings to
one-liners by replacing any newline followed by indentation by a
single space.

(slime-xrefs-for-notes): Use it.

Date: Thu Dec 11 20:51:29 2003
Author: lgorrie

Index: slime/slime.el
diff -u slime/slime.el:1.142 slime/slime.el:1.143
--- slime/slime.el:1.142	Thu Dec 11 14:31:45 2003
+++ slime/slime.el	Thu Dec 11 20:51:29 2003
@@ -2094,19 +2094,23 @@
              (node
               (cons (format "%s: %s" 
                             (getf note :severity)
-                            (getf note :message))
+                            (slime-one-line-ify (getf note :message)))
                     location)))
-        ;; emacs20 doesn't have `replace-regexp-in-string'
-        ;; but who gives us non-printable characters anyway and why? -luke
-;                             (replace-regexp-in-string 
-;                              "[^[:graph:]]+" " "
-;                              (subseq (getf note :message) 0 )))
-;                     location)))
         (when fn
           (if file
               (push node (cdr file))
               (setf xrefs (acons fn (list node) xrefs))))))
     xrefs))
+
+(defun slime-one-line-ify (string)
+  "Return a single-line version of STRING.
+Each newlines and following indentation is replaced by a single space."
+  (with-temp-buffer
+    (insert string)
+    (goto-char (point-min))
+    (while (re-search-forward "\n[\n \t]*" nil t)
+      (replace-match " "))
+    (buffer-string)))
 
 (defun slime-compilation-finished (result buffer)
   (let ((notes (slime-compiler-notes)))


Index: slime/ChangeLog
diff -u slime/ChangeLog:1.152 slime/ChangeLog:1.153
--- slime/ChangeLog:1.152	Thu Dec 11 14:31:45 2003
+++ slime/ChangeLog	Thu Dec 11 20:51:29 2003
@@ -1,8 +1,9 @@
 2003-12-11  Luke Gorrie  <luke at bluetail.com>
 
-	* slime.el (slime-xrefs-for-notes): Commented out use of
-	`replace-regexp-in-string' (not available in emacs20, and not sure
-	why we need it?)
+	* slime.el (slime-one-line-ify): New function to convert
+	multi-line strings to one-liners by replacing any newline
+	followed by indentation by a single space.
+	(slime-xrefs-for-notes): Use it.
 
 2003-12-11  Daniel Barlow  <dan at telent.net>
 





More information about the slime-cvs mailing list