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

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

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


From: Thorsten Jolitz
Subject: cl-defun not (really) working with `interactive'?
Date: Sat, 02 Aug 2014 12:07:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi List, 

function `foo1' works as expected:

#+begin_src emacs-lisp
(defun foo1 (arg1 arg2)
  (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:
: foo1

#+begin_src emacs-lisp
  (call-interactively 'foo1)
#+end_src

#+results:
: ARGS: B2

while function `foo2' seems to work

#+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?

-- 
cheers,
Thorsten




reply via email to

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