From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Elisp: Simple function to Add Two Numbers Date: Sun, 27 Aug 2006 21:50:57 -0400 Organization: Symantec Message-ID: References: <87u03xhmvy.fsf@mail.com> <87k64tsv1f.fsf@thalassa.informatimago.com> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1156732861 6768 80.91.229.2 (28 Aug 2006 02:41:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Aug 2006 02:41:01 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 28 04:41:00 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GHX3U-0007uS-Bh for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Aug 2006 04:40:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GHX3T-0004UP-UD for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Aug 2006 22:40:51 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Sun, 27 Aug 2006 20:50:57 -0500 Original-Newsgroups: gnu.emacs.help Mail-Copies-To: nobody User-Agent: MT-NewsWatcher/3.5.2 (PPC Mac OS X) X-Copies-To: never Original-Lines: 37 Original-NNTP-Posting-Host: 24.34.108.171 Original-X-Trace: sv3-nH0oIKckDKUNfvePK4xT33CjxlHWncwlmuojM2GLzNvl2BVggSh3ABGlvm9R0U7nI1pwZZqcXmC1UUM!6imFRX3a3y7tBn/o2cQD5QcdwkNfxGS+hcy7x0oHQDNkMqMBjyUq0YzT916Z+qYJpOQJjNw/Xppl!+8pOI89gnAwcH0wnhPfmaxLDk0AtG5K2SA== Original-X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net 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.32 Original-Xref: shelby.stanford.edu gnu.emacs.help:141356 Original-To: help-gnu-emacs@gnu.org 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:36976 Archived-At: In article , Edward Dodge wrote: > Pascal Bourguignon writes: > > > > The whitespaces don't matter, as long as they're not just after a > > newline. The problem is that there are two newlines with three > > characters specifying a total of four interactive arguments: n, n and r. > > (r gives two arguments, start and end of region). > > Yes, this is correct. And I have managed to keep the function from causing > an error by rewriting it: > > (defun ekd-average (jabba wabba) > "Adds two numbers and returns the difference between" > (interactive "nFirstvar: \nnSecondvar: ") > (eval ( + jabba wabba))) You don't need eval. > > Now the only problem is this: it returns no answer when I run it. I thought > lisp functions always returned a value. I even made it explicit by using the > "eval" statement, but still I get no answer in either the minibuffer or > *Messages*. Yes, the function returns a value. But your command never displays the value anywhere, and M-x doesn't automatically display the return value of functions. Use (print (+ jabba wabba)) and it will be displayed in the echo area. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***