summaryrefslogtreecommitdiff
path: root/elisp/geiser-autodoc.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-12-28 04:11:46 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-12-28 04:11:46 +0100
commit87af9354491a6faf7cec13d45f303e1eca7e50f0 (patch)
treedf631fc5d0d71a755a1d6c5d12a0b2d7185630c1 /elisp/geiser-autodoc.el
parent19d70712975f093a13f19d9fb5b6eb30ebcb0076 (diff)
downloadgeiser-87af9354491a6faf7cec13d45f303e1eca7e50f0.tar.gz
geiser-87af9354491a6faf7cec13d45f303e1eca7e50f0.tar.bz2
Finer grained maintenance of autodoc's cache
Diffstat (limited to 'elisp/geiser-autodoc.el')
-rw-r--r--elisp/geiser-autodoc.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el
index 1befb74..04f450e 100644
--- a/elisp/geiser-autodoc.el
+++ b/elisp/geiser-autodoc.el
@@ -54,8 +54,15 @@ when `geiser-autodoc-display-module-p' is on."
(make-variable-buffer-local
(defvar geiser-autodoc--cached-signatures nil))
-(defsubst geiser-autodoc--clean-cache ()
- (setq geiser-autodoc--cached-signatures nil))
+(defun geiser-autodoc--clean-cache (&optional whole)
+ (if whole
+ (setq geiser-autodoc--cached-signatures nil)
+ (let ((s (car (last (geiser-syntax--locals-around-point nil nil))))
+ (cache))
+ (when s
+ (dolist (item geiser-autodoc--cached-signatures)
+ (unless (string-equal s (car item)) (push item cache)))
+ (setq geiser-autodoc--cached-signatures (nreverse cache))))))
(defun geiser-autodoc--save-signatures (ret)
(let ((res (geiser-eval--retort-result ret)))