From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Florian von Savigny Newsgroups: gmane.emacs.help Subject: trouble writing a conditional, or with lambda Date: 24 May 2003 18:09:26 +0200 Organization: Linux Private Site Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1053789535 15382 80.91.224.249 (24 May 2003 15:18:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 24 May 2003 15:18:55 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Sat May 24 17:18:52 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19JanM-0003za-00 for ; Sat, 24 May 2003 17:18:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Jap2-0005Ab-Gs for gnu-help-gnu-emacs@m.gmane.org; Sat, 24 May 2003 11:20:36 -0400 Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-NNTP-Posting-Host: pd9506f44.dip0.t-ipconnect.de Original-X-Trace: online.de 1053789594 25192 217.80.111.68 (24 May 2003 15:19:54 GMT) Original-X-Complaints-To: abuse@einsundeins.com Original-NNTP-Posting-Date: Sat, 24 May 2003 15:19:54 +0000 (UTC) X-Newsreader: Gnus v5.7/Emacs 20.6 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-ulm.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail Original-Xref: shelby.stanford.edu gnu.emacs.help:113654 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10150 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10150 Sigh ... some basic lisp, I'm afraid, but I did consult the manual and tested in lisp-interaction-mode, but did not get any the wiser. I'm trying to get a function to work differently depending on whether emacs runs under X or on a terminal: (if (eq window-system nil) ; running under a terminal (lambda () (split-window) (switch-to-buffer "*foo*") ) ; running under a window system (lambda () (select-frame (make-frame)) (set-frame-size (selected-frame) 50 24) (set-frame-position (selected-frame) 150 120) )) It seems that everything in the lambda expressions is ignored (i.e. nothing happens). I used these lambda expressions because simply putting a body of functions got error messages about "Invalid function"s. But it seems I don't get these right. (lambda ( (split-window) (switch-to-buffer "*foo*") )) also seems to be valid syntax, but is also ignored. Can anybody help how to get this simple conditional to work? -- Florian v. Savigny If you are going to reply in private, please be patient, as I only check for mail something like once a week. - Si vous allez répondre personellement, patientez s.v.p., car je ne lis les courriels qu'environ une fois par semaine.