[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Elisp: Simple function to Add Two Numbers
From: |
Magnus Henoch |
Subject: |
Re: Elisp: Simple function to Add Two Numbers |
Date: |
Sun, 27 Aug 2006 23:55:55 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (berkeley-unix) |
Edward Dodge <user@foo.bar> writes:
> Why do I get "wrong number of arguments" every time I try to run this simple,
> straight-forward code?
>
> (defun ekd-average (jabba wabba)
> "Adds two numbers and returns the sum."
> (interactive "nFirstvar: \nn Secondvar: \nr")
> ( + jabba wabba))
The trailing "r" in the interactive string means to give the region as
argument to the function, in the form of two integers telling the
beginning and the end. Remove "\nr" in the end, and the function will
work.
Magnus
Re: Elisp: Simple function to Add Two Numbers, David Kastrup, 2006/08/27