[slime-cvs] CVS slime/contrib
CVS User sboukarev
sboukarev at common-lisp.net
Wed Oct 5 14:17:59 UTC 2011
Update of /project/slime/cvsroot/slime/contrib
In directory tiger.common-lisp.net:/tmp/cvs-serv25592
Modified Files:
ChangeLog slime-autodoc.el swank-arglists.lisp
Log Message:
* slime-autodoc.el (slime-autodoc): Don't cache variable values.
(slime-autodoc-global-at-point): Remove, unused.
--- /project/slime/cvsroot/slime/contrib/ChangeLog 2011/10/05 11:58:00 1.497
+++ /project/slime/cvsroot/slime/contrib/ChangeLog 2011/10/05 14:17:59 1.498
@@ -1,5 +1,10 @@
2011-10-05 Stas Boukarev <stassats at gmail.com>
+ * slime-autodoc.el (slime-autodoc): Don't cache variable values.
+ (slime-autodoc-global-at-point): Remove, unused.
+
+2011-10-05 Stas Boukarev <stassats at gmail.com>
+
* slime-repl.el (slime-clear-repl-variables): New function, clears *, /,
and + variables.
(slime-repl-clear-buffer-hook): Add `slime-clear-repl-variables'
--- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/09/18 20:47:29 1.47
+++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2011/10/05 14:17:59 1.48
@@ -58,7 +58,7 @@
(let ((name (etypecase name
(string name)
(symbol (symbol-name name)))))
- (slime-eval `(swank:autodoc '(,name ,slime-cursor-marker)))))
+ (car (slime-eval `(swank:autodoc '(,name ,slime-cursor-marker))))))
;;;; Autodocs (automatic context-sensitive help)
@@ -73,24 +73,6 @@
:print-right-margin
,(window-width (minibuffer-window)))))))
-(defun slime-autodoc-global-at-point ()
- "Return the global variable name at point, if any."
- (when-let (name (slime-symbol-at-point))
- (and (slime-global-variable-name-p name) name)))
-
-(defcustom slime-global-variable-name-regexp "^\\(.*:\\)?\\([*+]\\).+\\2$"
- "Regexp used to check if a symbol name is a global variable.
-
-Default value assumes +this+ or *that* naming conventions."
- :type 'regexp
- :group 'slime)
-
-(defun slime-global-variable-name-p (name)
- "Is NAME a global variable?
-Globals are recognised purely by *this-naming-convention*."
- (and (< (length name) 80) ; avoid overflows in regexp matcher
- (string-match slime-global-variable-name-regexp name)))
-
;;;; Autodoc cache
@@ -174,12 +156,14 @@
(lexical-let ((cache-key cache-key)
(multilinep multilinep))
(lambda (doc)
- (unless (eq doc :not-available)
- (slime-store-into-autodoc-cache cache-key doc)
- ;; Now that we've got our information,
- ;; get it to the user ASAP.
- (eldoc-message
- (slime-format-autodoc doc multilinep))))))
+ (destructuring-bind (doc cache-p) doc
+ (unless (eq doc :not-available)
+ (when cache-p
+ (slime-store-into-autodoc-cache cache-key doc))
+ ;; Now that we've got our information,
+ ;; get it to the user ASAP.
+ (eldoc-message
+ (slime-format-autodoc doc multilinep)))))))
nil))))))))
(defvar slime-autodoc-cache-car nil)
@@ -243,7 +227,7 @@
(defun slime-autodoc-to-string ()
"Retrieve and return autodoc for form at point."
- (let ((autodoc (slime-eval (second (slime-make-autodoc-rpc-form)))))
+ (let ((autodoc (car (slime-eval (second (slime-make-autodoc-rpc-form))))))
(if (eq autodoc :not-available)
:not-available
(slime-canonicalize-whitespace autodoc))))
--- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2010/09/18 09:34:06 1.70
+++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2011/10/05 14:17:59 1.71
@@ -1085,9 +1085,12 @@
;;; considered.
(defslimefun autodoc (raw-form &key print-right-margin)
- "Return a string representing the arglist for the deepest subform in
+ "Return a list of two elements.
+First, a string representing the arglist for the deepest subform in
RAW-FORM that does have an arglist. The highlighted parameter is
-wrapped in ===> X <===."
+wrapped in ===> X <===.
+
+Second, a boolean value telling whether the returned string can be cached."
(handler-bind ((serious-condition
#'(lambda (c)
(unless (debug-on-swank-error)
@@ -1098,16 +1101,18 @@
(multiple-value-bind (form arglist obj-at-cursor form-path)
(find-subform-with-arglist (parse-raw-form raw-form))
(cond ((boundp-and-interesting obj-at-cursor)
- (print-variable-to-string obj-at-cursor))
+ (list (print-variable-to-string obj-at-cursor) nil))
(t
- (with-available-arglist (arglist) arglist
- (decoded-arglist-to-string
- arglist
- :print-right-margin print-right-margin
- :operator (car form)
- :highlight (form-path-to-arglist-path form-path
- form
- arglist)))))))))
+ (list
+ (with-available-arglist (arglist) arglist
+ (decoded-arglist-to-string
+ arglist
+ :print-right-margin print-right-margin
+ :operator (car form)
+ :highlight (form-path-to-arglist-path form-path
+ form
+ arglist)))
+ t)))))))
(defun boundp-and-interesting (symbol)
(and symbol
More information about the slime-cvs
mailing list