[slime-cvs] CVS slime

CVS User trittweiler trittweiler at common-lisp.net
Thu Feb 26 23:41:41 UTC 2009


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv19229

Modified Files:
	swank-sbcl.lisp ChangeLog 
Log Message:
	C-c C-c on (defun foo () ,bar) did not result in a compiler note
	overlay on SBCL.

	* swank-sbcl.lisp (compiler-note-location): Make it take a
	condition; if the condition is a READER-ERROR, the passed
	compiler-error-context is very likely NIL---we have not proceeded
	beyond reading, so we aren't within the compiler yet. In that
	case, we use the stream position of the stream behind the
	READER-ERROR instead.


--- /project/slime/cvsroot/slime/swank-sbcl.lisp	2009/02/07 13:19:50	1.234
+++ /project/slime/cvsroot/slime/swank-sbcl.lisp	2009/02/26 23:41:41	1.235
@@ -386,7 +386,7 @@
            :short-message (brief-compiler-message-for-emacs condition)
            :references (condition-references (real-condition condition))
            :message (long-compiler-message-for-emacs condition context)
-           :location (compiler-note-location context))))
+           :location (compiler-note-location condition context))))
 
 (defun real-condition (condition)
   "Return the encapsulated condition or CONDITION itself."
@@ -399,13 +399,21 @@
       (externalize-reference
        (sb-int:reference-condition-references condition))))
 
-(defun compiler-note-location (context)
-  (if context
-      (locate-compiler-note
-       (sb-c::compiler-error-context-file-name context)
-       (compiler-source-path context)
-       (sb-c::compiler-error-context-original-source context))
-      (list :error "No error location available")))
+(defun compiler-note-location (condition context)
+  (flet ((bailout ()
+           (list :error "No error location available")))
+    (cond (context
+           (locate-compiler-note
+            (sb-c::compiler-error-context-file-name context)
+            (compiler-source-path context)
+            (sb-c::compiler-error-context-original-source context)))
+          ((typep condition 'reader-error)
+           (let ((stream (stream-error-stream condition)))
+             (unless (open-stream-p stream) (bailout))
+             (make-location (list :buffer *buffer-name*)
+                            (list :offset *buffer-offset*
+                                  (file-position stream)))))
+          (t (bailout)))))
 
 (defun locate-compiler-note (file source-path source)
   (cond ((and (not (eq file :lisp)) *buffer-name*)
--- /project/slime/cvsroot/slime/ChangeLog	2009/02/26 21:50:00	1.1695
+++ /project/slime/cvsroot/slime/ChangeLog	2009/02/26 23:41:41	1.1696
@@ -1,3 +1,15 @@
+2009-02-27  Tobias C. Rittweiler  <tcr at freebits.de>
+
+	C-c C-c on (defun foo () ,bar) did not result in a compiler note
+	overlay on SBCL.
+
+	* swank-sbcl.lisp (compiler-note-location): Make it take a
+	condition; if the condition is a READER-ERROR, the passed
+	compiler-error-context is very likely NIL---we have not proceeded
+	beyond reading, so we aren't within the compiler yet. In that
+	case, we use the stream position of the stream behind the
+	READER-ERROR instead.
+
 2009-02-26  Tobias C. Rittweiler  <tcr at freebits.de>
 
 	* doc/slime.texi: Fix typos, and add keybindings not listed there.





More information about the slime-cvs mailing list