Subject: Re: bug#13625: 24.1; Enable 'package-menu-execute being non-interactive

From: Stefan Monnier <[email-masked]>
Date: Mon, 04 Feb 2013 10:13:48 -0500

>> Better would be to move those questions to the `interactive' spec, so
>> you don't even need called-interactively-p.

> Ok. I've read the Emacs Lisp Reference manual. As you told, they say
> an alternative to `called-interactively-p' is possible with
> `interactive'. Note sure if I understand it all with this example:

> (defun test (&optional print-msg)
>   (interactive "p")
>   (if print-msg
>       (message "IS INTERACTIVE")
>     (message "IS *NOT* INTERACTIVE")))

That's one option: it doesn't move the questions to the interactive
spec, but it removes the use of called-interactively-p.

What I was suggesting was more like:

  (defun test ()
    (interactive
     (if (yes-or-no-p ...) ... ...)))

but I see that it's probably not applicable to package-menu-execute.
Maybe the best option here is to add an optional `dont-query' argument.

        Stefan