summaryrefslogtreecommitdiff
path: root/elisp/geiser-completion.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-05-08 01:48:52 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-05-08 01:48:52 +0200
commitc09f5bbaa836d04a9babdff0943dc596dbc68e38 (patch)
treee2c9c91fa86534ba9479c03a067164947fb034d1 /elisp/geiser-completion.el
parent9127a121c76f5d5606bca9a668bda5509ec3b830 (diff)
downloadgeiser-guile-c09f5bbaa836d04a9babdff0943dc596dbc68e38.tar.gz
geiser-guile-c09f5bbaa836d04a9babdff0943dc596dbc68e38.tar.bz2
Module completion generalized and implemented for PLT.
Diffstat (limited to 'elisp/geiser-completion.el')
-rw-r--r--elisp/geiser-completion.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/elisp/geiser-completion.el b/elisp/geiser-completion.el
index d2991b2..d27ef0f 100644
--- a/elisp/geiser-completion.el
+++ b/elisp/geiser-completion.el
@@ -196,11 +196,13 @@ terminates a current completion."
(minibuffer-message text)
(message "%s" text))))
-(defsubst geiser-completion--beg-pos (module)
- (if module
- (max (save-excursion (beginning-of-line) (point))
- (save-excursion (skip-syntax-backward "^(>") (1- (point))))
- (save-excursion (skip-syntax-backward "^-()>") (point))))
+(make-variable-buffer-local
+ (defvar geiser-completion--symbol-begin-function nil))
+
+(defsubst geiser-completion--symbol-begin (module)
+ (or (and geiser-completion--symbol-begin-function
+ (funcall geiser-completion--symbol-begin-function module))
+ (save-excursion (skip-syntax-backward "^-()>") (point))))
(defun geiser-completion--complete-symbol (&optional arg)
"Complete the symbol at point.
@@ -208,7 +210,7 @@ Perform completion similar to Emacs' complete-symbol.
With prefix, complete module name."
(interactive "P")
(let* ((end (point))
- (beg (geiser-completion--beg-pos arg))
+ (beg (geiser-completion--symbol-begin arg))
(prefix (buffer-substring-no-properties beg end))
(result (geiser-completion--complete prefix arg))
(completions (car result))