emacsclient无法加载颜色“unspecified-bg”。

11
当我使用emacsclient -c命令时,出现了无法加载颜色“unspecified-bg”[16次]的错误。我已经使用emacs --daemon启动了emacs。这似乎意味着我的自定义面板不会加载。
通常情况下,当启动emacs并使用M-x server-start时,就不会出现这个问题。我该如何让emacsclient -c正确加载面板?
以下是相关代码:
(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")))))

我尝试通过在初始化守护程序后手动自定义面来解决这个问题。我启动一个emacs客户端,然后在其中使用M-x customize-face RET default来打开默认面。那里的值似乎没有改变。如果我更改它们,然后保存所有会话,我可以启动使用这些设置的新客户端窗口。然而,如果我重新启动emacs守护进程,我会得到通常的错误。奇怪的是,因为所有编辑面似乎只是编辑.emacs,以便它包含新的设置。 - heuristicus
2个回答

1

我不能百分之百确定这会解决你的问题,但是你真的应该使用color-theme来进行语法高亮。自定义选项更适合Emacs入门用户,所以我建议你尝试一下color-theme并看看它是否适用。这是我在我的机器上设置的方法:

  1. color-theme主页下载包。
  2. 将color-theme文件夹放在某个地方,例如〜/ .emacs.d/color-theme /
  3. 确保此文件夹在您的load-path中。 我从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)

然后你定义你的颜色主题:

;; 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

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


0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接