gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 09:57:28 27 4
gpt4 key购买 nike

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

(load-theme 'sanityinc-tomorrow-eighties)

但是它也要求我确认这将加载一些 lisp 代码,我该如何关闭此确认?

最佳答案

使用 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在这里问这么简单的事情之前,你至少应该知道和使用它。

关于emacs - 在没有交互模式的情况下在启动时设置 emacs 主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22977387/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com