[slime-cvs] CVS slime

trittweiler trittweiler at common-lisp.net
Sun Mar 23 23:35:06 UTC 2008


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv26682

Modified Files:
	slime.el 
Log Message:

	* swank-source-path-parser.lisp 

	The source parser READs in files, and if such a file contains some
	nasty #. hackery that results in an error being signalled, M-. would
	fail on anything that's defined in those files. Fix that by using
	a special #. reader function that invokes the original #. reader 
	with an IGNORE-ERRORS wrapped around.

	(make-sharpdot-reader): New function.
	(make-source-recording-readtable): Use it and install it on #.

	* slime.el (find-definition.2): New test case to guard against it.


--- /project/slime/cvsroot/slime/slime.el	2008/03/18 13:22:15	1.930
+++ /project/slime/cvsroot/slime/slime.el	2008/03/23 23:35:06	1.931
@@ -8440,6 +8440,36 @@
            (= orig-pos (point)))))
     (slime-check-top-level))
 
+(def-slime-test find-definition.2
+    (buffer-content buffer-package snippet)
+    "Check that we're able to find definitions even when
+confronted with nasty #.-fu."
+    '(("#.(prog1 nil (defvar *foobar* 42))
+
+       (defun .foo. (x)
+         (+ x #.*foobar*))
+
+       #.(prog1 nil (makunbound '*foobar*))
+       "
+       "SWANK"
+       "(defun .foo. "
+       ))
+  (let ((slime-buffer-package buffer-package))
+    (with-temp-buffer
+      (insert buffer-content)
+      (slime-eval 
+       `(swank:compile-string-for-emacs
+         ,buffer-content
+         ,(buffer-name)
+         ,0
+         ,nil))
+      (let ((bufname (buffer-name)))
+        (slime-edit-definition ".foo.")
+        (slime-check ("Definition of `.foo.' is in buffer `%s'." bufname)
+          (string= (buffer-name) bufname))
+        (slime-check "Definition now at point." (looking-at snippet)))
+      )))
+
 (def-slime-test complete-symbol
     (prefix expected-completions)
     "Find the completions of a symbol-name prefix."




More information about the slime-cvs mailing list