I'm a former Gentoo Linux user who's switched to Mac, so I'm very familiar with Gentoo and Portage.

I've just installed Gentoo for OS X, and for some reason, almost every package I try to emerge is masked with the missing keyword.

I tried this for log4, junit, jdom, etc. I got the same problems for all of them. Following the instructions in the man pages, I looked at /usr/portage/profiles/package.mask, but I can't find those packages in the file.

it looks like you're using the wrong keyword. I just installed emacs fine with ACCEPT_KEYWORDS="~ppc-macos".

The emacs-22.0.50_pre20050225 package is specifically keyworded "~ppc-macos -*". But your emerge's output says that the emacs-22.0.50_pre20050225 package is "masked by -* keyword", which indicates that you have the wrong keywords in your /etc/make.conf

So, check your /etc/make.conf : ACCEPT_KEYWORDS should only be "ppc-macos" or "~ppc-macos" on an OSX system.