[slime-cvs] CVS slime/contrib

CVS User trittweiler trittweiler at common-lisp.net
Wed Jan 6 18:23:45 UTC 2010


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

Modified Files:
	swank-arglists.lisp slime-autodoc.el ChangeLog 
Log Message:
	* swank-arglists.lisp (interesting-variable-p): Exclude keywords
	from being candidates for "display variable content" autodoc
	feature.
	(print-decoded-arglist): Slightly better arglist printing if
	`slime-autodoc-use-multiline-p' is true.
	(parse-raw-form): Make it able to parse strings.

	* slime-autodoc.el (autodoc.1 [test]): Add more cases.


--- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp	2010/01/06 14:40:20	1.56
+++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp	2010/01/06 18:23:44	1.57
@@ -72,7 +72,8 @@
   (and symbol
        (symbolp symbol)
        (boundp symbol)
-       (not (memq symbol '(cl:t cl:nil)))))
+       (not (memq symbol '(cl:t cl:nil)))
+       (not (keywordp symbol))))
 
 (defmacro multiple-value-or (&rest forms)
   (if (null forms)
@@ -155,7 +156,6 @@
   (and (arglist-dummy-p dummy)
        (zerop (length (arglist-dummy.string-representation dummy)))))
 
-
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defparameter +lambda-list-keywords+
     '(&provided &required &optional &rest &key &any)))
@@ -251,7 +251,8 @@
     (let ((index 0))
       (pprint-logical-block (nil nil :prefix "(" :suffix ")")
         (when operator
-          (princ-arg operator))
+          (princ-arg operator)
+          (pprint-indent :current 1))   ; 1 due to possibly added space
         (do-decoded-arglist (remove-given-args arglist provided-args)
           (&provided (arg)
              (space)
@@ -279,7 +280,8 @@
              (incf index))
           (&key :initially
              (when (arglist.key-p arglist)
-               (space) (princ '&key)))
+               (space)
+               (princ '&key)))
           (&key (keyword arg init)
              (space)
              (if (arglist-p arg)
@@ -317,6 +319,7 @@
           ;; FIXME: add &UNKNOWN-JUNK?
           )))))
 
+
 (defun princ-arg (arg)
   (princ (if (arglist-dummy-p arg)
              (arglist-dummy.string-representation arg)
@@ -1473,20 +1476,29 @@
 datum for subsequent logics to rely on."
   (let* ((string  (string-left-trim '(#\Space #\Tab #\Newline) string))
          (length  (length string))
-	 (prefix  (cond ((zerop length) nil)
-                        ((eql (aref string 0) #\') :quote)
-                        ((search "#'" string :end2 (min length 2)) :sharpquote)
-                        (t nil))))
+	 (type    (cond ((zerop length) nil)
+                        ((eql (aref string 0) #\')
+                         :quoted-symbol)
+                        ((search "#'" string :end2 (min length 2))
+                         :sharpquoted-symbol)
+                        ((and (eql (aref string 0) #\")
+                              (eql (aref string (1- length)) #\"))
+                         :string)
+                        (t
+                         :symbol))))
     (multiple-value-bind (symbol found?)
-	(parse-symbol (case prefix
-                        (:quote      (subseq string 1))
-                        (:sharpquote (subseq string 2))
-                        (t string)))
+	(case type
+          (:symbol             (parse-symbol string))
+          (:quoted-symbol      (parse-symbol (subseq string 1)))
+          (:sharpquoted-symbol (parse-symbol (subseq string 2)))
+          (:string             (values string t))
+          (t                   (values string nil)))
       (if found?
-          (case prefix
-            (:quote      `(quote ,symbol))
-            (:sharpquote `(function ,symbol))
-            (t symbol))
+          (ecase type
+            (:symbol             symbol)
+            (:quoted-symbol      `(quote ,symbol))
+            (:sharpquoted-symbol `(function ,symbol))
+            (:string             string))
 	  (make-arglist-dummy string)))))
   
 (defun test-print-arglist ()
--- /project/slime/cvsroot/slime/contrib/slime-autodoc.el	2010/01/06 14:55:45	1.33
+++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el	2010/01/06 18:23:44	1.34
@@ -256,6 +256,9 @@
       ("(swank::create-socket *HERE*"     "(create-socket ===> host <=== port)")
       ("(swank::create-socket foo *HERE*" "(create-socket host ===> port <===)")
 
+      ;; Test that autodoc differentiates between exported and unexported symbols.
+      ("(swank:create-socket*HERE*" :not-available)
+
       ;; Test if cursor is on non-existing required parameter
       ("(swank::create-socket foo bar *HERE*" "(create-socket host port)")
 
@@ -267,6 +270,10 @@
       ;; Test variable content display
       ("(progn swank::default-server-port*HERE*" "DEFAULT-SERVER-PORT => 4005")
 
+      ;; Test that "variable content display" is not triggered for trivial constants.
+      ("(swank::create-socket t*HERE*"     "(create-socket ===> host <=== port)")
+      ("(swank::create-socket :foo*HERE*"  "(create-socket ===> host <=== port)")
+
       ;; Test with syntactic sugar
       ("#'(lambda () (swank::create-socket*HERE*" "(create-socket host port)")
       ("`(lambda () ,(swank::create-socket*HERE*" "(create-socket host port)")
@@ -277,9 +284,11 @@
       ("(swank::symbol-status foo *HERE*" 
        "(symbol-status symbol &optional ===> (package (symbol-package symbol)) <===)")
 
-      ;; Test context-sensitive autodoc
+      ;; Test context-sensitive autodoc (DEFMETHOD)
       ("(defmethod swank::arglist-dispatch (*HERE*"
        "(defmethod arglist-dispatch (===> operator <=== arguments) &body body)")
+
+      ;; Test context-sensitive autodoc (APPLY)
       ("(apply 'swank::eval-for-emacs*HERE*"
        "(apply 'eval-for-emacs &optional form buffer-package id &rest args)")
       ("(apply #'swank::eval-for-emacs*HERE*"
@@ -288,6 +297,12 @@
        "(apply 'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)")
       ("(apply #'swank::eval-for-emacs foo *HERE*"
        "(apply #'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)")
+
+      ;; Test context-sensitive autodoc (ERROR, CERROR)
+      ("(error 'simple-condition*HERE*"
+       "(error 'simple-condition &rest arguments &key format-arguments format-control)")
+      ("(cerror \"Foo\" 'simple-condition*HERE*"
+       "(cerror \"Foo\" 'simple-condition &rest arguments &key format-arguments format-control)")
       
       ;; Test &KEY and nested arglists
       ("(swank::with-retry-restart (:msg *HERE*"
--- /project/slime/cvsroot/slime/contrib/ChangeLog	2010/01/06 14:55:45	1.336
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2010/01/06 18:23:44	1.337
@@ -1,5 +1,16 @@
 2010-01-06  Tobias C. Rittweiler  <tcr at freebits.de>
 
+	* swank-arglists.lisp (interesting-variable-p): Exclude keywords
+	from being candidates for "display variable content" autodoc
+	feature.
+	(print-decoded-arglist): Slightly better arglist printing if
+	`slime-autodoc-use-multiline-p' is true.
+	(parse-raw-form): Make it able to parse strings.
+
+	* slime-autodoc.el (autodoc.1 [test]): Add more cases.
+
+2010-01-06  Tobias C. Rittweiler  <tcr at freebits.de>
+
 	* slime-autodoc.el (slime-check-autodoc-at-point): Bind
 	`slime-autodoc-use-multiline-p' to nil for normalized test
 	results.





More information about the slime-cvs mailing list