See first comment of bug 371947: "emerge: Maybe you meant any of these: kde-base/kttsd, net-dns/totd, kde-base/kscd?" 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: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cbe44d92ff13b8a22f5b4215b73078ce600c6bf4
(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: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1afde255d556a904148e3ee77c5e82589161ccc5
This is fixed in 2.1.10.4.