From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Michael Powe Newsgroups: gmane.emacs.help Subject: Re: multi-line conditionals in elisp Date: Sun, 22 Dec 2002 22:48:26 GMT Organization: The Hospice of the Mind Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1040597392 11396 80.91.224.249 (22 Dec 2002 22:49:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 22 Dec 2002 22:49:52 +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 18QEut-0002xc-00 for ; Sun, 22 Dec 2002 23:49:51 +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 18QEvP-000260-0C for gnu-help-gnu-emacs@m.gmane.org; Sun, 22 Dec 2002 17:50:23 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!netaxs.com!newsread.com!newsprint.netaxs.com!207.8.186.126.MISMATCH!POSTED.newshog.newsread.com!not-for-mail Original-Newsgroups: gnu.emacs.help X-Newsreader: Gnus v5.8.8/Emacs 20.7.2 [Linux 2.2.16] X-Home-Page: http://www.trollope.org Original-Lines: 50 Cache-Post-Path: gaspra.spiretech.com!unknown@slip-32-100-239-210.ca.us.prserv.net X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) Original-NNTP-Posting-Host: 207.173.200.229 Original-X-Complaints-To: Abuse Role , We Care Original-X-Trace: newshog.newsread.com 1040597306 207.173.200.229 (Sun, 22 Dec 2002 17:48:26 EST) Original-NNTP-Posting-Date: Sun, 22 Dec 2002 17:48:26 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:108426 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:4955 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4955 >>>>> "David" == David Kastrup writes: David> 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")) David> 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. David> 5 years and you don't know progn. That certainly _is_ David> impressive. well, i'm ignorant and you are a jerk. which one of us is worse off? hint: i don't think it's me. i can learn what i don't know, but you can never change your character. thank you very little for taking time out of your busy day to ridicule me. mp -- Michael Powe Waterbury, CT ------------------------------------------------------------- "The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in. We're computer professionals. We cause accidents." -- Nathaniel Borenstein