[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ELisp Interactive Calls
From: |
mflynn |
Subject: |
ELisp Interactive Calls |
Date: |
Fri, 19 Dec 2014 12:13:34 -0800 (PST) |
User-agent: |
G2/1.0 |
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
- ELisp Interactive Calls,
mflynn <=