help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detect if Emacs is running in -nw mode


From: Roland Winkler
Subject: Re: Detect if Emacs is running in -nw mode
Date: Sun, 30 Mar 2008 01:35:31 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Christian Herenz <herenz@physik.hu-berlin.de> writes:
> Is there something when NOT, so that I could set
> [PSEUDO-CODE]:
> (when not (window-system)
>       (menu-bar-mode nil)
>       (other commands i want to use when not windowed))

You can test whether the DISPLAY environment variable is set using

(getenv "DISPLAY")

In this way you can distinguish between emacs -nw running in an X
or a "pure tty" environment. Is that what you want?

Roland


reply via email to

[Prev in Thread] Current Thread [Next in Thread]