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
commit238deb7981f17953b2ae61d81720f1e99a6c73f2 (patch)
treebb66c5ce62f353919bdd6220c6bf9d7aea237cf3
parenta3143563485da98b232b01826ce81490b620bb89 (diff)
downloadgeiser-238deb7981f17953b2ae61d81720f1e99a6c73f2.tar.gz
geiser-238deb7981f17953b2ae61d81720f1e99a6c73f2.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)