From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yves Baumes Newsgroups: gmane.emacs.bugs Subject: bug#13625: 24.1; Enable 'package-menu-execute being non-interactive Date: Mon, 04 Feb 2013 00:49:08 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1359937146 29674 80.91.229.3 (4 Feb 2013 00:19:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Feb 2013 00:19:06 +0000 (UTC) To: 13625@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 04 01:19:26 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U29mQ-0000ed-IU for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Feb 2013 01:19:26 +0100 Original-Received: from localhost ([::1]:39732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U29m8-0005sE-4F for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Feb 2013 19:19:08 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U29m3-0005qb-M8 for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 19:19:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U29m0-00065R-Vc for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 19:19:03 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U29m0-00065N-S3 for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 19:19:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U29n0-0008Kq-7q for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 19:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yves Baumes Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Feb 2013 00:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13625 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.135993718032002 (code B ref -1); Mon, 04 Feb 2013 00:20:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Feb 2013 00:19:40 +0000 Original-Received: from localhost ([127.0.0.1]:34688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U29md-0008K7-Ip for submit@debbugs.gnu.org; Sun, 03 Feb 2013 19:19:39 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33083) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U29mb-0008K0-DT for submit@debbugs.gnu.org; Sun, 03 Feb 2013 19:19:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U29lY-00061w-R9 for submit@debbugs.gnu.org; Sun, 03 Feb 2013 19:18:35 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:49307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U29lY-00061s-Nx for submit@debbugs.gnu.org; Sun, 03 Feb 2013 19:18:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U29lV-0005qM-0e for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 19:18:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U29lS-00061I-DJ for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 19:18:28 -0500 Original-Received: from mail-wg0-f46.google.com ([74.125.82.46]:59432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U29lS-000619-6G for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 19:18:26 -0500 Original-Received: by mail-wg0-f46.google.com with SMTP id fg15so4205350wgb.1 for ; Sun, 03 Feb 2013 16:18:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:mime-version :content-type; bh=5Xdkj+7jJxMiFPZ79BIBx2pDu9gqMu0sXMJI4IDeDq0=; b=cArxjPANdj5vGHpQEwZFFFsEI97GEAUWPStRSD40wIqCf0EBl6h03HqH8tp9GO2Top u53dFQ4+CpGHcSyDyY3yJWXBNpGCGHjx7F76RyZ8IdceyXdYdTGxei59JD1XhoT/miyk 1Zk9aMrlXkFwSgbOS8w1Y+fdFemA6EC/v4hqi43RjYQ/Axvf98S6tnHLWxDnGzAcnLCz 3OK04gJOLHkI9Ag3Tq68hqAyUcMM0hfS6YVlGft5XoT0fYMA5utotkUZcAN0GrqsQh3A 2q3YKVWjWDTNqoiUFMEzvfKNsrMFfop4hOuXU/8jD6BNFXYC7UKll4HTUTZzsaU3bc64 R8nA== X-Received: by 10.180.90.147 with SMTP id bw19mr7351151wib.28.1359935353089; Sun, 03 Feb 2013 15:49:13 -0800 (PST) Original-Received: from mac-mini-de-yves-baumes.local.localhost (rke75-2-82-66-91-208.fbx.proxad.net. [82.66.91.208]) by mx.google.com with ESMTPS id j9sm10481909wia.5.2013.02.03.15.49.11 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 03 Feb 2013 15:49:12 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:70660 Archived-At: Hi, I was trying to make a little program to upgrade automatically my packages archives. Basically something looking like that: (progn (list-packages) (with-current-buffer "*Packages*" (package-menu-mark-upgrades) (package-menu-execute) (kill-buffer))) The 'package-menu-execute implementation relies on the user to, interactively, answer yes-or-no to a question asking him to confirm he wants to upgrade the packages needing an upgrade. Well, from my point of view the implementation must be silent when called non interactively. And proceed with the packages upgrades. Here is a modification that I made that suit my needs: (defun package-menu-execute () ... (when install-list (if (or (not (called-interactively-p 'any)) (yes-or-no-p ... ;; Delete packages, prompting if necessary. (when delete-list (if (or (not (called-interactively-p 'any)) (yes-or-no-p ... Then, first, I am a newbie in Emacs Lisp modifications. Secondly, the changelog suggests that package.el has not been modified for a while ago. Since I could not believe I would be the first needing that modification in five years, I guess that I maybe wrong somewhere, and that there must be an easier way to perform what I am trying to do. Then my question is basically what is a correct behavior according to you and is my "solution" acceptable? Regards Yves