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 10:10:46 -0600 Message-ID: <3P2dnatDgO4bJnLanZ2dnUVZ8vOdnZ2d@giganews.com> 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 1206895245 2030 80.91.229.12 (30 Mar 2008 16:40:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2008 16:40:45 +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 18:41:17 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 1Jg0ao-0004fC-Pz for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Mar 2008 18:41:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jg0aD-0001ZS-29 for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Mar 2008 12:40:37 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.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 10:10:46 -0600 Original-Newsgroups: gnu.emacs.help User-Agent: Pan/0.132 (Waxed in Black) Original-Lines: 59 X-Usenet-Provider: http://www.giganews.com Original-X-Trace: sv3-iPZpmki5lWDNAuznLnj3IVn7O4WVIgfN6kNUbHacRN1fwZ0sg8Q6vZX7xZJIfwo5J/6RGAO96ZkNe6+!562aPSD80U31+Y80N0TJcioAIACT8RJdphZ9mMCKvdYj6J8+4GknvVx6JUw6PqdsC0O7mA6S 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:157478 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:52848 Archived-At: On Sun, 30 Mar 2008 16:45:57 +0200, Lennart Borgman (gmail) wrote: > The documentation should be exact enough to show that. If not then it is > a documentation bug. > > In this case it says "body forms", not "body form". A form is something > inside a pair of (). So it is ok with several functions here. > > If it was not you could have used progn for example. I'm not sure and if I'm wrong, Christian, please correct me, but: I think the problem is that Christian doesn't know what "body" means. In lisp, a function is defined using something called a lambda list, so I might define a function foo like: (defun foo (arg1 arg2 arg3) (do-some-stuff)) In this case arg1, arg2 and arg3 are three different arguments, so we'd call foo like this (foo 1 2 3) Great. However, if you want to write a useful unless function/macro, you want to allow any number of elements in the list - a bit like varargs do in C, if you know about that. Anyhow, you write something like (defun bar (arg1 &rest others) (do-some-stuff)) or (pretty much equivalently) (defun bar (arg1 &body others) (do-some-stuff)) For bar, arg1 is just a normal argument. But others is a bit magic: (bar 1 2 3 4 5 6) sets arg1 to 1 and others to (2 3 4 5 6) (a list). Now, unless is actually a macro and the bit it does next depends on a whole new can of worms based on macro expansion and ,@ but I'm not going to go into that. The main point however is that the documentation says: > -- > |unless is a Lisp macro in `subr'. > |(unless COND &rest BODY) > | > |If COND yields nil, do BODY, else return nil. > -- So the &rest bit means that body can contain as much as you like. FWIW, unless executes BODY in a progn, so for example (unless (function-returning-nil) 1 2 3) evaluates to 3. Not that that matters in this situation. Phew. That was more than I intended to write! Hope it makes things a little clearer. Rupert