[slime-cvs] CVS slime/contrib

CVS User trittweiler trittweiler at common-lisp.net
Sat Sep 18 20:47:30 UTC 2010


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

Modified Files:
	ChangeLog slime-autodoc.el slime-parse.el 
Log Message:
	* slime-parse.el (slime-parse-form-upto-point): Fix lp#627308.

	* slime-autodoc.el (slime-canonicalize-whitespace): New
	helper. Extracted out of `slime-format-autodoc'.
	(slime-autodoc-to-string): New helper.
	(slime-check-autodoc-at-point): Use it.
	(autodoc.1): Add test case for above fix.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2010/09/18 09:34:06	1.420
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2010/09/18 20:47:29	1.421
@@ -1,5 +1,15 @@
 2010-09-18  Tobias C. Rittweiler <tcr at freebits.de>
 
+	* slime-parse.el (slime-parse-form-upto-point): Fix lp#627308.
+
+	* slime-autodoc.el (slime-canonicalize-whitespace): New
+	helper. Extracted out of `slime-format-autodoc'.
+	(slime-autodoc-to-string): New helper.
+	(slime-check-autodoc-at-point): Use it.
+	(autodoc.1): Add test case for above fix.
+
+2010-09-18  Tobias C. Rittweiler <tcr at freebits.de>
+
 	* swank-arglist.lisp (function-exists-p): Renamed from
 	FUNCTION-EXISTS-P. Uses new SWANK-BACKEND:VALID-FUNCTION-NAME-P
 	underneath.
--- /project/slime/cvsroot/slime/contrib/slime-autodoc.el	2010/05/13 15:31:07	1.46
+++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el	2010/09/18 20:47:29	1.47
@@ -111,11 +111,14 @@
 
 ;;;; Formatting autodoc
 
+(defsubst slime-canonicalize-whitespace (string)
+  (replace-regexp-in-string "[ \n\t]+" " "  string))
+
 (defun slime-format-autodoc (doc multilinep)
   (let ((doc (slime-fontify-string doc)))
     (if multilinep
         doc
-        (slime-oneliner (replace-regexp-in-string "[ \n\t]+" " "  doc)))))
+        (slime-oneliner (slime-canonicalize-whitespace doc)))))
 
 (defun slime-fontify-string (string)
   "Fontify STRING as `font-lock-mode' does in Lisp mode."
@@ -238,13 +241,19 @@
 
 ;;;; Test cases
 
+(defun slime-autodoc-to-string ()
+  "Retrieve and return autodoc for form at point."
+  (let ((autodoc (slime-eval (second (slime-make-autodoc-rpc-form)))))
+    (if (eq autodoc :not-available)
+        :not-available
+        (slime-canonicalize-whitespace autodoc))))
+
 (defun slime-check-autodoc-at-point (arglist)
-  (let ((slime-autodoc-use-multiline-p nil))
-    (slime-test-expect (format "Autodoc in `%s' (at %d) is as expected" 
-                               (buffer-string) (point)) 
-                       arglist
-                       (slime-eval (second (slime-make-autodoc-rpc-form)))
-                       'equal)))
+  (slime-test-expect (format "Autodoc in `%s' (at %d) is as expected" 
+                             (buffer-string) (point)) 
+                     arglist
+                     (slime-autodoc-to-string)
+                     'equal))
 
 (def-slime-test autodoc.1
     (buffer-sexpr wished-arglist &optional skip-trailing-test-p)
@@ -310,6 +319,8 @@
       ;; Test &KEY and nested arglists
       ("(swank::with-retry-restart (:msg *HERE*"
        "(with-retry-restart (&key ===> (msg \"Retry.\") <===) &body body)")
+      ("(swank::with-retry-restart (:msg *HERE*(foo"
+       "(with-retry-restart (&key ===> (msg \"Retry.\") <===) &body body)" t)
       ("(swank::start-server \"/tmp/foo\" :coding-system *HERE*"
        "(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)")
       
--- /project/slime/cvsroot/slime/contrib/slime-parse.el	2010/06/18 12:31:55	1.38
+++ /project/slime/cvsroot/slime/contrib/slime-parse.el	2010/09/18 20:47:29	1.39
@@ -83,12 +83,15 @@
         (cond ((slime-compare-char-syntax #'char-after "(" t)
                ;; We're at the start of some expression, so make sure
                ;; that SWANK::%CURSOR-MARKER% will come after that
-               ;; expression.
-               (ignore-errors (forward-sexp)))
+               ;; expression. If the expression is not balanced, make
+               ;; still sure that the marker does *not* come directly
+               ;; after the preceding expression.
+               (or (ignore-errors (forward-sexp) t)
+                   (push "" suffix)))
               ((or (bolp) (slime-compare-char-syntax #'char-before " " t))
                ;; We're after some expression, so we have to make sure
-               ;; that %CURSOR-MARKER% does not come directly after that
-               ;; expression.
+               ;; that %CURSOR-MARKER% does *not* come directly after
+               ;; that expression.
                (push "" suffix))
               ((slime-compare-char-syntax #'char-before "(" t)
                ;; We're directly after an opening parenthesis, so we





More information about the slime-cvs mailing list