Post by Chris SchwaabPost by d***@verizon.netPost by Lowell GilbertEmacs has been working fine for quite a while now (23.1.50). Recently
when I start emacs it fails with 'Undefined color: "FOREGROUND"'. So
to get the thing to shut up I arbitrarily added "0 0 0 FOREGROUND" to
rgb.txt. Now it's giving an error about WINDOW_FOREGROUND being
undefined (which I can't fix by adding it to rgb.txt).
The command
for f in `locate .el | grep ".el$"`; do; grep -q "FOREGROUND" $f &&
[ $? ] && echo $f; done
reveals the following files
/usr/share/emacs/23.1/lisp/ldefs-boot.el
/usr/share/emacs/23.1/lisp/loaddefs.el
But both mention FOREGROUND merely in strings. Any ideas?
I also tried 23.1 which fails.
Warning: Color name "BACKGROUND" is not defined
Warning: Color name "FOREGROUND" is not defined
I've seen this, but I can't remember what the problem turned out to be.
I'm pretty sure it was something dumb that I did, but that doesn't
narrow it down much.
Looks to me like he has an X-Resource set that didn't get expanded
the way the author expected.
*Background: BACKGROUND
xrdb -D BACKGROUND=white -D FOREGROUND=black <resource file>
appres Emacs | grep BACKGROUND
I'm not too familiar with X resources. I checked ~/.Xresources which
is okay. Running "appres emacs" gives a long list of things set to
WINDOW_FOREGROUND, FOREGROUND, and BACKGROUND. Grepping through /etc
and /usr/share reveals a bunch of files under /usr/share/apps/kdisplay/
app-defaults/. One of which is Emacs.ad. Any pointers on where to
look? Also can I somehow preprocess these files or is that supposed
to happen each time X starts?
Be more specific.
When I do appres I see:
home> appres Emacs | grep -i background
Emacs.menu*background: cornflowerblue
Emacs*XmScrollBar.Background: Gray75
Emacs*XmScrollBar*Background: wheat
Emacs*dialog*XmTextField*Background: WhiteSmoke
Emacs*dialog*XmText*Background: WhiteSmoke
Emacs*dialog*XmList*Background: WhiteSmoke
Emacs.dialog*background: blue
Emacs*dialog*Background: #A5C0C1
Emacs.modeline.attributeBackground: Wheat
Emacs.zmacs-region.attributeBackground: DarkOrchid3
Emacs.primary-selection.attributeBackground: DarkOrchid3
Emacs.menubar*background: cornflowerblue
Emacs*menubar*Background: DeepSkyBlue1
Emacs.secondary-selection.attributeBackground: DarkOrchid2
Emacs.italic.attributeBackground: black
Emacs.bold.attributeBackground: black
Emacs*popup*Background: lightblue
Emacs.bold-italic.attributeBackground: black
Emacs.pane.menubar.background: cornflowerblue
Emacs*XlwScrollBar.Background: Gray75
Emacs.isearch.attributeBackground: black
Emacs*BackGround: black
Emacs*pointerBackground: red
Emacs.attributeBackground: black
Emacs*background: black
Emacs*Background: black
Emacs.backgroundMode: dark
All of those are OK.
If I saw:
Emacs*Background: BACKGROUND
That would not be OK.
And, since you mentioned Emacs.ad, I found this file:
home> cat /usr/share/gnome-settings-daemon/xrdb/Emacs.ad
Emacs.default.attributeForeground: WINDOW_FOREGROUND
Emacs.default.attributeBackground: WINDOW_BACKGROUND
Emacs*Foreground: WINDOW_FOREGROUND
Emacs*Background: WINDOW_BACKGROUND
Emacs*menubar*foreground: FOREGROUND
Emacs*menubar*background: BACKGROUND
Emacs*popup*Foreground: FOREGROUND
Emacs*popup*Background: BACKGROUND
Emacs*Dialog*foreground: FOREGROUND
That's definitely a problem unless Gnome does something
to define BACKGROUND before it's used.
Try renaming it so it doesn't end in .ad and restart.