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

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

Re: cl-defun not (really) working with `interactive'?


From: Michael Heerdegen
Subject: Re: cl-defun not (really) working with `interactive'?
Date: Sun, 03 Aug 2014 20:13:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux)

Thorsten Jolitz <tjolitz@gmail.com> writes:

> #+begin_src emacs-lisp
> (defun* foo2 (&key arg1 arg2 &allow-other-keys)
>   (interactive
>     (list (ido-completing-read "ARG1: " '("A" "B" "C"))
>         (ido-completing-read "ARG2: " '("1" "2" "3"))))
>   (message "ARGS: %s%s" arg1 arg2))
> #+end_src
>
> #+results:
> : foo2
>
> #+begin_src emacs-lisp
>   (call-interactively 'foo2)
> #+end_src
>
> #+results:
> : ARGS: nilnil
>
> but does not set the argument variables. Bug or known limitation?

Neither nor, I think.  Also

  (foo2 "A" 2)

(non-interactively) prints

  "ARGS: nilnil"

Obviously, you must explicitly specify the keys to bind key arguments in
cl'ish defuns:

  (foo2 :arg1 "A" :arg2 2)

I think arguments you want to bind with `interactive' must be "standard"
arguments.


Regards,

Michael.




reply via email to

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