emacsclient 不评估颜色主题?
当我启动时,我启动 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
来自 Zenburn for Emacs 的当前维护者的提示(真正的):
您不需要需要颜色主题,因为 zenburn 在内部需要它。但是,您确实需要在需要 zenburn 后调用 zenburn 函数。
当您键入 Mx zenburn 时,您实际上是在调用 (zenburn) 函数,这就是主题在此时而不是在启动时应用的原因。
And a tip from the current maintainer of Zenburn for Emacs(yours truly):
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.
你真的不说什么不起作用吗?
(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).FWIW,这是我在 .emacs 中加载 zenburn 的方法:
通过 emacsclient 加载正常。
FWIW, here's how I load zenburn in my .emacs:
Loads fine via emacsclient.
对于评论来说这太长了:
我在我的
.emacs
文件中有以下行:如果我把它放在
这一行后面,它就可以工作,如果我把它放在这一行之前,它就不能工作。
即
有效...也许你的问题可能有类似的原因...
This is too long for a comment:
I have in my
.emacs
file the following line:If I put for example
after this line it works, if I put it before this line, it doesn't.
I.e.
works... perhaps your problem may have a similar cause...
像
(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 ifcolor-theme-initialize
is appended toafter-load-alist
(describe-variable
C-h v
). If not, it could be a bug.