开发者

emacsclient unable to load color "unspecified-bg"

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")))))


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜