在没有交互模式的情况下在启动时设置emacs主题

时间:2014-04-10 02:05:12

标签: emacs elisp

我正在使用以下代码段在Emacs启动时设置主题。

(load-theme 'sanityinc-tomorrow-eighties)

然而,它还要求我确认这将加载一些lisp代码,如何关闭此确认?

1 个答案:

答案 0 :(得分:6)

load-theme与非零NOCONFIRM arg。

一起使用

C-h f load-theme告诉您(load-theme 'sanityinc-tomorrow-eighties t)应该加载主题而不要求确认:

,----
| load-theme is an interactive compiled Lisp function in `custom.el'.
| 
| (load-theme THEME &optional NO-CONFIRM NO-ENABLE)
| 
| Load Custom theme named THEME from its file.
| The theme file is named THEME-theme.el, in one of the directories
| specified by `custom-theme-load-path'.
| 
| If the theme is not considered safe by `custom-safe-themes',
| prompt the user for confirmation before loading it.  But if
| optional arg NO-CONFIRM is non-nil, load the theme without
| prompting.
| 
| Normally, this function also enables THEME.  If optional arg
| NO-ENABLE is non-nil, load the theme but don't enable it, unless
| the theme was already enabled.
| 
| This function is normally called through Customize when setting
| `custom-enabled-themes'.  If used directly in your init file, it
| should be called with a non-nil NO-CONFIRM argument, or after
| `custom-safe-themes' has been loaded.
| 
| Return t if THEME was successfully loaded, nil otherwise.
`----

您应该学习 首先询问Emacs 。在问这么简单的事情之前,C-h f是你应该知道和使用的最少的。