[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13625: 24.1; Enable 'package-menu-execute being non-interactive
From: |
Stefan Monnier |
Subject: |
bug#13625: 24.1; Enable 'package-menu-execute being non-interactive |
Date: |
Mon, 04 Feb 2013 10:13:48 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
>> 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
bug#13625: Rép : bug#13625: 24.1; Enable 'package-menu-execute being non-interactive, Yves Baumes, 2013/02/05