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

发布于 2024-10-15 02:21:05 字数 500 浏览 5 评论 0原文

使用 emacsclient -c 时,我收到错误无法加载颜色“unspecified-bg”[16 次]。我已经使用 emacs --daemon 启动了 emacs。这似乎意味着我的自定义面孔将无法加载。

当像平常一样启动emacs,然后使用Mx 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 :下划线无:倾斜正常:重量正常:高度120:宽度正常:铸造厂“未知”:家庭“Inconsolata”)))))

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

若无相欠,怎会相见 2024-10-22 02:21:05

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

  1. color-theme 主页 下载软件包。
  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 。您可以通过输入 Mx color-theme 查看所有可用的颜色主题。要查看可用面孔的完整列表,请使用命令Mx list-faces-display

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.

笑饮青盏花 2024-10-22 02:21:05

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文