emacsclient 不评估颜色主题?

发布于 2024-10-25 14:32:43 字数 723 浏览 1 评论 0原文

当我启动时,我启动 emacs --daemon 它评估我的 .emacs ,但有一个例外:

(add-to-list 'load-path "~/.elisp/zenburn-emacs") ;修复加载问题

(需要“zenburn”)

;;;颜色主题 - zenburn?

(添加到列表'加载路径“~/.elisp/color-theme”)

(需要“颜色主题”)

(加载后评估“颜色主题” '(程序 (颜色主题初始化)))

我知道加载路径的东西可以工作,因为一旦我使用 emacsclient -nw 启动 emacsclient,Mx zenburn 就可以很好地加载配色方案。

有谁知道 (eval-after-load [snip - 见上文]) 发生了什么?

这是一个错误吗?

系统信息:

GNU Emacs 23.2.1

安装在 debian sid on2.6.32-5-amd64 版本:23.2+1-7

文件名:pool/main/e/emacs23/emacs23_23.2+1-7_amd64.deb

When I boot I launch emacs --daemon
and it evaluates my .emacs with one exception:

(add-to-list 'load-path "~/.elisp/zenburn-emacs") ;fix loading issue

(require 'zenburn)

;;; color theme - zenburn?

(add-to-list 'load-path "~/.elisp/color-theme")

(require 'color-theme)

(eval-after-load "color-theme"
'(progn
(color-theme-initialize)))

I know that the load-path stuff works because M-x zenburn loads the color scheme just fine once I launch emacsclient with emacsclient -nw.

Does anybody know what is up with (eval-after-load [snip - see above])?

Is this a bug?

System Info:

GNU Emacs 23.2.1

Installed in debian sid on2.6.32-5-amd64 Version: 23.2+1-7

Filename: pool/main/e/emacs23/emacs23_23.2+1-7_amd64.deb

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

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

发布评论

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

评论(5

等往事风中吹 2024-11-01 14:32:43

来自 Zenburn for Emacs 的当前维护者的提示(真正的):

(add-to-list 'load-path "~/.elisp/color-theme")
(add-to-list 'load-path "~/.elisp/zenburn-emacs")
(require 'zenburn)
(zenburn)

您不需要需要颜色主题,因为 zenburn 在内部需要它。但是,您确实需要在需要 zenburn 后调用 zenburn 函数。

当您键入 Mx zenburn 时,您实际上是在调用 (zenburn) 函数,这就是主题在此时而不是在启动时应用的原因。

And a tip from the current maintainer of Zenburn for Emacs(yours truly):

(add-to-list 'load-path "~/.elisp/color-theme")
(add-to-list 'load-path "~/.elisp/zenburn-emacs")
(require 'zenburn)
(zenburn)

You don't need to require color-theme since zenburn requires it internally. You do need, however, to call the zenburn function after you've required zenburn.

You're actually invoking the (zenburn) function when you type M-x zenburn and this is why the theme is getting applied just then instead of on startup.

獨角戲 2024-11-01 14:32:43

你真的不说什么不起作用吗?

(require 'zenburn) 不足以启动主题。
您还需要调用 (color-theme-zenburn) (或其别名 (zenburn),就像您以交互方式进行的那样)。

You don't really say what isn't working?

(require 'zenburn) isn't enough to start the theme.
You need to call (color-theme-zenburn) as well (or its alias (zenburn), as you are doing interactively).

胡大本事 2024-11-01 14:32:43

FWIW,这是我在 .emacs 中加载 zenburn 的方法:

(require 'zenburn)
(zenburn)

通过 emacsclient 加载正常。

FWIW, here's how I load zenburn in my .emacs:

(require 'zenburn)
(zenburn)

Loads fine via emacsclient.

沫雨熙 2024-11-01 14:32:43

对于评论来说这太长了:

我在我的 .emacs 文件中有以下行:

(setq default-frame-alist '((font . "Inconsolata-20") (tool-bar-lines . 0) (menu-bar-lines . 0)))

如果我把它放在

(color-theme-taylor)

这一行后面,它就可以工作,如果我把它放在这一行之前,它就不能工作。

(require 'color-theme)
(color-theme-initialize)    

(setq default-frame-alist '((font . "Inconsolata-20") (tool-bar-lines . 0) (menu-bar-lines . 0)))

(color-theme-taylor)

有效...也许你的问题可能有类似的原因...

This is too long for a comment:

I have in my .emacs file the following line:

(setq default-frame-alist '((font . "Inconsolata-20") (tool-bar-lines . 0) (menu-bar-lines . 0)))

If I put for example

(color-theme-taylor)

after this line it works, if I put it before this line, it doesn't.

I.e.

(require 'color-theme)
(color-theme-initialize)    

(setq default-frame-alist '((font . "Inconsolata-20") (tool-bar-lines . 0) (menu-bar-lines . 0)))

(color-theme-taylor)

works... perhaps your problem may have a similar cause...

生生不灭 2024-11-01 14:32:43

(progn (require 'color-theme) (color-theme-initialize)) 之类的东西应该可以工作。要查看 (eval-after-load "color-theme" '(progn (color-theme-initialize))) 执行其应该执行的操作,请检查 color-theme-initialize 附加到 after-load-alist (describe-variable Ch v)。如果没有,这可能是一个错误。

Something like (progn (require 'color-theme) (color-theme-initialize)) should work. To see (eval-after-load "color-theme" '(progn (color-theme-initialize))) does what it should do, check if color-theme-initialize is appended to after-load-alist (describe-variable C-h v). If not, it could be a bug.

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