From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: multi-line conditionals in elisp Date: 22 Dec 2002 20:12:42 +0100 Organization: T-Online Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1040584581 9272 80.91.224.249 (22 Dec 2002 19:16:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 22 Dec 2002 19:16:21 +0000 (UTC) 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 18QBZl-0002Ns-00 for ; Sun, 22 Dec 2002 20:15:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18QBZT-0006Pl-09 for gnu-help-gnu-emacs@m.gmane.org; Sun, 22 Dec 2002 14:15:31 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!24.30.200.11!news-east.rr.com!news.stealth.net!news.stealth.net!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-X-Trace: news.t-online.com 1040584363 07 26506 eO6lEveGSJAdA0 021222 19:12:43 Original-X-Complaints-To: abuse@t-online.com X-Sender: 520018396234-0001@t-dialin.net X-Face: 2FEFf>]>q>2iw=B6,xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN;i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Xref: shelby.stanford.edu gnu.emacs.help:108420 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:4949 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4949 Michael Powe writes: > sorry for the dumb question, but i'm sure of the best way to do > this. i have emacs installed on several machines and would like to use > a single .emacs. it's annoying to have to maintain different ones, > and i forget sometimes that one library is installed on one machine > but not on another. > > my solution was to put a conditional in the .emacs to test for the > existence of a library before following its loading instructions. > what i'm having a problem with, is conditionals of this format: > > if (true) > do item one > do item two > do item three > ... > else > do item four > > this is trivial in other languages, but not, it seems, in elisp. (i > think it's just a case of, i don't really understand the language.) > here's what i did: > > (if (locate-library "python-mode") > (cond((autoload 'python-mode "python-mode" "Python editing mode" t) > (setq auto-mode-alist > (cons '("\\.py$" . python-mode) auto-mode-alist)))) > (message "python library not found")) That is junk. I recommend you look up progn. > nb. trivial note: on my main workstation, i maintain my dot-files in > rcs. i noted yesterday that my oldest entry in the .emacs is from > january 30, 1998. so, in a little over a month, it will be 5 years > old. that's a lot of bits & bytes through the pipe. 5 years and you don't know progn. That certainly _is_ impressive. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum