summaryrefslogtreecommitdiff
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
commitfe8de4b31e916c1f1883826cade2c8dc310afe48 (patch)
treef60c754d0c7df724d3c63e0422037cf734d0c11b
parent2a582ee40aa77ff4d05baef3e2ea4449615cd93f (diff)
downloadgeiser-chez-fe8de4b31e916c1f1883826cade2c8dc310afe48.tar.gz
geiser-chez-fe8de4b31e916c1f1883826cade2c8dc310afe48.tar.bz2
Finer grained maintenance of autodoc's cache
-rw-r--r--elisp/geiser-autodoc.el11
-rw-r--r--elisp/geiser-compile.el2
-rw-r--r--elisp/geiser-debug.el7
-rw-r--r--elisp/geiser-syntax.el3
4 files changed, 17 insertions, 6 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)))
diff --git a/elisp/geiser-compile.el b/elisp/geiser-compile.el
index bc9aace..f59f9e5 100644
--- a/elisp/geiser-compile.el
+++ b/elisp/geiser-compile.el
@@ -39,7 +39,7 @@
(path (cdr b/p))
(msg (format "%s %s ..." msg path)))
(message msg)
- (geiser-autodoc--clean-cache)
+ (geiser-autodoc--clean-cache t)
(geiser-compile--display-result
msg (geiser-eval--send/wait
`(,(if compile-p :comp-file :load-file) ,path)))))
diff --git a/elisp/geiser-debug.el b/elisp/geiser-debug.el
index 76865f3..02b463e 100644
--- a/elisp/geiser-debug.el
+++ b/elisp/geiser-debug.el
@@ -145,9 +145,12 @@ buffer.")
(ret (geiser-eval--send/wait code))
(res (geiser-eval--retort-result-str ret))
(err (geiser-eval--retort-error ret)))
- (geiser-autodoc--clean-cache)
(when and-go (funcall and-go))
- (when (not err) (message "%s" res))
+ (when (not err)
+ (save-excursion
+ (goto-char (/ (+ end start) 2))
+ (geiser-autodoc--clean-cache))
+ (message "%s" res))
(geiser-debug--display-retort (geiser-syntax--scheme-str str) ret res)))
(defun geiser-debug--expand-region (start end all wrap)
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index eff1e41..8428f49 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -320,7 +320,8 @@ implementation-specific entries for font-lock-keywords.")
(prev (and (geiser-syntax--keywordp prev)
(list prev))))
(push `(,(car form) ,pos ,@prev) path)))))))
- (mapcar (lambda (e) (cons (format "%s" (car e)) (cdr e)))
+ (mapcar (lambda (e)
+ (cons (substring-no-properties (format "%s" (car e))) (cdr e)))
(nreverse path))))
(defsubst geiser-syntax--binding-form-p (bfs sbfs f)