Discussion:
Emacs won't start, display error
(too old to reply)
Chris Schwaab
2009-10-27 17:26:45 UTC
Permalink
Emacs 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.
Installing and starting xemacs works with the following warnings:
Warning: Color name "BACKGROUND" is not defined
Warning: Color name "FOREGROUND" is not defined

Thanks.
- Chris
Lowell Gilbert
2009-10-28 14:58:33 UTC
Permalink
Post by Chris Schwaab
Emacs 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.

What happens with the -q option?
--
Lowell Gilbert, embedded/networking software engineer
http://be-well.ilk.org/~lowell/
Chris Schwaab
2009-10-28 17:05:13 UTC
Permalink
Post by Lowell Gilbert
Emacs 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.
What happens with the -q option?
--
Lowell Gilbert, embedded/networking software engineer
         http://be-well.ilk.org/~lowell/
I've tried blowing up my ~/.emacs file.
emacs -q gives the same result :(
Lowell Gilbert
2009-10-28 18:19:19 UTC
Permalink
Post by Chris Schwaab
Post by Lowell Gilbert
Emacs 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.
What happens with the -q option?
--
Lowell Gilbert, embedded/networking software engineer
         http://be-well.ilk.org/~lowell/
I've tried blowing up my ~/.emacs file.
emacs -q gives the same result :(
Did you rebuild emacs just before this started?
--
Lowell Gilbert, embedded/networking software engineer
http://be-well.ilk.org/~lowell/
Chris Schwaab
2009-10-28 20:21:54 UTC
Permalink
Post by Lowell Gilbert
Post by Chris Schwaab
Post by Lowell Gilbert
Emacs 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.
What happens with the -q option?
--
Lowell Gilbert, embedded/networking software engineer
         http://be-well.ilk.org/~lowell/
I've tried blowing up my ~/.emacs file.
emacs -q gives the same result :(
Did you rebuild emacs just before this started?
--
Lowell Gilbert, embedded/networking software engineer
         http://be-well.ilk.org/~lowell/
I'm using arch's binary package (but I think something must have been
updated to cause the breakage, sadly I didn't pay enough attention to
note it). I tried building from 23.1 source and get the same results.
Lowell Gilbert
2009-10-28 23:50:24 UTC
Permalink
Post by Chris Schwaab
Post by Lowell Gilbert
Post by Chris Schwaab
Post by Lowell Gilbert
Emacs 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.
What happens with the -q option?
--
Lowell Gilbert, embedded/networking software engineer
         http://be-well.ilk.org/~lowell/
I've tried blowing up my ~/.emacs file.
emacs -q gives the same result :(
Did you rebuild emacs just before this started?
I'm using arch's binary package (but I think something must have been
updated to cause the breakage, sadly I didn't pay enough attention to
note it). I tried building from 23.1 source and get the same results.
I have one more vague memory that may be connected if you're lucky. It
may be related to X resources.

If that's not it, you may need help from someone who actually knows what
they're talking about.
--
Lowell Gilbert, embedded/networking software engineer
http://be-well.ilk.org/~lowell/
Chris Schwaab
2009-10-28 20:21:54 UTC
Permalink
Post by Lowell Gilbert
Post by Chris Schwaab
Post by Lowell Gilbert
Emacs 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.
What happens with the -q option?
--
Lowell Gilbert, embedded/networking software engineer
         http://be-well.ilk.org/~lowell/
I've tried blowing up my ~/.emacs file.
emacs -q gives the same result :(
Did you rebuild emacs just before this started?
--
Lowell Gilbert, embedded/networking software engineer
         http://be-well.ilk.org/~lowell/
I'm using arch's binary package (but I think something must have been
updated to cause the breakage, sadly I didn't pay enough attention to
note it). I tried building from 23.1 source and get the same results.
Lowell Gilbert
2009-10-28 18:19:19 UTC
Permalink
Post by Chris Schwaab
Post by Lowell Gilbert
Emacs 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.
What happens with the -q option?
--
Lowell Gilbert, embedded/networking software engineer
         http://be-well.ilk.org/~lowell/
I've tried blowing up my ~/.emacs file.
emacs -q gives the same result :(
Did you rebuild emacs just before this started?
--
Lowell Gilbert, embedded/networking software engineer
http://be-well.ilk.org/~lowell/
d***@verizon.net
2009-10-29 00:53:29 UTC
Permalink
Post by Lowell Gilbert
Post by Chris Schwaab
Emacs 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.

Some X-Resources file probably contains something like this:

*Background: BACKGROUND

and it was expecting to be run thru xrdb like this:

xrdb -D BACKGROUND=white -D FOREGROUND=black <resource file>

start to diagnose by running the command:

appres Emacs | grep BACKGROUND
Chris Schwaab
2009-10-29 16:12:33 UTC
Permalink
Post by d***@verizon.net
Post by Lowell Gilbert
Emacs 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?

Thanks again.
- Chris
d***@verizon.net
2009-10-29 19:09:01 UTC
Permalink
Post by Chris Schwaab
Post by d***@verizon.net
Post by Lowell Gilbert
Emacs 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.
Chris Schwaab
2009-10-29 22:12:42 UTC
Permalink
Post by d***@verizon.net
Post by d***@verizon.net
Post by Lowell Gilbert
Emacs 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.
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.
Emacs*Background:       BACKGROUND
That would not be OK.
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.
Tried moving the .ad file, doesn't seem to help anything. There are a
ton of undefined things from appres so I'll just give a few:
$ appres Emacs
Warning: Color name "BACKGROUND" is not defined
*Entry.highlightBackground: WINDOW_BACKGROUND
*Entry.foreground: WINDOW_FOREGROUND
*Entry.activeBackground: WINDOW_BACKGROUND
*Entry.selectForeground: SELECT_FOREGROUND
*Entry.background: WINDOW_BACKGROUND
*Entry.activeForeground: WINDOW_FOREGROUND
*Entry.highlightColor: WINDOW_FOREGROUND
*Entry.selectBackground: SELECT_BACKGROUND
*XmFrame.background: BACKGROUND
*XmFrame.foreground: FOREGROUND
*XmLabel.background: BACKGROUND
*XmLabel.foreground: FOREGROUND
*XmLabelGadget.background: BACKGROUND
*XmLabelGadget.foreground: FOREGROUND
*Form.background: BACKGROUND
*Form.foreground: FOREGROUND
*XmList.background: WINDOW_BACKGROUND
Chris Schwaab
2009-10-29 22:16:06 UTC
Permalink
Post by d***@verizon.net
Post by d***@verizon.net
Post by Lowell Gilbert
Emacs 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.
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.
Emacs*Background:       BACKGROUND
That would not be OK.
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.
I just realized I should point out none of the items actually start
with "Emacs*".
They all are just "*widget.property".
p***@gmail.com
2016-11-15 22:47:09 UTC
Permalink
I know this is a dead thread, but thought I'd post the fix I found for this, which was simply to remove emacs with the command:

pacman -Rs emacs

and then reinstalling it.

This might not work for others, but it worked for me :)

Good luck :)

Chris Schwaab
2009-10-28 17:05:13 UTC
Permalink
Post by Lowell Gilbert
Emacs 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.
What happens with the -q option?
--
Lowell Gilbert, embedded/networking software engineer
         http://be-well.ilk.org/~lowell/
I've tried blowing up my ~/.emacs file.
emacs -q gives the same result :(
Continue reading on narkive:
Loading...