From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rupert Swarbrick Newsgroups: gmane.emacs.help Subject: Re: Detect if Emacs is running in -nw mode Date: Sun, 30 Mar 2008 06:23:43 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1206877272 16388 80.91.229.12 (30 Mar 2008 11:41:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2008 11:41:12 +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 13:41:44 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 1Jfvux-0006z8-1E for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Mar 2008 13:41:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfvuL-0000TW-AW for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Mar 2008 07:41:05 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Sun, 30 Mar 2008 06:23:43 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Pan/0.132 (Waxed in Black) Original-Lines: 55 X-Usenet-Provider: http://www.giganews.com Original-X-Trace: sv3-sz3mBP+wXmLnccA03tqkkgT+LXDIquM+D7WGk3N+x9x1a4THmmwFubDpkLdtHjP28HPLBO3aupI332z!Rbcg5Upexem/8o5CCFiTziClE0g6pgLZhEormaTdQFQ3qMJtx9UXQ/hL/Ald+4NxZxc9RH2i Original-X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.37 Original-Xref: shelby.stanford.edu gnu.emacs.help:157459 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:52828 Archived-At: On Sun, 30 Mar 2008 03:22:55 +0200, Christian Herenz wrote: > Will Parsons schrieb: > >>> There is (not ...) ;-) >>> >>> (when (not (window-system)) >>> ...) >> >> Or how about (unless ...) >> >> (unless (window-system) >> ...) >> >> > So... That should do the trick. One last question, i assume that > window-system can either be true or false. I searched the help for a > variable called window-system but I found no explanation? Where do I > have to search for emacs "system-variables"? > > Greets and thanks, > Christian Hi, Two things: 1) In lisp, something referenced like (window-system) is a function (unless you're in a weird macro, but let's ignore that) and the statement `` (window-system) '' means call the function called window-system with no arguments and evaluate to the result(s). In emacs, looking up functions is different from variables, and you need to check C-h f (it has tab completion, just like C-h v). The reason that there are two different look-up commands is that in any lisp-2 (which includes elisp), there are two different lists of symbols: one for functions and one for variables. Thus I could have a function called x and also a variable called x and (+ 1 x) and (x "foo") would both do the right thing. Starting "(" tells the lisp reader that the next symbol name it's looking at is going to be a function. 2) However, there was actually a typo from Tom Rauchenwald's answer - in fact is *is* a variable called window-system (I just fired up emacs to check) You might want to try C-h v window-system to read the docs for it. And your code would be: (unless window-system (menu-bar-mode -1)) Hope this helps! Rupert