all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ELisp Interactive Calls
@ 2014-12-19 20:13 mflynn
  2014-12-19 20:38 ` Yuri Khan
  2014-12-19 21:22 ` mflynn
  0 siblings, 2 replies; 3+ messages in thread
From: mflynn @ 2014-12-19 20:13 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-19 21:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19 20:13 ELisp Interactive Calls mflynn
2014-12-19 20:38 ` Yuri Khan
2014-12-19 21:22 ` mflynn

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.