【问题标题】:emacsclient unable to load color "unspecified-bg"emacsclient 无法加载颜色“unspecified-bg”
【发布时间】:2011-06-17 21:35:26
【问题描述】:

我在使用emacsclient -c 时收到错误Unable to load color "unspecified-bg" [16 times]。我已经使用 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零:倾斜正常:体重正常:高度120:宽度正常:铸造“未知”:家庭“Inconsolata”)))))

【问题讨论】:

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

标签: emacs emacs-faces


【解决方案1】:

我不能 100% 确定这会解决您的问题,但您确实应该使用 color-theme 来突出显示语法。 Custom 是为刚开始使用 emacs 的用户设计的,所以我建议你试试 color-theme 看看它是否有效。这是我在我的机器上设置它的方法:

  1. color-theme homepage下载包。
  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)

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

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

【讨论】:

    【解决方案2】:

    听起来可能是错误 #4776:http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4776#5。如果没有,请考虑使用M-x report-emacs-bug 提交一份错误报告。

    【讨论】:

      猜你喜欢
      • 2012-01-02
      • 1970-01-01
      • 1970-01-01
      • 2019-04-06
      • 2011-06-01
      • 1970-01-01
      • 2010-11-17
      • 1970-01-01
      • 2020-12-01
      相关资源
      最近更新 更多