From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: conditionals in elisp Date: Mon, 26 Oct 2009 18:03:31 -0700 Message-ID: <14A45A8A6D3A42A7ADA56DE8DB68C74E@us.oracle.com> References: <87iqe1og0i.fsf@newsguy.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1256605548 25801 80.91.229.12 (27 Oct 2009 01:05:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Oct 2009 01:05:48 +0000 (UTC) To: "'Harry Putnam'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 27 02:05:40 2009 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 1N2aVD-0003hl-Ge for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Oct 2009 02:05:35 +0100 Original-Received: from localhost ([127.0.0.1]:34318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2aVC-0001A9-QO for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Oct 2009 21:05:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N2aUn-00018h-QX for help-gnu-emacs@gnu.org; Mon, 26 Oct 2009 21:05:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N2aUh-00017r-P6 for help-gnu-emacs@gnu.org; Mon, 26 Oct 2009 21:05:08 -0400 Original-Received: from [199.232.76.173] (port=44639 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2aUh-00017j-II for help-gnu-emacs@gnu.org; Mon, 26 Oct 2009 21:05:03 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:26256 helo=rgminet12.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N2aUg-0007JA-SP for help-gnu-emacs@gnu.org; Mon, 26 Oct 2009 21:05:03 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n9R14V53021281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 27 Oct 2009 01:04:33 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n9QNX0Gu020410; Tue, 27 Oct 2009 01:06:11 GMT Original-Received: from abhmt021.oracle.com by acsmt354.oracle.com with ESMTP id 20632662081256605420; Mon, 26 Oct 2009 18:03:40 -0700 Original-Received: from dradamslap1 (/24.5.184.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 26 Oct 2009 18:03:40 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcpWmawNv0ihIH/HSwyc5P8ItYs+QQABM5+w In-Reply-To: <87iqe1og0i.fsf@newsguy.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt357.oracle.com [141.146.40.157] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.4AE64737.00A2:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:69262 Archived-At: > I'm hoping someone will be kind enough to demonstrate a couple of > brief conditionals in elisp... if and if else. We are plenty kind enough. Kindness is not the problem. > This may be a chintzy way to do it but I really do not want to pound > away at elisp intro and the elisp manual for hours. You're exaggerating. Did you even try "pounding away" at it for the 2 minutes it took you to write your question and mail it? > That's when I bumped into my ignorance, realizing I had no idea how to > write simple conditionals that would do this: (over verbosified for > clarity) > > (load-library "server") > (setq server-name "name") > if (! server-mode-enabled){ > (server-mode) > } There's no shame in ignorance. Laziness is another matter. 1. Don't waste people's time here if you are unwilling to even look up `if' or `conditional' in the Elisp manual. That's ridiculous. 2. Learn to find your way around Emacs _before_ trying to learn Emacs Lisp. This means learning, at a minimum, `C-h i', then `i' in a manual to look things up in the index. 3. There is no substitute for this. No matter how much people here try to "help" you, you will waste your _own_ time if you don't learn how to _ask Emacs_. And sooner or later, people here will tire of answering, if they see you making zero effort. Here's how hard it is: 1. `C-h i' 2. Click the link to the `Elisp' manual. 3. `i', then `if', then Enter. 4. Read one page of doc about `Conditionals'. Can you handle that? If you only partially understand what you read, try something based on what you think you understand: `M-:', then type some expression you think might work, from what you read. Emacs and Emacs Lisp are 100% interactive - you get immediate feedback. Best way to learn. If you don't understand what you read at all, and you need more help, ask here. There's no shame in asking, ever. But for your _own_ sake, learn to interact with Emacs itself. You will not regret it. The best rule, for _you_, is this: _ask Emacs_. It's the best rule in the long run, because it will mean that your questions here will be more informed, which means people will be more willing to help you. HTH.