From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Roland Winkler Newsgroups: gmane.emacs.help Subject: Re: Detect if Emacs is running in -nw mode Date: Sun, 30 Mar 2008 01:35:31 +0100 Organization: FAU Erlangen-Nuernberg Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206837740 30111 80.91.229.12 (30 Mar 2008 00:42:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2008 00:42:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 30 01:42:51 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JfldF-0005Ea-UL for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Mar 2008 01:42:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jflce-0008Kj-9O for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Mar 2008 20:42:08 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 15 Original-X-Trace: news.dfncis.de yqJlzdgaKQVZWpkImvbD9whte/KFnG1lSUEjju765EAERZ Cancel-Lock: sha1:ensHHW8uRz0pGtLugQh88s+wB30= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Original-Xref: shelby.stanford.edu gnu.emacs.help:157437 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52807 Archived-At: Christian Herenz 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