From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Let `package-install-selected-packages' install packages without asking for confirmation. Date: Fri, 16 Jul 2021 22:01:48 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25825"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 16 16:02:33 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4OQC-0006XP-KL for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 16 Jul 2021 16:02:32 +0200 Original-Received: from localhost ([::1]:56938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4OQA-0005sz-Nc for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 16 Jul 2021 10:02:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4OPn-0005sl-Ky for help-gnu-emacs@gnu.org; Fri, 16 Jul 2021 10:02:07 -0400 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:46710) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4OPk-0006TU-M1 for help-gnu-emacs@gnu.org; Fri, 16 Jul 2021 10:02:07 -0400 Original-Received: by mail-lf1-x135.google.com with SMTP id x25so16141904lfu.13 for ; Fri, 16 Jul 2021 07:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=rUu/Pm2r5jFahX7MkcspqCSiDiWAqa9NJXPdAqHjvKE=; b=CiCPCGwSaY7deF+gGZtN3NpC0DJEFikNsXoXOgbWBgMv9sJ7uRb0RFJmJ1PzeD/mG+ Mj5zqd5sDh8hc9pT+UbeGGt8NliaBWFXD+vdqNZcdzHLBbgqr3jMyVvOxMO+HYTa4jSK siR1CCIB+VP2evaHi/JSVXa2SjcWkNaUeNE6VnhUMVYbJR7EmLpVhLOhDfPF3DH/BYH2 rSGeU8SuR5Kfq1orM5/IEQQKdPtP/1jBHfRS4TteX5dugnNwi48rS7OOdYNwsuu3fdqi F4Zj5eO5e6DIKFOOrHYU8DlgrCgpypvdPVf8MMhkYoXZeYGTYw91W9OlrTaNAZXcSEf0 1KnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rUu/Pm2r5jFahX7MkcspqCSiDiWAqa9NJXPdAqHjvKE=; b=EFKQym5CkWoAbIi0a0ARpE7KBlcGfYapBvjKFzXPyqe1rh0JQGBjs/l3XO349pEXSb qhDO7Rp6AJC0K9XDyE9JybwV6B6+MRr+HGgyLPIjfY9OszbUpBPMTMl0w1sI+se59owZ i0mTEMRQ+/TMTYAWwibI+0WegRrmwQBvmV2X1/Ei4x6eB32knSfDUmcvOdJidluxbAIp zgql3DpD37LM1XCXsswceR1fRkQB+8vrcYt6a6dpFYZs0TFsJIgcTVp+glXn58g2iOxX 41PQftwNXd8QBO6vXnUY1XBPu4JnlClnaXT0LLhaIlOF/HwYwp4bg8+vhDyLpmal7RtK 90LQ== X-Gm-Message-State: AOAM533clcvn+/8rtUQq+Q34uKraAG7l6VauBujSzDw6PstOqZJgRwby 5qX59aZ0JQJKvHkwb+oHlGFhXL+3x+kkb+r3pMLA62XOY6POKGN2FS8= X-Google-Smtp-Source: ABdhPJxASPZIf48w8VY/a39xVLbK1a5yDF9j2hEb4hWpCxIf0Q4JvEy5ISrwkWnwbrCXbzIXdqREE5begmcDk4HufbY= X-Received: by 2002:a19:6452:: with SMTP id b18mr7925894lfj.545.1626444119829; Fri, 16 Jul 2021 07:01:59 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=hongyi.zhao@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:131748 Archived-At: I use the following init file: ``` ;https://emacs.stackexchange.com/questions/34180/how-can-i-script-emacs-to-install-packages-from-list ;https://stackoverflow.com/questions/10092322/how-to-automatically-install-emacs-packages-by-specifying-a-list-of-package-name (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (package-initialize) (setq package-selected-packages '(company async)) (package-install-selected-packages) (unless package-archive-contents (package-refresh-contents)) (package-install-selected-packages t) ``` But when I start Emacs, it still asks me to confirm the installation of the packages. See the following info shown in minibuffer: Packages to install: 2 (company async), proceed? (y or n) As you can see, I've set the `(package-install-selected-packages t)' option. So, how to let `package-install-selected-packages' install packages without asking for confirmation. Regards -- Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province