A fresh install of Ubuntu 14.04.  I installed the trinity nightlies.  

The first thing I notice is trying to start emacs, I get the error. 

Undefined color: "FOREGROUND"

emacs -q also gives the same error.

emacs -nw works as expected.

Judging from this:
http://emacs.1067599.n5.nabble.com/bug-16462-emacs-does-not-start-under-KDE-Undefined-color-quot-WINDOW-FOREGROUND-quot-td310437.html

I believe it's is some weird X problem.  Since emacs worked fine when I edited /etc/apt/sources.lists to add the nightly repo, I'm guessing it is somehow related to installing TDE.

There is an Emacs.ad file in:
/opt/trinity/share/apps/tdedisplay/app-defaults/Emacs.ad

xrdb -query | grep -i emacs
Emacs*Background:       WINDOW_BACKGROUND
Emacs*Dialog*background:        BACKGROUND
Emacs*Dialog*foreground:        FOREGROUND
Emacs*Foreground:       WINDOW_FOREGROUND
Emacs*XlwScrollBar.Background:  BACKGROUND
Emacs*XlwScrollBar.Foreground:  FOREGROUND
Emacs*backgroundToolBarColor:   BACKGROUND
Emacs*bottomToolBarShadowColor: BACKGROUND
Emacs*menubar*background:       BACKGROUND
Emacs*menubar*foreground:       FOREGROUND
Emacs*popup*Background: BACKGROUND
Emacs*popup*Foreground: FOREGROUND
Emacs*toolBarShadowThickness:   0
Emacs*topToolBarShadowColor:    BACKGROUND
Emacs.default.attributeBackground:      WINDOW_BACKGROUND
Emacs.default.attributeForeground:      WINDOW_FOREGROUND

Any idea how to make emacs work again?

Thanks in advance.

-LTH.