minibuffer-complete-word is has a feature that I find annoying.
If you have the following files:
~/foo.zzy
~/foo-bar
~/foo bar
Then minibuffer-complete-word completes 'foo' then completes "foo bar",
with no indication that there were other files to complete.
Looking at the code, I notice that minibuffer-complete-word goes out
of it's way to produce this behavior with the code:
> (or (and (characterp char) (> char 0)
> (funcall foo (char-to-string char)))
> (and (not (eq char ?\ ))
> (funcall foo " "))
> (and (not (eq char ?\-))
> (funcall foo "-"))
Removing the first three or clauses produces the behavior that I find
more intuitive... Eg - complete out to "foo" and then ask me to complete:
* Possible completions are:
* foo bar foo-bar foo.xxzzy
Is there a reason (that I'm missing) for this code?
-jeff
(defun minibuffer-complete-word ()
(interactive)
(let* ((buffer-string (buffer-string))
(completion (try-completion buffer-string
minibuffer-completion-table
minibuffer-completion-predicate))
(status (minibuffer-do-completion-1 buffer-string completion)))
(cond ((eq status 'none) ...)
((eq status 'unique) ...)
(t
(cond ((or (eq status 'uncompleted)
(eq status 'exact))
(let ((foo ...)
(char last-command-char))
;; Try to complete by adding a word-delimiter
> (or (and (characterp char) (> char 0)
> (funcall foo (char-to-string char)))
> (and (not (eq char ?\ ))
> (funcall foo " "))
> (and (not (eq char ?\-))
> (funcall foo "-"))
(progn
(if completion-auto-help
(minibuffer-completion-help)
;; New message, only in this new Lisp code
;; rewritten for I18N3 snarfing
(if (eq status 'exact)
(temp-minibuffer-message
" [Complete, but not unique]")
(temp-minibuffer-message " [Ambiguous]")))
nil))))
....)))))