summaryrefslogtreecommitdiff
path: root/elisp/geiser-completion.el
diff options
context:
space:
mode:
Diffstat (limited to 'elisp/geiser-completion.el')
-rw-r--r--elisp/geiser-completion.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/elisp/geiser-completion.el b/elisp/geiser-completion.el
index d346190..f88fae6 100644
--- a/elisp/geiser-completion.el
+++ b/elisp/geiser-completion.el
@@ -228,14 +228,19 @@ we're looking for a module name.")
Perform completion similar to Emacs' complete-symbol.
With prefix, complete module name."
(interactive "P")
+ (unless (geiser-syntax--symbol-at-point)
+ (error "No symbol at point"))
(geiser--respecting-message "Retrieving completions...")
(let* ((prefix (geiser-completion--prefix arg))
- (result (geiser-completion--complete prefix arg))
+ (result (and prefix (geiser-completion--complete prefix arg)))
(completions (car result))
(partial (cdr result)))
(cond ((null completions)
- (geiser--respecting-message "Can't find completion for %S" prefix)
- (geiser-completion--restore-window-cfg))
+ (if (not arg)
+ (geiser-completion--complete-symbol t)
+ (geiser--respecting-message "Can't find completion for %S"
+ prefix)
+ (geiser-completion--restore-window-cfg)))
(t (insert-and-inherit (substring partial (length prefix)))
(cond ((= (length completions) 1)
(geiser--respecting-message "Sole completion")