help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `call-interactively' and prefix args


From: Thorsten Jolitz
Subject: Re: `call-interactively' and prefix args
Date: Tue, 03 Jun 2014 15:15:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:

> Thorsten Jolitz <tjolitz@gmail.com> writes:
>> 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?
>
> current-prefix-arg is used. If cmd1 changes it, anything can happen.
>
> e.g.
>
> (global-set-key (kbd "<f6>") (lambda () (interactive) (yffoo)))
> (defun yffoo () (setq current-prefix-arg '(5)) (call-interactively 'yfbar))
> (defun yfbar (&optional arg) (interactive "P") (message "arg is %S" arg))
>
> hitting f6 will show that arg is (5) (which doesn't make sense in an
> true interactive call)

Ok, thanks! Then misbehaviour must be coded explicitly, otherwise things
should work as expected ... what is good. 

-- 
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]