仅在GUI模式下运行某些Emacs init命令 [英] Run certain Emacs init commands only in GUI mode
本文介绍了仅在GUI模式下运行某些Emacs init命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种方法来运行某些命令(从init.el),只有当我处于GUI模式,而不是终端模式。当我运行GUI版本时,我想设置一个特定的配色方案,但是这个方案使终端窗口的颜色变得非常糟糕。我正在寻找一些这样的变量/函数:
(如果gui-mode(color-scheme- blah))
或:
(除非终端模式(color-scheme-blah))
(如果window-system(color-scheme-blah) )
窗口系统
可以'x
或'mswindows
或可能甚至其他值,但它总是 nil
当你在一个终端。
Is there a way to run certain commands (from init.el) only when I am in GUI mode and not in terminal mode. I want to set a certain color scheme when I run the GUI version, but that scheme screws up the terminal window's colors pretty badly. I'm looking for some variable/function which would look something like this:
(if gui-mode (color-scheme-blah))
or:
(unless terminal-mode (color-scheme-blah))
解决方案
You want something like
(if window-system (color-scheme-blah))
window-system
can be 'x
or 'mswindows
or possibly even other values, but it's always nil
when you are on a terminal.
这篇关于仅在GUI模式下运行某些Emacs init命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文