johnsu01 (johnsu01) wrote,

Unsetting Background Color

I had to figure this out because I connect to the same screen session running emacs from several different locations, with different needs. From my hiptop, the background color of emacs needs to be black, because the default background on the hiptop is light enough that most faces in Gnus, for example, get lost. So I usually just do `M-x set-background-color RET black RET'.

But sometimes later, in the aterm window on my laptop, I like to have a background image or some transparency. The background color covers this up.

`M-x set-background-color' doesn't allow you to set no or nil background color. I'm not sure why it doesn't allow that.

My solution was to do `M-x customize-face RET default RET'. Then uncheck the Foreground box, and set it for the current session.

In my time with Emacs Lisp, I haven't yet looked in to how to directly work with faces; obviously Customize is just a convenient interface. And setting the frame properties directly might work; in a new emacs session, the background-color frame property is set to "unspecified-bg". I'm not sure what what happens if you set that manually after setting a background color.

Addendum. That trick didn't work the second time that I tried it. Instead, this worked: (set-face-background 'default "buddha"). Or, substitute whatever you like for "buddha", as long as it is not actually a color. If you want to appear rational, you can use "unspecified", but it doesn't actually matter.

So now, I can have my terminal background images when I feel like eye-candy, and change the background to something more readable when I need to without having to restart the emacs session.

By the way, the propaganda-debian package has some nice background images in it.

Tags: emacs
  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.