仅在GUI模式下运行某些Emacs init命令

aur*_*amo 10 emacs

有没有办法在我处于GUI模式而不是终端模式时运行某些命令(来自init.el).我想在运行GUI版本时设置一个颜色方案,但是这个方案搞砸了终端窗口的颜色非常糟糕.我正在寻找一些看起来像这样的变量/函数:

(if gui-mode (color-scheme-blah))
Run Code Online (Sandbox Code Playgroud)

要么:

(unless terminal-mode (color-scheme-blah))
Run Code Online (Sandbox Code Playgroud)

Kil*_*oth 19

你想要的东西

(if window-system (color-scheme-blah))
Run Code Online (Sandbox Code Playgroud)

window-system可以是'x'mswindows甚至可能是其他值,但总是nil当你在终端上时.