Stefan Monnier writes: >>> Or perhaps completion-emacs22-try-completion is violating the spec of >>> completion-try-completion, and should be returning nil in this case? > > The "emacs22" style disregards the text after point to compute the > completions, so "foo" would be a valid return value as well, but indeed > t seems wrong because that should apply to the complete input. I think "foo" (or more specifically '("foo" . 3)) might be a bit unexpected, because then if you pressed TAB with the input foo|bar, the bar would be deleted. And emacs22 completion usually doesn't delete the text after point, it just ignores it. So '("foobar" . 3) seems better. Open to counterarguments of course. A patch which implements this is below.