summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-21 05:25:37 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-21 05:25:37 +0100
commit629f38d05e35faba3655936c68500785dba148a2 (patch)
tree3535b3f594ed412d908d64751e001ceb5471785b
parenteefc4cddbc303b6de38b9b0d80ac591e6282fd5c (diff)
downloadgeiser-guile-629f38d05e35faba3655936c68500785dba148a2.tar.gz
geiser-guile-629f38d05e35faba3655936c68500785dba148a2.tar.bz2
Better message on completion failure
Tell people that we're trying to complete, sometimes, on two different prefixes.
-rw-r--r--elisp/geiser-completion.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/elisp/geiser-completion.el b/elisp/geiser-completion.el
index b33c976..33593b6 100644
--- a/elisp/geiser-completion.el
+++ b/elisp/geiser-completion.el
@@ -223,7 +223,7 @@ we're looking for a module name.")
(buffer-substring-no-properties (geiser-completion--symbol-begin module)
(point)))
-(defun geiser-completion--complete-symbol (&optional arg)
+(defun geiser-completion--complete-symbol (&optional arg previous)
"Complete the symbol at point.
Perform completion similar to Emacs' complete-symbol.
With prefix, complete module name."
@@ -237,9 +237,14 @@ With prefix, complete module name."
(partial (cdr result)))
(cond ((null completions)
(if (not arg)
- (geiser-completion--complete-symbol t)
- (geiser--respecting-message "Can't find completion for %S"
- prefix)
+ (geiser-completion--complete-symbol t prefix)
+ (geiser--respecting-message "Can't find completion for %S%s"
+ prefix
+ (if (and previous
+ (not (equalp previous
+ prefix)))
+ (format " or %S" previous)
+ ""))
(geiser-completion--restore-window-cfg)))
(t (insert-and-inherit (substring partial (length prefix)))
(cond ((= (length completions) 1)