emacsclient无法加载颜色"unspecified-bg"

heu*_*cus 10 emacs emacs-faces

Unable to load color "unspecified-bg" [16 times]在使用时遇到错误emacsclient -c.我已经开始使用emacs了emacs --daemon.这似乎意味着我的自定义面将无法加载.

像往常一样启动emacs,然后使用时M-x server-start,这个问题根本不会发生.如何emacsclient -c正确加载面部?

这是相关的代码:

(custom-set-faces'(默认(((((((((((((((((((正常:重量正常:高度120:宽度正常:铸造厂"未知":家庭"Inconsolata")))))

Mik*_*ols 1

我不能 100% 确定这会解决您的问题,但您确实应该使用颜色主题进行语法突出显示。Custom 适用于 emacs 新手,因此我建议您尝试 color-theme 并看看它是否有效。以下是我在我的机器上的设置方法:

  1. 从颜色主题主页下载软件包。
  2. 将颜色主题文件夹放在类似~/.emacs.d/color-theme/.
  3. 确保此文件夹位于您的加载路径中。我从 Steve Yegge 的帖子中获取了以下代码:

在你的 .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)
Run Code Online (Sandbox Code Playgroud)

然后定义你的颜色主题:

;; 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
Run Code Online (Sandbox Code Playgroud)

这将在您启动 emacs 时加载color-them-mine。您可以通过输入查看所有可用的颜色主题M-x color-theme <TAB>。要查看可用面孔的完整列表,请使用命令M-x list-faces-display