See first comment of bug 371947:
"emerge: Maybe you meant any of these: kde-base/kttsd, net-dns/totd,
Where kde-base/kttsd is directory without any .ebuild files.
Then Portage shouldn't suggest it as an alternative...
Given that the directory containing no ebuilds is a mistake in need of correction, I think we can safely neglect this case at the level of the emerge suggestions. Otherwise, we'll have to add some listdir calls which are totally redundant when the tree it in the "correct" state.
It was also mentioned on irc that it suggests installed packages that are no longer in the tree. However, I think this is acceptable, since we're trying to predict what the user intended to type, which does not necessarily correspond to a package which is currently available to install.
I've made it a bit smarter here, by ensuring that it doesn't suggest kttsd when kttsd was given as the input:
(In reply to comment #1)
> It was also mentioned on irc that it suggests installed packages that are no
> longer in the tree.
This is actually handled in latest portage versions by skipping the suggestions entirely:
This is fixed in 22.214.171.124.