emacsclient unable to load color "unspecified-bg"
Asked Answered
H

2

11

I'm getting the error Unable to load color "unspecified-bg" [16 times] when using emacsclient -c. I've started up emacs using emacs --daemon. This seems to mean that my custom faces won't load.

When starting emacs as usual, and then using M-x server-start, then this problem doesn't happen at all. How can I get emacsclient -c to load the faces properly?

Here's the relevant code:

(custom-set-faces '(default ((t (:inherit nil :stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "unknown" :family "Inconsolata")))))

Henka answered 29/1, 2011 at 21:43 Comment(1)
I've tried getting around this by customising the face manually once I've initialised the daemon. I start up an emacs client, and then in that use M-x customize-face RET default to bring up the default face. The values there seem to have been left unchanged. If I change them, then save for all sessions, I can launch new client windows which use the settings. If, however, I restart the emacs daemon, I get the usual error. Strange, because all that editing the faces seems to do is edit .emacs so that it contains the new settings.Henka
S
1

I'm not 100% sure this would fix your problem, but you really should be using color-theme for syntax highlighting. Custom is meant for beginning emacs users, so I'd suggest you try out color-theme and see if it works. Here's how I have it set up on my machine:

  1. Download the package from the color-theme homepage.
  2. Put the color-theme folder somewhere like ~/.emacs.d/color-theme/.
  3. Make sure this folder is in your load-path. I took the following code from a Steve Yegge post:

In your .emacs:

(defvar emacs-root "~/.emacs.d/")
(labels
  ((add-path
    (p)
    (add-to-list
     'load-path
     (concat emacs-root p))))
  (add-path "lisp")
  (add-path "color-theme-6.6.0")
  (add-path "cedet-1.0"))

(require 'color-theme)

Then you define your color theme:

;; Color-theme
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)

;; Set custom color theme
(defun color-theme-mine ()
  "My custom color theme"
  (interactive)
  (set-cursor-color "#ffffff")
  (color-theme-install
   '(color-theme-mine
     ;; Super-light grey on Dark grey
     ((foreground-color . "#e0e0e0")
      (background-color . "#151515")
      (background-mode . dark))

     (font-lock-comment-face ((t (:foreground "#106010")))) ;; Forest Green
     ;; More definitions below
     ;; ...
  (color-theme-mine)) ;; end eval-after-load

This will load color-them-mine when you start emacs. You can see all available color themes by typing M-x color-theme <TAB>. To see the full list of faces available, use the command M-x list-faces-display.

Spickandspan answered 12/12, 2011 at 20:28 Comment(0)
A
0

Sounds like this might be bug #4776: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4776#5. If not, consider filing a bug report for this one, using M-x report-emacs-bug.

Anselmi answered 3/1, 2012 at 22:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.