From: Thorsten Jolitz <tjolitz@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Possible to access previous arg in `interactice' call?
Date: Sat, 02 Aug 2014 14:15:47 +0200 [thread overview]
Message-ID: <8738dff5os.fsf@gmail.com> (raw)
Hi List,
in this example, is there a way to access num1 while reading num2?
#+begin_src emacs-lisp
(defun foo (num1 num2)
(interactive
(list
(read-number "Num1: ")
(+ (read-number "Num2: ") num1)))
(message "num1: %s\nnum2: %s" num1 num2))
#+end_src
#+results:
: foo
#+begin_src emacs-lisp
(call-interactively 'foo)
#+end_src
-> list: Symbol's value as variable is void: num1
--
cheers,
Thorsten
next reply other threads:[~2014-08-02 12:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-02 12:15 Thorsten Jolitz [this message]
2014-08-02 16:29 ` Possible to access previous arg in `interactice' call? Drew Adams
2014-08-02 17:36 ` Thorsten Jolitz
[not found] ` <mailman.6474.1407001032.1147.help-gnu-emacs@gnu.org>
2014-08-02 20:57 ` Pascal J. Bourguignon
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8738dff5os.fsf@gmail.com \
--to=tjolitz@gmail.com \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).