all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* `call-interactively' and prefix args
@ 2014-06-03 12:46 Thorsten Jolitz
  2014-06-03 12:58 ` Nicolas Richard
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Jolitz @ 2014-06-03 12:46 UTC (permalink / raw)
  To: help-gnu-emacs


Hi List, 

,---------------------------------------------------------
| (call-interactively FUNCTION &optional RECORD-FLAG KEYS)
`---------------------------------------------------------

does not have an (optional) ARG argument for passing prefix args to the
called command.

#+BEGIN_SRC emacs-lisp
(defun foo (&optional arg)
  (interactive "P")
  (print arg))
#+END_SRC

#+results:
: foo

#+begin_src emacs-lisp :results output
 (call-interactively 'foo )
#+end_src

Evaluated with C-u C-c C-c the code block actually results in 

#+results:
: (4)

otherwise in nil.

So, when I have an (interactive) command cmd1 that calls a
non-interactive function fun that calls another (interactive "P")
command cmd2 with `call-interactively' - can I assume that a prefix arg
(e.g. by C-u) given before calling cmd1 will be transferred to cmd2?

-- 
cheers,
Thorsten




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

end of thread, other threads:[~2014-06-03 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-03 12:46 `call-interactively' and prefix args Thorsten Jolitz
2014-06-03 12:58 ` Nicolas Richard
2014-06-03 13:15   ` Thorsten Jolitz
2014-06-03 13:55     ` Stefan Monnier

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.