all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Yves Baumes <ybaumes@gmail.com>
Cc: 13625@debbugs.gnu.org
Subject: bug#13625: 24.1; Enable 'package-menu-execute being non-interactive
Date: Mon, 04 Feb 2013 10:13:48 -0500	[thread overview]
Message-ID: <jwvehgwjfln.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E451E366-F57B-46C5-8549-668E40A1740B@gmail.com> (Yves Baumes's message of "Mon, 4 Feb 2013 12:18:29 +0100")

>> 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





  reply	other threads:[~2013-02-04 15:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-03 23:49 bug#13625: 24.1; Enable 'package-menu-execute being non-interactive Yves Baumes
2013-02-04  3:39 ` Stefan Monnier
2013-02-04 11:18   ` Yves Baumes
2013-02-04 15:13     ` Stefan Monnier [this message]
2013-02-04 17:59       ` Yves Baumes
2013-02-04 19:44         ` Stefan Monnier
2013-02-04 22:09           ` Yves Baumes
2013-02-05 16:38 ` bug#13625: Rép : " Yves Baumes
2013-02-13  5:01   ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvehgwjfln.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=13625@debbugs.gnu.org \
    --cc=ybaumes@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.