[问题] 怎样判断emacs是在X下还是在终端运行?

Vim、Emacs配置和使用
回复
头像
5451vs5451
帖子: 345
注册时间: 2006-07-14 18:56
来自: Apple Valley, Planet Tux, Linux System

[问题] 怎样判断emacs是在X下还是在终端运行?

#1

帖子 5451vs5451 »

我现在是用TERM环境变量来判断的,但是存在一个问题,就是在gnome-terminal下不带-nw启动emacs时,虽然是用的X,但TERM的值仍然是xterm。不知道有没有更好的办法。
herberteuler
帖子: 45
注册时间: 2007-01-27 14:11

#2

帖子 herberteuler »

代码: 全选

(if window-system
    (progn 'in-window-system)
  'not-in-window-system)
头像
5451vs5451
帖子: 345
注册时间: 2006-07-14 18:56
来自: Apple Valley, Planet Tux, Linux System

#3

帖子 5451vs5451 »

太好了,谢谢 :o
头像
poplarc
帖子: 43
注册时间: 2007-01-20 22:20
来自: 深圳

#4

帖子 poplarc »

啊,也正在为这个问题着迷。
谢谢。 :D
回复