all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: mflynn@scu.edu
To: help-gnu-emacs@gnu.org
Subject: ELisp Interactive Calls
Date: Fri, 19 Dec 2014 12:13:34 -0800 (PST)	[thread overview]
Message-ID: <f222a1d9-a29b-41f3-8d44-c0564e1bacb3@googlegroups.com> (raw)

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




             reply	other threads:[~2014-12-19 20:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19 20:13 mflynn [this message]
2014-12-19 20:38 ` ELisp Interactive Calls Yuri Khan
2014-12-19 21:22 ` mflynn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f222a1d9-a29b-41f3-8d44-c0564e1bacb3@googlegroups.com \
    --to=mflynn@scu.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.