[slime-cvs] CVS slime/contrib

CVS User trittweiler trittweiler at common-lisp.net
Tue Mar 23 20:21:48 UTC 2010


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

Modified Files:
	ChangeLog slime-autodoc.el 
Log Message:
	Do not do an unnecessary autodoc RPC request in case we're not
	actually inside a form.

	* slime-autodoc.el (slime-make-autodoc-rpc-form): Return nil if
	not inside a form.
	(slime-autodoc): Adapted accordingly to propagate nil to eldoc.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2010/03/20 08:27:50	1.359
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2010/03/23 20:21:48	1.360
@@ -1,3 +1,12 @@
+2010-03-23  Tobias C. Rittweiler  <tcr at freebits.de>
+
+	Do not do an unnecessary autodoc RPC request in case we're not
+	actually inside a form.
+
+	* slime-autodoc.el (slime-make-autodoc-rpc-form): Return nil if
+	not inside a form.
+	(slime-autodoc): Adapted accordingly to propagate nil to eldoc.
+
 2010-03-20  Stas Boukarev  <stassats at gmail.com>
 
 	* slime-c-p-c.el, slime-fuzzy.el: Don't define keys on slime-repl-mode-map
--- /project/slime/cvsroot/slime/contrib/slime-autodoc.el	2010/03/07 14:09:51	1.36
+++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el	2010/03/23 20:21:48	1.37
@@ -62,12 +62,13 @@
   "Return a cache key and a swank form."
   (let* ((levels slime-autodoc-accuracy-depth)
          (buffer-form (slime-parse-form-upto-point levels)))
-    (values buffer-form
-            (multiple-value-bind (width height)
-                (slime-autodoc-message-dimensions)
-              `(swank:autodoc ',buffer-form
-                              :print-right-margin ,width
-                              :print-lines ,height)))))
+    (when buffer-form
+      (values buffer-form
+              (multiple-value-bind (width height)
+                  (slime-autodoc-message-dimensions)
+                `(swank:autodoc ',buffer-form
+                                :print-right-margin ,width
+                                :print-lines ,height))))))
 
 (defun slime-autodoc-global-at-point ()
   "Return the global variable name at point, if any."
@@ -166,22 +167,24 @@
       (unless (slime-inside-string-or-comment-p)
         (multiple-value-bind (cache-key retrieve-form) 
             (slime-make-autodoc-rpc-form)
-          (let ((cached (slime-get-cached-autodoc cache-key)))
-            (if cached
-                cached
-                ;; If nothing is in the cache, we first decline (by
-                ;; returning nil), and fetch the arglist information
-                ;; asynchronously.
-                (prog1 nil
-                  (slime-eval-async retrieve-form
-                    (lexical-let ((cache-key cache-key))
-                      (lambda (doc)
-                        (unless (eq doc :not-available) 
-                          (setq doc (slime-format-autodoc doc))
-                          ;; Now that we've got our information,
-                          ;; get it to the user ASAP.
-                          (eldoc-message doc)
-                          (slime-store-into-autodoc-cache cache-key doc)))))))))))))
+          (let ((it))
+            (cond 
+              ((not cache-key) nil)
+              ((setq cached (slime-get-cached-autodoc cache-key)) cached)
+              (t
+               ;; If nothing is in the cache, we first decline (by
+               ;; returning nil), and fetch the arglist information
+               ;; asynchronously.
+               (slime-eval-async retrieve-form
+                 (lexical-let ((cache-key cache-key))
+                   (lambda (doc)
+                     (unless (eq doc :not-available) 
+                       (setq doc (slime-format-autodoc doc))
+                       ;; Now that we've got our information,
+                       ;; get it to the user ASAP.
+                       (eldoc-message doc)
+                       (slime-store-into-autodoc-cache cache-key doc)))))
+               nil))))))))
 
 (make-variable-buffer-local (defvar slime-autodoc-mode nil))
 





More information about the slime-cvs mailing list