[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ELisp Interactive Calls
From: |
mflynn |
Subject: |
Re: ELisp Interactive Calls |
Date: |
Fri, 19 Dec 2014 13:22:11 -0800 (PST) |
User-agent: |
G2/1.0 |
On Friday, December 19, 2014 12:13:36 PM UTC-8, mfl...@scu.edu wrote:
> After all these years I'm trying to teach myself how to write Emacs Lisp
> programs.
>
> To call this function:
>
> (defun my-test-function (arg1)
> "DOC: Multiply two numbers."
> (interactive "p")
> (message "The square of the arg is: %d" (* arg1 arg1))
> )
>
>
> I type:
> Ctrl-U 8 Esc-x my-test-function
>
> and 64 is printed, as I would expect.
>
> But I'm not sure how to supply two args interactively.
>
> (defun my-test-function (arg1 arg2)
> "DOC: Multiply two numbers."
> (interactive "p p")
> (message "The product of the args is: %d" (* arg1 arg2))
> )
>
> How do I call this? If I type Ctrl-U 8 8 Esc-x my-test-function
>
> the call fails with a Wrong number of args message. The second 8 I type
> just shows up in the scratch buffer.
>
> Thanks
This is great. Thank you.